You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
234 lines
5.3 KiB
234 lines
5.3 KiB
basePath: /api |
|
definitions: |
|
model.Permission: |
|
properties: |
|
action: |
|
description: create, read, update, delete等 |
|
type: string |
|
created_at: |
|
type: string |
|
description: |
|
type: string |
|
id: |
|
type: integer |
|
name: |
|
type: string |
|
resource: |
|
type: string |
|
updated_at: |
|
type: string |
|
type: object |
|
model.Role: |
|
properties: |
|
created_at: |
|
type: string |
|
description: |
|
type: string |
|
id: |
|
type: integer |
|
name: |
|
type: string |
|
permissions: |
|
items: |
|
$ref: '#/definitions/model.Permission' |
|
type: array |
|
updated_at: |
|
type: string |
|
type: object |
|
model.User: |
|
properties: |
|
created_at: |
|
type: string |
|
email: |
|
type: string |
|
id: |
|
type: integer |
|
phone: |
|
type: string |
|
roles: |
|
items: |
|
$ref: '#/definitions/model.Role' |
|
type: array |
|
status: |
|
description: 1-正常 2-禁用 |
|
type: integer |
|
updated_at: |
|
type: string |
|
username: |
|
type: string |
|
type: object |
|
host: localhost:8080 |
|
info: |
|
contact: |
|
email: support@gofaster.com |
|
name: API支持 |
|
url: http://www.gofaster.com/support |
|
description: GoFaster项目API文档 |
|
license: |
|
name: Apache 2.0 |
|
url: http://www.apache.org/licenses/LICENSE-2.0.html |
|
termsOfService: http://swagger.io/terms/ |
|
title: GoFaster API |
|
version: "1.0" |
|
paths: |
|
/users: |
|
get: |
|
consumes: |
|
- application/json |
|
description: 获取分页用户列表 |
|
parameters: |
|
- default: 1 |
|
description: 页码 |
|
in: query |
|
name: page |
|
type: integer |
|
- default: 10 |
|
description: 每页数量 |
|
in: query |
|
name: pageSize |
|
type: integer |
|
produces: |
|
- application/json |
|
responses: |
|
"200": |
|
description: 用户列表 |
|
schema: |
|
additionalProperties: true |
|
type: object |
|
"400": |
|
description: 请求参数错误 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
"500": |
|
description: 服务器内部错误 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
summary: 获取用户列表 |
|
tags: |
|
- 用户管理 |
|
/users/{id}: |
|
delete: |
|
consumes: |
|
- application/json |
|
description: 根据ID删除用户 |
|
parameters: |
|
- description: 用户ID |
|
in: path |
|
name: id |
|
required: true |
|
type: integer |
|
produces: |
|
- application/json |
|
responses: |
|
"204": |
|
description: 删除成功 |
|
"400": |
|
description: 无效的用户ID |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
"404": |
|
description: 用户不存在 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
"500": |
|
description: 服务器内部错误 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
summary: 删除用户 |
|
tags: |
|
- 用户管理 |
|
get: |
|
consumes: |
|
- application/json |
|
description: 根据ID获取用户详情 |
|
parameters: |
|
- description: 用户ID |
|
in: path |
|
name: id |
|
required: true |
|
type: integer |
|
produces: |
|
- application/json |
|
responses: |
|
"200": |
|
description: 用户信息 |
|
schema: |
|
$ref: '#/definitions/model.User' |
|
"400": |
|
description: 无效的用户ID |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
"404": |
|
description: 用户不存在 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
"500": |
|
description: 服务器内部错误 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
summary: 获取用户详情 |
|
tags: |
|
- 用户管理 |
|
put: |
|
consumes: |
|
- application/json |
|
description: 根据ID更新用户信息 |
|
parameters: |
|
- description: 用户ID |
|
in: path |
|
name: id |
|
required: true |
|
type: integer |
|
- description: 用户信息 |
|
in: body |
|
name: user |
|
required: true |
|
schema: |
|
$ref: '#/definitions/model.User' |
|
produces: |
|
- application/json |
|
responses: |
|
"200": |
|
description: 更新后的用户信息 |
|
schema: |
|
$ref: '#/definitions/model.User' |
|
"400": |
|
description: 无效的用户ID或请求参数 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
"404": |
|
description: 用户不存在 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
"500": |
|
description: 服务器内部错误 |
|
schema: |
|
additionalProperties: |
|
type: string |
|
type: object |
|
summary: 更新用户信息 |
|
tags: |
|
- 用户管理 |
|
schemes: |
|
- http |
|
swagger: "2.0"
|
|
|