{ "swagger": "2.0", "info": { "description": "使用gin+gorm进行极速开发的全栈开发基础平台", "title": "RBAC Swagger API接口文档", "contact": {}, "version": "v1.0.0" }, "paths": { "/api/auth/captcha": { "get": { "produces": [ "application/json" ], "tags": [ "登录相关" ], "summary": "获取验证码", "responses": { "200": { "description": "获取验证码", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/response.CaptchaRes" } } } ] } } } } }, "/api/auth/login": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "登录相关" ], "summary": "pc登录", "parameters": [ { "description": "用户名, 密码, 验证码,验证码id", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.Login" } } ], "responses": { "200": { "description": "登录成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/auth/logout": { "get": { "security": [ { "ApiKeyAuth": [] } ], "produces": [ "application/json" ], "tags": [ "登录相关" ], "summary": "pc登出", "responses": { "200": { "description": "登出成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/client/delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "客户端管理" ], "summary": "删除client", "parameters": [ { "description": "ids", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.IdsReq" } } ], "responses": { "200": { "description": "删除client", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/client/detail": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "id获取详情", "produces": [ "application/json" ], "tags": [ "客户端管理" ], "summary": "获取client详情", "parameters": [ { "type": "string", "description": "id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "获取client详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/system.Client" }, "msg": { "type": "string" } } } ] } } } } }, "/api/client/getClientList": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "客户端管理" ], "summary": "获取client列表", "parameters": [ { "description": "client", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.GetClientList" } } ], "responses": { "200": { "description": "获取client列表", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/response.PageResult" }, "msg": { "type": "string" } } } ] } } } } }, "/api/client/save": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "客户端管理" ], "summary": "创建client", "parameters": [ { "description": "client", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system.Client" } } ], "responses": { "200": { "description": "创建client", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/client/update": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "客户端管理" ], "summary": "更新client", "parameters": [ { "description": "client", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system.Client" } } ], "responses": { "200": { "description": "更新client", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/menu/delete": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "删除menu", "produces": [ "application/json" ], "tags": [ "菜单管理" ], "summary": "删除menu", "parameters": [ { "type": "string", "description": "id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/menu/detail": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "id获取详情", "produces": [ "application/json" ], "tags": [ "菜单管理" ], "summary": "获取menu详情", "parameters": [ { "type": "string", "description": "id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/system.Menu" }, "msg": { "type": "string" } } } ] } } } } }, "/api/menu/getAllMenuTree": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "菜单管理" ], "summary": "获取所有菜单树", "parameters": [ { "description": "菜单信息", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.GetMenuTree" } } ], "responses": { "200": { "description": "获取所有菜单树", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/system.Menu" } }, "msg": { "type": "string" } } } ] } } } } }, "/api/menu/getUserMenuTree": { "get": { "security": [ { "ApiKeyAuth": [] } ], "produces": [ "application/json" ], "tags": [ "菜单管理" ], "summary": "用户菜单数据", "responses": { "200": { "description": "用户菜单数据", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/system.Menu" } }, "msg": { "type": "string" } } } ] } } } } }, "/api/menu/route": { "get": { "security": [ { "ApiKeyAuth": [] } ], "produces": [ "application/json" ], "tags": [ "菜单管理" ], "summary": "用户路由", "responses": { "200": { "description": "用户route", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/system.Menu" } }, "msg": { "type": "string" } } } ] } } } } }, "/api/menu/save": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "菜单管理" ], "summary": "新增菜单", "parameters": [ { "description": "menu", "name": "data", "in": "body", "schema": { "$ref": "#/definitions/system.Menu" } } ], "responses": { "200": { "description": "新建菜单/按钮", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/role/delete": { "post": { "description": "删除角色", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "角色管理" ], "summary": "删除角色", "parameters": [ { "description": "批量删除角色", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.IdsReq" } } ], "responses": { "200": { "description": "删除角色", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/role/detail": { "get": { "security": [ { "ApiKeyAuth": [] } ], "produces": [ "application/json" ], "tags": [ "角色管理" ], "summary": "角色详情", "parameters": [ { "type": "string", "description": "id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "角色详情", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/system.Role" } } } ] } } } } }, "/api/role/getRoleList": { "post": { "description": "获取角色列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "角色管理" ], "summary": "获取角色列表", "parameters": [ { "description": "页码, 每页大小, 搜索条件", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.GetRoleList" } } ], "responses": { "200": { "description": "获取角色列表,返回包括列表,总数,页码,每页大小", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/response.PageResult" }, "msg": { "type": "string" } } } ] } } } } }, "/api/role/grantMenu": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "角色管理" ], "summary": "授权菜单给角色", "parameters": [ { "description": "授权菜单给角色", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.GrantMenu" } } ], "responses": { "200": { "description": "授权菜单给角色", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/role/save": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "角色管理" ], "summary": "创建角色", "parameters": [ { "description": "角色信息", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system.Role" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/role/update": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "角色管理" ], "summary": "修改角色", "parameters": [ { "description": "角色ID", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system.Role" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/user/changePassword": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "修改密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "修改密码", "parameters": [ { "description": "用户id", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.ChangePwd" } } ], "responses": { "200": { "description": "修改密码成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/system.User" } } } ] } } } } }, "/api/user/delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "删除用户", "parameters": [ { "description": "批量删除用户", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.IdsReq" } } ], "responses": { "200": { "description": "删除用户", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } }, "/api/user/detail": { "get": { "security": [ { "ApiKeyAuth": [] } ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户详情", "parameters": [ { "type": "string", "description": "id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "获取用户详情成功", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/system.User" } } } ] } } } } }, "/api/user/getUserList": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户列表", "parameters": [ { "description": "页码, 每页大小, 搜索条件", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.GetUserList" } } ], "responses": { "200": { "description": "获取用户列表,返回包括列表,总数,页码,每页大小", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/response.PageResult" }, "msg": { "type": "string" } } } ] } } } } }, "/api/user/grantRole": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "给用户分配角色", "parameters": [ { "description": "用户ID, 角色ID", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/request.GrantRole" } } ], "responses": { "200": { "description": "{\"code\": 200, \"data\": [...]}", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/user/save": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "新增用户", "parameters": [ { "description": "用户信息", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system.User" } } ], "responses": { "200": { "description": "{\"code\": 200, \"data\": {}, \"msg\": \"添加成功\"}", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/user/update": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "更新用户", "parameters": [ { "description": "用户ID,用户信息", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system.User" } } ], "responses": { "200": { "description": "{\"code\": 200, \"data\": [...]}", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/menu/update": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "菜单管理" ], "summary": "更新菜单", "parameters": [ { "description": "menu", "name": "data", "in": "body", "schema": { "$ref": "#/definitions/system.Menu" } } ], "responses": { "200": { "description": "更新菜单", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "msg": { "type": "string" } } } ] } } } } } }, "definitions": { "request.ChangePwd": { "type": "object", "properties": { "id": { "type": "string" }, "newPwd": { "type": "string" } } }, "request.GetClientList": { "type": "object", "properties": { "clientId": { "type": "string" }, "current": { "description": "页码", "type": "integer" }, "keyword": { "description": "关键字", "type": "string" }, "name": { "type": "string" }, "pageSize": { "description": "每页大小", "type": "integer" } } }, "request.GetMenuTree": { "type": "object", "properties": { "category": { "type": "integer" }, "parentId": { "type": "string" } } }, "request.GetRoleList": { "type": "object", "properties": { "code": { "type": "string" }, "current": { "description": "页码", "type": "integer" }, "keyword": { "description": "关键字", "type": "string" }, "name": { "type": "string" }, "pageSize": { "description": "每页大小", "type": "integer" } } }, "request.GetUserList": { "type": "object", "properties": { "account": { "type": "string" }, "current": { "description": "页码", "type": "integer" }, "keyword": { "description": "关键字", "type": "string" }, "pageSize": { "description": "每页大小", "type": "integer" }, "phone": { "type": "string" } } }, "request.GrantMenu": { "type": "object", "properties": { "menuIds": { "type": "array", "items": { "type": "string" } }, "roleId": { "type": "string" } } }, "request.GrantRole": { "type": "object", "properties": { "roleIds": { "type": "array", "items": { "type": "string" } }, "userId": { "type": "string" } } }, "request.IdsReq": { "type": "object", "properties": { "ids": { "type": "array", "items": { "type": "string" } } } }, "request.Login": { "type": "object", "properties": { "account": { "type": "string" }, "captcha": { "type": "string" }, "captchaId": { "type": "string" }, "password": { "type": "string" } } }, "response.CaptchaRes": { "type": "object", "properties": { "captcha": { "type": "string" }, "captchaId": { "type": "string" } } }, "response.PageResult": { "type": "object", "properties": { "list": {}, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "total": { "type": "integer" } } }, "response.Response": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "msg": { "type": "string" } } }, "system.Client": { "type": "object", "properties": { "activeTimeout": { "type": "integer" }, "additionalInfo": { "type": "string" }, "clientId": { "type": "string" }, "createdAt": { "type": "string" }, "grantType": { "type": "string" }, "id": { "description": "主键ID", "type": "string" }, "name": { "type": "string" }, "updatedAt": { "type": "string" } } }, "system.Menu": { "type": "object", "properties": { "category": { "type": "integer" }, "children": { "type": "array", "items": { "$ref": "#/definitions/system.Menu" } }, "code": { "type": "string" }, "createdAt": { "type": "string" }, "icon": { "type": "string" }, "id": { "description": "主键ID", "type": "string" }, "locale": { "type": "string" }, "name": { "type": "string" }, "parentId": { "type": "string" }, "permission": { "type": "string" }, "sort": { "type": "integer" }, "title": { "type": "string" }, "updatedAt": { "type": "string" } } }, "system.Role": { "type": "object", "properties": { "code": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "description": "主键ID", "type": "string" }, "menus": { "type": "array", "items": { "$ref": "#/definitions/system.Menu" } }, "name": { "type": "string" }, "sort": { "type": "integer" }, "updatedAt": { "type": "string" } } }, "system.User": { "type": "object", "properties": { "account": { "type": "string" }, "clientId": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "description": "主键ID", "type": "string" }, "phone": { "type": "string" }, "roles": { "type": "array", "items": { "$ref": "#/definitions/system.Role" } }, "tenantId": { "type": "string" }, "updatedAt": { "type": "string" } } } }, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }