{ "swagger": "2.0", "info": { "description": "This is a gateway server. On the page, you can go to do testing for every API.", "title": "Project cp-organization-management-gateway's APIs", "contact": {}, "license": {}, "version": "1.1" }, "paths": { "/api/v1/log/list": { "get": { "description": "获取日志列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "操作日志" ], "summary": "获取日志列表", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "type": "integer", "description": " ", "name": "page", "in": "query" }, { "type": "integer", "description": " ", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.ManagementLogListResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/system/rbac/group": { "put": { "description": "修改角色", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-角色管理" ], "summary": "修改角色", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "description": "token", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.RbacGroupUpdateBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.RbacGroupUpdateResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } }, "post": { "description": "添加角色", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-角色管理" ], "summary": "添加角色", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "description": "token", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.RbacGroupAddBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.RbacGroupAddResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/system/rbac/group/list": { "get": { "description": "角色列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-角色管理" ], "summary": "角色列表", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.RbacGroupListResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/system/rbac/group/{id}": { "delete": { "description": "删除角色", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-角色管理" ], "summary": "删除角色", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "type": "integer", "description": "token", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.RbacGroupDelResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/system/rbac/node/list": { "get": { "description": "权限节点列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-角色管理" ], "summary": "权限节点列表", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "type": "integer", "description": "不填返回所有,填了返回该角色下的权限", "name": "group_id", "in": "query" }, { "type": "boolean", "description": "填了groupid后,true:仅返回角色下的节点, false:返回所有节点,对属于该角色的节点作标记", "name": "only_select", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.RbacNodeListResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/system/user": { "put": { "description": "修改用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-用户管理" ], "summary": "修改用户", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "description": " ", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.UserUpdateBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.UserUpdateResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } }, "post": { "description": "创建用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-用户管理" ], "summary": "创建用户", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "description": " ", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.UserCreateBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.UserCreateResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/system/user/info/{id}": { "get": { "description": "用户详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-用户管理" ], "summary": "用户详情", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "type": "integer", "description": " ", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.UserInfoResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/system/user/list": { "get": { "description": "用户列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-用户管理" ], "summary": "用户列表", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "type": "integer", "description": " ", "name": "page", "in": "query" }, { "type": "integer", "description": " ", "name": "page_size", "in": "query" }, { "type": "string", "description": "姓名或账户名 ", "name": "name", "in": "query" }, { "type": "string", "description": "区域 ", "name": "zone", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.UserListResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/system/user/{id}": { "delete": { "description": "删除用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统管理-用户管理" ], "summary": "删除用户", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "type": "integer", "description": " ", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.UserDelResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/token_refresh": { "put": { "description": "刷新token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "刷新token", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.TokenResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/user/login": { "post": { "description": "登录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "登录", "parameters": [ { "description": "登录信息", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.LoginBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.LoginResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/zone": { "put": { "description": "修改区域", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "区域" ], "summary": "修改区域", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "description": " ", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.ZoneUpdateBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.ZoneUpdateResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } }, "post": { "description": "添加区域", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "区域" ], "summary": "添加区域", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "description": " ", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/v1.ZoneAddBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.ZoneAddResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/zone/list": { "get": { "description": "区域列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "区域" ], "summary": "区域列表", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.ZoneListResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } }, "/api/v1/zone/{zone_code}": { "delete": { "description": "删除区域", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "区域" ], "summary": "删除区域", "parameters": [ { "type": "string", "description": "token", "name": "token", "in": "header", "required": true }, { "type": "string", "description": " ", "name": "zone_code", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/v1.ZoneDelResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/base.HTTPError" } } } } } }, "definitions": { "base.HTTPError": { "type": "object", "properties": { "code": { "type": "integer", "format": "int", "example": 500 }, "message": { "type": "string", "example": "status bad request" } } }, "v1.CreateManagementUserReply": { "type": "object", "properties": { "uid": { "type": "integer" } } }, "v1.LoginBody": { "type": "object", "properties": { "key": { "type": "string" }, "password": { "type": "string" }, "user": { "type": "string" } } }, "v1.LoginData": { "type": "object", "properties": { "organization": { "type": "string" }, "refresh_token": { "type": "string" }, "token": { "type": "string" }, "uid": { "type": "integer" }, "user": { "type": "string" } } }, "v1.LoginResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.LoginData" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.ManagementLogItem": { "type": "object", "properties": { "action": { "description": "行为", "type": "string" }, "created_at": { "description": "时间", "type": "string" }, "id": { "description": "日志id", "type": "integer" }, "module": { "description": "模块", "type": "string" }, "origin": { "description": "修改前信息", "type": "string" }, "target": { "description": "修改后信息", "type": "string" }, "uid": { "description": "账号id", "type": "integer" }, "username": { "description": "账号名", "type": "string" } } }, "v1.ManagementLogListReply": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/v1.ManagementLogItem" } }, "page": { "type": "integer" }, "total": { "type": "integer" } } }, "v1.ManagementLogListResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.ManagementLogListReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.RbacGroupAddBody": { "type": "object", "properties": { "name": { "type": "string" }, "node_list": { "type": "string" } } }, "v1.RbacGroupAddReply": { "type": "object", "properties": { "id": { "type": "integer" } } }, "v1.RbacGroupAddResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.RbacGroupAddReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.RbacGroupDelResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.RbacGroupItem": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } }, "v1.RbacGroupListReply": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/v1.RbacGroupItem" } } } }, "v1.RbacGroupListResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.RbacGroupListReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.RbacGroupUpdateBody": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "node_list": { "type": "string" } } }, "v1.RbacGroupUpdateResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.RbacNodeItem": { "type": "object", "properties": { "childs": { "type": "array", "items": { "$ref": "#/definitions/v1.RbacNodeItem" } }, "id": { "type": "integer" }, "method": { "type": "string" }, "name": { "type": "string" }, "object": { "type": "string" }, "pid": { "type": "integer" }, "resource": { "type": "string" }, "router": { "type": "string" }, "select": { "type": "boolean" } } }, "v1.RbacNodeListReply": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/v1.RbacNodeItem" } } } }, "v1.RbacNodeListResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.RbacNodeListReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.TokenResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "string" }, "message": { "description": "消息", "type": "string", "default": "success" }, "refresh_token": { "type": "string" } } }, "v1.UserCreateBody": { "type": "object", "properties": { "email": { "type": "string" }, "group_id": { "type": "integer" }, "name": { "description": "姓名", "type": "string" }, "password": { "type": "string" }, "phone": { "type": "string" }, "username": { "description": "账户名", "type": "string" }, "zones": { "type": "string" } } }, "v1.UserCreateResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.CreateManagementUserReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.UserDelResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.UserInfoReply": { "type": "object", "properties": { "email": { "type": "string" }, "group_id": { "description": "所属角色", "type": "integer" }, "group_name": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "node_list": { "description": "所拥有的权限", "type": "array", "items": { "$ref": "#/definitions/v1.RbacNodeItem" } }, "phone": { "type": "string" }, "username": { "type": "string" }, "zone_list": { "type": "array", "items": { "$ref": "#/definitions/v1.ZoneItemSelect" } } } }, "v1.UserInfoResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.UserInfoReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.UserItem": { "type": "object", "properties": { "email": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "phone": { "type": "string" }, "username": { "type": "string" }, "zones": { "type": "array", "items": { "type": "string" } } } }, "v1.UserListReply": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/v1.UserItem" } }, "page": { "type": "integer" }, "total": { "type": "integer" } } }, "v1.UserListResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.UserListReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.UserUpdateBody": { "type": "object", "properties": { "email": { "type": "string" }, "group_id": { "type": "integer" }, "id": { "type": "integer" }, "name": { "description": "姓名", "type": "string" }, "password": { "type": "string" }, "phone": { "type": "string" }, "username": { "description": "账户名", "type": "string" }, "zones": { "type": "string" } } }, "v1.UserUpdateResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.ZoneAddBody": { "type": "object", "properties": { "parent_zone_code": { "type": "string" }, "zone_name": { "type": "string" } } }, "v1.ZoneAddReply": { "type": "object", "properties": { "zone_code": { "type": "string" } } }, "v1.ZoneAddResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.ZoneAddReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.ZoneDelResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.ZoneItem": { "type": "object", "properties": { "childs": { "type": "array", "items": { "$ref": "#/definitions/v1.ZoneItem" } }, "parent_zone_code": { "type": "string" }, "zone_code": { "type": "string" }, "zone_name": { "type": "string" } } }, "v1.ZoneItemSelect": { "type": "object", "properties": { "childs": { "type": "array", "items": { "$ref": "#/definitions/v1.ZoneItemSelect" } }, "parent_zone_code": { "type": "string" }, "select": { "type": "boolean" }, "zone_code": { "type": "string" }, "zone_name": { "type": "string" } } }, "v1.ZoneListReply": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/v1.ZoneItem" } } } }, "v1.ZoneListResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "data": { "type": "object", "$ref": "#/definitions/v1.ZoneListReply" }, "message": { "description": "消息", "type": "string", "default": "success" } } }, "v1.ZoneUpdateBody": { "type": "object", "properties": { "parent_zone_code": { "type": "string" }, "zone_code": { "type": "string" }, "zone_name": { "type": "string" } } }, "v1.ZoneUpdateResponse": { "type": "object", "properties": { "code": { "description": "返回码", "type": "integer", "format": "int", "default": 0 }, "message": { "description": "消息", "type": "string", "default": "success" } } } } }