feat: swagger

This commit is contained in:
Blizzard
2025-09-16 14:27:32 +08:00
parent 79c19bc47c
commit 237ac665e6
19 changed files with 4690 additions and 91 deletions
+1636
View File
File diff suppressed because it is too large Load Diff
+1610
View File
File diff suppressed because it is too large Load Diff
+951
View File
@@ -0,0 +1,951 @@
definitions:
request.ChangePwd:
properties:
id:
type: string
newPwd:
type: string
type: object
request.GetClientList:
properties:
clientId:
type: string
current:
description: 页码
type: integer
keyword:
description: 关键字
type: string
name:
type: string
pageSize:
description: 每页大小
type: integer
type: object
request.GetMenuTree:
properties:
category:
type: integer
parentId:
type: string
type: object
request.GetRoleList:
properties:
code:
type: string
current:
description: 页码
type: integer
keyword:
description: 关键字
type: string
name:
type: string
pageSize:
description: 每页大小
type: integer
type: object
request.GetUserList:
properties:
account:
type: string
current:
description: 页码
type: integer
keyword:
description: 关键字
type: string
pageSize:
description: 每页大小
type: integer
phone:
type: string
type: object
request.GrantMenu:
properties:
menuIds:
items:
type: string
type: array
roleId:
type: string
type: object
request.GrantRole:
properties:
roleIds:
items:
type: string
type: array
userId:
type: string
type: object
request.IdsReq:
properties:
ids:
items:
type: string
type: array
type: object
request.Login:
properties:
account:
type: string
captcha:
type: string
captchaId:
type: string
password:
type: string
type: object
response.CaptchaRes:
properties:
captcha:
type: string
captchaId:
type: string
type: object
response.PageResult:
properties:
list: {}
page:
type: integer
pageSize:
type: integer
total:
type: integer
type: object
response.Response:
properties:
code:
type: integer
data: {}
msg:
type: string
type: object
system.Client:
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
type: object
system.Menu:
properties:
category:
type: integer
children:
items:
$ref: '#/definitions/system.Menu'
type: array
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
type: object
system.Role:
properties:
code:
type: string
createdAt:
type: string
id:
description: 主键ID
type: string
menus:
items:
$ref: '#/definitions/system.Menu'
type: array
name:
type: string
sort:
type: integer
updatedAt:
type: string
type: object
system.User:
properties:
account:
type: string
clientId:
type: string
createdAt:
type: string
id:
description: 主键ID
type: string
phone:
type: string
roles:
items:
$ref: '#/definitions/system.Role'
type: array
tenantId:
type: string
updatedAt:
type: string
type: object
info:
contact: {}
description: 使用gin+gorm进行极速开发的全栈开发基础平台
title: RBAC Swagger API接口文档
version: v1.0.0
paths:
/api/auth/captcha:
get:
produces:
- application/json
responses:
"200":
description: 获取验证码
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/response.CaptchaRes'
type: object
summary: 获取验证码
tags:
- 登录相关
/api/auth/login:
post:
consumes:
- application/json
parameters:
- description: 用户名, 密码, 验证码,验证码id
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.Login'
produces:
- application/json
responses:
"200":
description: 登录成功
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
summary: pc登录
tags:
- 登录相关
/api/auth/logout:
get:
produces:
- application/json
responses:
"200":
description: 登出成功
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: pc登出
tags:
- 登录相关
/api/client/delete:
post:
consumes:
- application/json
parameters:
- description: ids
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.IdsReq'
produces:
- application/json
responses:
"200":
description: 删除client
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 删除client
tags:
- 客户端管理
/api/client/detail:
get:
description: id获取详情
parameters:
- description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 获取client详情
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/system.Client'
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 获取client详情
tags:
- 客户端管理
/api/client/getClientList:
post:
consumes:
- application/json
parameters:
- description: client
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.GetClientList'
produces:
- application/json
responses:
"200":
description: 获取client列表
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/response.PageResult'
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 获取client列表
tags:
- 客户端管理
/api/client/save:
post:
consumes:
- application/json
parameters:
- description: client
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.Client'
produces:
- application/json
responses:
"200":
description: 创建client
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 创建client
tags:
- 客户端管理
/api/client/update:
post:
consumes:
- application/json
parameters:
- description: client
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.Client'
produces:
- application/json
responses:
"200":
description: 更新client
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 更新client
tags:
- 客户端管理
/api/menu/delete:
get:
description: 删除menu
parameters:
- description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 详情
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 删除menu
tags:
- 菜单管理
/api/menu/detail:
get:
description: id获取详情
parameters:
- description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 详情
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/system.Menu'
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 获取menu详情
tags:
- 菜单管理
/api/menu/getAllMenuTree:
post:
consumes:
- application/json
parameters:
- description: 菜单信息
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.GetMenuTree'
produces:
- application/json
responses:
"200":
description: 获取所有菜单树
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
items:
$ref: '#/definitions/system.Menu'
type: array
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 获取所有菜单树
tags:
- 菜单管理
/api/menu/getUserMenuTree:
get:
produces:
- application/json
responses:
"200":
description: 用户菜单数据
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
items:
$ref: '#/definitions/system.Menu'
type: array
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 用户菜单数据
tags:
- 菜单管理
/api/menu/route:
get:
produces:
- application/json
responses:
"200":
description: 用户route
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
items:
$ref: '#/definitions/system.Menu'
type: array
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 用户路由
tags:
- 菜单管理
/api/menu/save:
post:
consumes:
- application/json
parameters:
- description: menu
in: body
name: data
schema:
$ref: '#/definitions/system.Menu'
produces:
- application/json
responses:
"200":
description: 新建菜单/按钮
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 新增菜单
tags:
- 菜单管理
/api/role/delete:
post:
consumes:
- application/json
description: 删除角色
parameters:
- description: 批量删除角色
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.IdsReq'
produces:
- application/json
responses:
"200":
description: 删除角色
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
summary: 删除角色
tags:
- 角色管理
/api/role/detail:
get:
parameters:
- description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 角色详情
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/system.Role'
type: object
security:
- ApiKeyAuth: []
summary: 角色详情
tags:
- 角色管理
/api/role/getRoleList:
post:
consumes:
- application/json
description: 获取角色列表
parameters:
- description: 页码, 每页大小, 搜索条件
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.GetRoleList'
produces:
- application/json
responses:
"200":
description: 获取角色列表,返回包括列表,总数,页码,每页大小
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/response.PageResult'
msg:
type: string
type: object
summary: 获取角色列表
tags:
- 角色管理
/api/role/grantMenu:
post:
consumes:
- application/json
parameters:
- description: 授权菜单给角色
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.GrantMenu'
produces:
- application/json
responses:
"200":
description: 授权菜单给角色
schema:
$ref: '#/definitions/response.Response'
security:
- ApiKeyAuth: []
summary: 授权菜单给角色
tags:
- 角色管理
/api/role/save:
post:
consumes:
- application/json
parameters:
- description: 角色信息
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.Role'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/response.Response'
security:
- ApiKeyAuth: []
summary: 创建角色
tags:
- 角色管理
/api/role/update:
post:
consumes:
- application/json
parameters:
- description: 角色ID
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.Role'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/response.Response'
security:
- ApiKeyAuth: []
summary: 修改角色
tags:
- 角色管理
/api/user/changePassword:
post:
consumes:
- application/json
description: 修改密码
parameters:
- description: 用户id
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.ChangePwd'
produces:
- application/json
responses:
"200":
description: 修改密码成功
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/system.User'
type: object
security:
- ApiKeyAuth: []
summary: 修改密码
tags:
- 用户管理
/api/user/delete:
post:
consumes:
- application/json
parameters:
- description: 批量删除用户
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.IdsReq'
produces:
- application/json
responses:
"200":
description: 删除用户
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 删除用户
tags:
- 用户管理
/api/user/detail:
get:
parameters:
- description: id
in: query
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: 获取用户详情成功
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/system.User'
type: object
security:
- ApiKeyAuth: []
summary: 获取用户详情
tags:
- 用户管理
/api/user/getUserList:
post:
consumes:
- application/json
parameters:
- description: 页码, 每页大小, 搜索条件
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.GetUserList'
produces:
- application/json
responses:
"200":
description: 获取用户列表,返回包括列表,总数,页码,每页大小
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/response.PageResult'
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 获取用户列表
tags:
- 用户管理
/api/user/grantRole:
post:
consumes:
- application/json
parameters:
- description: 用户ID, 角色ID
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.GrantRole'
produces:
- application/json
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
$ref: '#/definitions/response.Response'
security:
- ApiKeyAuth: []
summary: 给用户分配角色
tags:
- 用户管理
/api/user/save:
post:
consumes:
- application/json
parameters:
- description: 用户信息
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.User'
produces:
- application/json
responses:
"200":
description: '{"code": 200, "data": {}, "msg": "添加成功"}'
schema:
$ref: '#/definitions/response.Response'
security:
- ApiKeyAuth: []
summary: 新增用户
tags:
- 用户管理
/api/user/update:
post:
consumes:
- application/json
parameters:
- description: 用户ID,用户信息
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.User'
produces:
- application/json
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
$ref: '#/definitions/response.Response'
security:
- ApiKeyAuth: []
summary: 更新用户
tags:
- 用户管理
/menu/update:
post:
consumes:
- application/json
parameters:
- description: menu
in: body
name: data
schema:
$ref: '#/definitions/system.Menu'
produces:
- application/json
responses:
"200":
description: 更新菜单
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
msg:
type: string
type: object
security:
- ApiKeyAuth: []
summary: 更新菜单
tags:
- 菜单管理
securityDefinitions:
ApiKeyAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"