gofiber-study/docs/swagger.yaml

719 lines
16 KiB
YAML

basePath: /
definitions:
auth.LoginDTO:
properties:
account:
example: root
type: string
password:
example: "12341234"
type: string
required:
- account
- password
type: object
auth.LoginVO:
properties:
refreshToken:
description: refreshToken 刷新令牌
example: 0123456789ABCDEFG
type: string
token:
description: token 用户令牌
example: 0123456789ABCDEFG
type: string
type: object
auth.RefreshToken:
properties:
refreshToken:
example: 0123456789ABCDEFG
type: string
required:
- refreshToken
type: object
captcha.Captcha:
properties:
base64:
description: 验证码图片 base64
example: data:image/png;base64,iVBO...
type: string
expire:
description: 过期时间 unix
example: 10000000
type: integer
id:
description: 验证码 id
example: abcdefg123456
type: string
type: object
captcha.VerifyCaptcha:
properties:
captcha:
example: abcde
type: string
id:
example: abcdefg123456
type: string
type: object
errorx.CodeErrorResponse:
properties:
code:
example: 200
type: integer
data: {}
msg:
example: OK
type: string
type: object
fiber.Route:
properties:
method:
description: Public fields
type: string
name:
description: Route's name
type: string
params:
description: Case sensitive param keys
items:
type: string
type: array
path:
description: Original registered route path
type: string
type: object
global.UserClaims:
properties:
account:
type: string
id:
type: string
identify:
type: string
type: object
models.User:
properties:
account:
type: string
active:
type: boolean
alias:
type: string
contact:
type: string
email:
type: string
emailVerify:
type: boolean
id:
type: string
lastLoginTime:
type: string
memo:
type: string
registerTime:
type: string
userName:
type: string
type: object
response.Response:
properties:
code:
example: 200
type: integer
data: {}
msg:
example: OK
type: string
type: object
topical.CreateTopicalDTO:
properties:
content:
type: string
title:
type: string
type: object
info:
contact:
email: 919411476@qq.com
name: Shikong
description: 基于 Fiber 框架的 swagger
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: GoFiber Study API
version: "1.0"
paths:
/auth/login:
post:
consumes:
- application/json
description: 用户登录
parameters:
- description: 用户登录
in: body
name: vo
required: true
schema:
$ref: '#/definitions/auth.LoginDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/auth.LoginVO'
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 用户登录
tags:
- Auth
/auth/refreshToken:
post:
consumes:
- application/json
description: 刷新令牌
parameters:
- description: 刷新令牌
in: body
name: vo
required: true
schema:
$ref: '#/definitions/auth.RefreshToken'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/auth.LoginVO'
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 刷新令牌
tags:
- Auth
/casbin/getUserRoles:
get:
consumes:
- application/json
description: 用户所有角色
parameters:
- default: root
description: 用户账号
in: query
name: account
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
items:
type: string
type: array
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 用户所有角色
tags:
- CasBin
/casbin/reload:
post:
consumes:
- application/json
description: 重新加载 casbin 策略
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 重新加载 casbin 策略
tags:
- CasBin
/casbin/test:
get:
consumes:
- application/json
description: casbin 鉴权测试
parameters:
- description: 身份
in: query
name: identity
required: true
type: string
- description: 系统
in: query
name: system
required: true
type: string
- description: api
in: query
name: api
required: true
type: string
- description: 动作
in: query
name: act
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: casbin 鉴权测试
tags:
- CasBin
/error:
delete:
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 错误处理
tags:
- Error
get:
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 错误处理
tags:
- Error
patch:
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 错误处理
tags:
- Error
post:
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 错误处理
tags:
- Error
put:
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 错误处理
tags:
- Error
/routes:
get:
consumes:
- application/json
description: 获取所有路由信息
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
items:
items:
$ref: '#/definitions/fiber.Route'
type: array
type: array
type: object
summary: 获取所有路由
tags:
- Routes
/test/captcha/get:
get:
consumes:
- application/json
description: 验证码 生成测试
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/captcha.Captcha'
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 验证码 生成测试
tags:
- Test
/test/captcha/verify:
post:
consumes:
- application/json
description: 验证码 验证测试
parameters:
- description: 验证码验证
in: body
name: vo
required: true
schema:
$ref: '#/definitions/captcha.VerifyCaptcha'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 验证码 验证测试
tags:
- Test
/test/jwt:
get:
consumes:
- application/json
description: jwt token 解析测试
parameters:
- description: token
in: query
name: token
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/global.UserClaims'
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: jwt token 解析测试
tags:
- Test
post:
consumes:
- application/json
description: jwt token 生成测试
parameters:
- description: userClaims
in: body
name: vo
required: true
schema:
$ref: '#/definitions/global.UserClaims'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: jwt token 生成测试
tags:
- Test
/test/nanoid:
get:
consumes:
- application/json
description: nanoid 生成测试
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: nanoid 生成测试
tags:
- Test
/test/sonyFlake:
get:
consumes:
- application/json
description: sonyFlake id 生成测试
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: integer
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: sonyFlake id 生成测试
tags:
- Test
/test/waf/access:
get:
consumes:
- application/json
description: waf 访问频率限制 测试
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: waf 访问频率限制 测试
tags:
- Test
/test/wol:
get:
consumes:
- application/json
description: wol 测试
parameters:
- description: mac
in: query
name: mac
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: wol 测试
tags:
- Test
/topical/create:
post:
consumes:
- application/json
description: 创建主题
parameters:
- description: CreateTopicalDTO
in: body
name: vo
required: true
schema:
$ref: '#/definitions/topical.CreateTopicalDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
security:
- Token: []
summary: 创建主题
tags:
- Topical
/topical/delete:
delete:
consumes:
- application/json
description: 删除主题
parameters:
- in: query
name: id
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
type: string
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
security:
- Token: []
summary: 删除主题
tags:
- Topical
/user/account:
get:
consumes:
- application/json
description: 获取当前用户信息
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
$ref: '#/definitions/models.User'
type: object
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
security:
- Token: []
summary: 获取当前用户信息
tags:
- User
securityDefinitions:
Token:
in: header
name: token
type: apiKey
swagger: "2.0"