gofiber-study/docs/swagger.yaml

419 lines
9.3 KiB
YAML
Raw Normal View History

2022-10-03 15:10:03 +08:00
basePath: /
definitions:
2022-10-06 17:23:22 +08:00
dto.Login:
properties:
account:
example: root
type: string
password:
example: "12341234"
type: string
type: object
2022-10-03 15:10:03 +08:00
errorx.CodeErrorResponse:
properties:
code:
example: 200
type: integer
data: {}
msg:
example: OK
type: string
type: object
2022-10-04 13:06:13 +08:00
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
2022-10-06 00:01:30 +08:00
global.UserClaims:
properties:
account:
type: string
id:
type: string
type: object
2022-10-04 14:59:46 +08:00
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
2022-10-03 15:37:55 +08:00
response.Response:
properties:
code:
example: 200
type: integer
data: {}
msg:
example: OK
type: string
type: object
2022-10-03 15:10:03 +08:00
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:
2022-10-06 17:23:22 +08:00
/auth/login:
post:
consumes:
- application/json
description: 用户登录
parameters:
- description: 用户登录
in: body
name: vo
required: true
schema:
$ref: '#/definitions/dto.Login'
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:
- Auth
2022-10-05 19:46:48 +08:00
/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
2022-10-03 15:37:55 +08:00
/error:
delete:
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
2022-10-03 15:10:03 +08:00
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
2022-10-03 15:37:55 +08:00
summary: 错误处理
tags:
- Error
get:
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
2022-10-03 15:10:03 +08:00
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
2022-10-03 15:37:55 +08:00
summary: 错误处理
2022-10-03 15:10:03 +08:00
tags:
2022-10-03 15:37:55 +08:00
- Error
patch:
2022-10-03 15:37:55 +08:00
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 错误处理
tags:
- Error
post:
2022-10-03 15:37:55 +08:00
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 错误处理
tags:
- Error
put:
2022-10-03 15:37:55 +08:00
consumes:
- application/json
description: 错误信息示例
produces:
- application/json
responses:
default:
description: ""
schema:
$ref: '#/definitions/errorx.CodeErrorResponse'
summary: 错误处理
tags:
- Error
/routes:
get:
2022-10-03 15:37:55 +08:00
consumes:
- application/json
description: 获取所有路由信息
2022-10-03 15:37:55 +08:00
produces:
- application/json
responses:
"200":
description: OK
2022-10-03 15:37:55 +08:00
schema:
2022-10-04 13:06:13 +08:00
allOf:
- $ref: '#/definitions/response.Response'
- properties:
data:
items:
items:
$ref: '#/definitions/fiber.Route'
type: array
type: array
type: object
summary: 获取所有路由
2022-10-03 15:37:55 +08:00
tags:
- Routes
2022-10-06 00:01:30 +08:00
/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
2022-10-06 00:03:56 +08:00
name: vo
2022-10-06 00:01:30 +08:00
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
2022-10-04 14:59:46 +08:00
/user/account:
get:
consumes:
- application/json
description: 根据 账号 获取用户信息
parameters:
- description: 账号名称
in: query
name: account
required: true
type: string
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'
2022-10-05 14:47:07 +08:00
security:
- Token: []
2022-10-04 14:59:46 +08:00
summary: 根据 账号 获取用户信息
tags:
- User
2022-10-05 14:47:07 +08:00
securityDefinitions:
Token:
in: header
name: token
type: apiKey
2022-10-03 15:10:03 +08:00
swagger: "2.0"