251 lines
8.3 KiB
JSON
251 lines
8.3 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"contact": {},
|
|
"license": {}
|
|
},
|
|
"paths": {
|
|
"/admin/login": {
|
|
"get": {
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"summary": "后台登录",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "username",
|
|
"in": "query",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "query",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{\"code\":200,\"data\":{},\"msg\":\"ok\"}",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/employees": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"employees"
|
|
],
|
|
"summary": "获取员工列表",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "auth by /admin/login",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Department",
|
|
"name": "department",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "Position",
|
|
"name": "position",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "State",
|
|
"name": "state",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{\"code\": 200, \"data\": {}, \"msg\":\"ok\"}",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"employees"
|
|
],
|
|
"summary": "新增员工",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "auth by /admin/login",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工用户名",
|
|
"name": "username",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工密码",
|
|
"name": "password",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工部门",
|
|
"name": "department",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工职位",
|
|
"name": "position",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{\"code\": 200, \"data\":{}, \"msg\":\"ok\"}",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/admin/v1/employees/{id}": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"employees"
|
|
],
|
|
"summary": "获取单个员工",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "auth by /admin/login",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{\"code\": 200, \"data\": {}, \"msg\": \"ok\"}",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"employees"
|
|
],
|
|
"summary": "更新员工",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "auth by /admin/login",
|
|
"name": "Authorization",
|
|
"in": "header",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工用户名",
|
|
"name": "username",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工密码",
|
|
"name": "password",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工部门",
|
|
"name": "department",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工职位",
|
|
"name": "position",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "员工状态",
|
|
"name": "state",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{\"code\": 200, \"data\":{}, \"msg\":\"ok\"}",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |