1718 lines
56 KiB
JSON
1718 lines
56 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "This is a sample server celler server.",
|
|
"title": "WMS Wareify API Docs",
|
|
"termsOfService": "http://swagger.io/terms/",
|
|
"contact": {
|
|
"name": "API Support",
|
|
"url": "http://www.swagger.io/support",
|
|
"email": "support@swagger.io"
|
|
},
|
|
"license": {
|
|
"name": "Apache 2.0",
|
|
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
},
|
|
"version": "1.0"
|
|
},
|
|
"host": "localhost:8888",
|
|
"basePath": "/api/v1",
|
|
"paths": {
|
|
"/auth/login": {
|
|
"post": {
|
|
"description": "Authenticate user and return access \u0026 refresh tokens.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "User login",
|
|
"parameters": [
|
|
{
|
|
"description": "Login payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.UserLoginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/refresh": {
|
|
"post": {
|
|
"description": "Exchange a refresh token for a new access token (and optionally a new refresh token).",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Refresh auth token",
|
|
"parameters": [
|
|
{
|
|
"description": "Refresh token payload",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/clients": {
|
|
"get": {
|
|
"description": "Get paginated list of clients with filtering and sorting capabilities",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Clients"
|
|
],
|
|
"summary": "Get list of clients",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by name (partial match)",
|
|
"name": "name",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by code (partial match)",
|
|
"name": "code",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page size (default: 10)",
|
|
"name": "per_page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page number (default: 1)",
|
|
"name": "page",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.ResponseWithPagination"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Create a new client with the provided information",
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Clients"
|
|
],
|
|
"summary": "Create a new client",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Client name",
|
|
"name": "name",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Client code",
|
|
"name": "code",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "file",
|
|
"description": "Client logo (optional)",
|
|
"name": "logo",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/clients/{id}": {
|
|
"get": {
|
|
"description": "Get detailed information of a specific client by their ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Clients"
|
|
],
|
|
"summary": "Get client by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Client ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Update client information by ID",
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Clients"
|
|
],
|
|
"summary": "Update client",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Client ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Client name",
|
|
"name": "name",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Client code",
|
|
"name": "code",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"description": "Client logo (optional)",
|
|
"name": "logo",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Delete a client by ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Clients"
|
|
],
|
|
"summary": "Delete client",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Client ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/clients/{id}/assign-menus": {
|
|
"post": {
|
|
"description": "Assign one or more menus to a client",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Clients"
|
|
],
|
|
"summary": "Assign menus to client",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Client ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Menu assignment data",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.AssignMenusToClientRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/clients/{id}/remove-menus": {
|
|
"post": {
|
|
"description": "Remove one or more menus from a client",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Clients"
|
|
],
|
|
"summary": "Remove menus from client",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Client ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Menu removal data",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.RemoveMenusFromClientRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/example/helloworld": {
|
|
"get": {
|
|
"description": "do ping",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"example"
|
|
],
|
|
"summary": "ping example",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/maintenance-groups": {
|
|
"get": {
|
|
"description": "Get all maintenance groups",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"MaintenanceGroup"
|
|
],
|
|
"summary": "Get all maintenance groups",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Update maintenance group",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"MaintenanceGroup"
|
|
],
|
|
"summary": "Update maintenance group",
|
|
"parameters": [
|
|
{
|
|
"description": "Update payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.MaintGroupUpdateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Create a new maintenance group",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"MaintenanceGroup"
|
|
],
|
|
"summary": "Create a new maintenance group",
|
|
"parameters": [
|
|
{
|
|
"description": "Create payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.MaintGroupCreateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/maintenance-groups/{id}": {
|
|
"get": {
|
|
"description": "Get maintenance group by ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"MaintenanceGroup"
|
|
],
|
|
"summary": "Get maintenance group by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "MaintenanceGroup ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Delete maintenance group",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"MaintenanceGroup"
|
|
],
|
|
"summary": "Delete maintenance group",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "MaintenanceGroup ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/menus": {
|
|
"get": {
|
|
"description": "Get paginated list of menus with filtering and sorting capabilities",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Menus"
|
|
],
|
|
"summary": "Get list of menus",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by name (partial match)",
|
|
"name": "name",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by parent menu ID",
|
|
"name": "parent_id",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"collectionFormat": "csv",
|
|
"description": "Include related entities",
|
|
"name": "includes",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page number (default: 1)",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page size (default: 10)",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.ResponseWithPagination"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Create a new menu with the provided information",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Menus"
|
|
],
|
|
"summary": "Create a new menu",
|
|
"parameters": [
|
|
{
|
|
"description": "Menu creation data",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.MenuCreateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/menus/by-name": {
|
|
"get": {
|
|
"description": "Get menu information by its name",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Menus"
|
|
],
|
|
"summary": "Get menu by name",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Menu name",
|
|
"name": "name",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/menus/{id}": {
|
|
"get": {
|
|
"description": "Get detailed information of a specific menu by its ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Menus"
|
|
],
|
|
"summary": "Get menu by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Menu ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"description": "Update menu information by ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Menus"
|
|
],
|
|
"summary": "Update menu",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Menu ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"description": "Menu update data",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.MenuUpdateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "Delete a menu by ID",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Menus"
|
|
],
|
|
"summary": "Delete menu",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Menu ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Get paginated list of users for the current client. Supports filtering by name and including related roles.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Get list of users",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Filter by name (partial match)",
|
|
"name": "name",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page number (default: 1)",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "Page size (default: 10)",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Sort expression, e.g. created_at desc",
|
|
"name": "sort",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/utils.ResponseWithPagination"
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Update profile of the authenticated user. Use multipart/form-data if uploading files (photo).",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Update current user",
|
|
"parameters": [
|
|
{
|
|
"description": "Update payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.UserUpdateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Delete the authenticated user's account (soft/hard depends on implementation).",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Delete current user",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/me": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Return the authenticated user's profile.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Get current user",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/register": {
|
|
"post": {
|
|
"description": "Create a new user under the authenticated client. Validates input and returns created user.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Register a new user",
|
|
"parameters": [
|
|
{
|
|
"description": "Register payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.UserCreateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/send-verification-email": {
|
|
"post": {
|
|
"description": "Send email with verification code/link to a user's email address.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Send verification email",
|
|
"parameters": [
|
|
{
|
|
"description": "Email request payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.SendVerificationEmailRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/verify-email": {
|
|
"post": {
|
|
"description": "Verify a user's email using code or token sent via email.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Verify user email",
|
|
"parameters": [
|
|
{
|
|
"description": "Verify email payload",
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.VerifyEmailRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Get details of a user by their ID. Requires appropriate permissions.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"summary": "Get user by ID",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/utils.Response"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"dto.AssignMenusToClientRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"menu_ids"
|
|
],
|
|
"properties": {
|
|
"menu_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"dto.MaintGroupCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"client_id",
|
|
"code",
|
|
"maintenance_group_roles",
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"client_id": {
|
|
"type": "string"
|
|
},
|
|
"code": {
|
|
"type": "string",
|
|
"maxLength": 50,
|
|
"minLength": 2
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"maintenance_group_roles": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/dto.MaintenanceGroupRole"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
}
|
|
}
|
|
},
|
|
"dto.MaintGroupUpdateRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"client_id": {
|
|
"type": "string"
|
|
},
|
|
"code": {
|
|
"type": "string",
|
|
"maxLength": 50,
|
|
"minLength": 2
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"maintenance_group_roles": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/dto.MaintenanceGroupRoleUpdate"
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
}
|
|
}
|
|
},
|
|
"dto.MaintenanceGroupRole": {
|
|
"type": "object",
|
|
"required": [
|
|
"level",
|
|
"maintenance_group_role_users",
|
|
"role_id"
|
|
],
|
|
"properties": {
|
|
"level": {
|
|
"type": "integer"
|
|
},
|
|
"maintenance_group_role_users": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/dto.MaintenanceGroupRoleUser"
|
|
}
|
|
},
|
|
"role_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.MaintenanceGroupRoleUpdate": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"level": {
|
|
"type": "integer"
|
|
},
|
|
"maintenance_group_role_users": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/dto.MaintenanceGroupRoleUser"
|
|
}
|
|
},
|
|
"role_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.MaintenanceGroupRoleUser": {
|
|
"type": "object",
|
|
"required": [
|
|
"user_id"
|
|
],
|
|
"properties": {
|
|
"user_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.MenuCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"mode",
|
|
"name",
|
|
"sequence",
|
|
"url"
|
|
],
|
|
"properties": {
|
|
"icon_url": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
},
|
|
"mode": {
|
|
"type": "string",
|
|
"maxLength": 20,
|
|
"minLength": 8
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
},
|
|
"parent_id": {
|
|
"type": "string"
|
|
},
|
|
"sequence": {
|
|
"type": "integer"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"table_name": {
|
|
"type": "string",
|
|
"maxLength": 10
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"minLength": 8
|
|
}
|
|
}
|
|
},
|
|
"dto.MenuUpdateRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"icon_url": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
},
|
|
"mode": {
|
|
"type": "string",
|
|
"maxLength": 20,
|
|
"minLength": 2
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
},
|
|
"parent_id": {
|
|
"type": "string"
|
|
},
|
|
"sequence": {
|
|
"type": "integer"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"table_name": {
|
|
"type": "string",
|
|
"maxLength": 10
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"minLength": 8
|
|
}
|
|
}
|
|
},
|
|
"dto.RemoveMenusFromClientRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"menu_ids"
|
|
],
|
|
"properties": {
|
|
"menu_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"dto.SendVerificationEmailRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"email"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.UserCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"client_id",
|
|
"email",
|
|
"name",
|
|
"password",
|
|
"username"
|
|
],
|
|
"properties": {
|
|
"address": {
|
|
"type": "string"
|
|
},
|
|
"client_id": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"gender": {
|
|
"type": "string",
|
|
"maxLength": 10
|
|
},
|
|
"location_id": {
|
|
"type": "string"
|
|
},
|
|
"maintenance_group_user_id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"minLength": 8
|
|
},
|
|
"phone": {
|
|
"type": "string",
|
|
"maxLength": 20,
|
|
"minLength": 8
|
|
},
|
|
"photo_url": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
}
|
|
}
|
|
},
|
|
"dto.UserLoginRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"email",
|
|
"password"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.UserUpdateRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"address": {
|
|
"type": "string"
|
|
},
|
|
"client_id": {
|
|
"type": "string"
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"gender": {
|
|
"type": "string",
|
|
"maxLength": 10
|
|
},
|
|
"location_id": {
|
|
"type": "string"
|
|
},
|
|
"maintenance_group_user_id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"minLength": 8
|
|
},
|
|
"phone": {
|
|
"type": "string",
|
|
"maxLength": 20,
|
|
"minLength": 8
|
|
},
|
|
"photo_url": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"maxLength": 100,
|
|
"minLength": 2
|
|
}
|
|
}
|
|
},
|
|
"dto.VerifyEmailRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"token"
|
|
],
|
|
"properties": {
|
|
"token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"utils.PaginationResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"max_page": {
|
|
"type": "integer"
|
|
},
|
|
"page": {
|
|
"type": "integer"
|
|
},
|
|
"per_page": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"utils.Response": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {},
|
|
"error": {},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"meta": {},
|
|
"status": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"utils.ResponseWithPagination": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer"
|
|
},
|
|
"data": {},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"pagination": {
|
|
"$ref": "#/definitions/utils.PaginationResponse"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"BearerAuth": {
|
|
"description": "Bearer token for authentication",
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
},
|
|
"externalDocs": {
|
|
"description": "OpenAPI",
|
|
"url": "https://swagger.io/resources/open-api/"
|
|
}
|
|
} |