comm: swagger doc

This commit is contained in:
fallen-angle
2022-04-30 11:30:55 +08:00
parent 09b8e8e262
commit 2482141d0f
9 changed files with 538 additions and 128 deletions

View File

@@ -51,7 +51,7 @@ definitions:
type: string
createUser:
description: 文章创建者id
type: string
type: integer
isDelete:
description: 删除标志
type: integer
@@ -63,7 +63,7 @@ definitions:
type: string
modifyUser:
description: 文章最后更新者id
type: string
type: integer
resume:
description: 文章简述
type: string
@@ -74,6 +74,44 @@ definitions:
description: 文章标题
type: string
type: object
models.BackUser:
properties:
approver:
description: 注册审核人ID
type: integer
aptitude:
description: 用户资质证明(图片URL)
type: string
createTime:
description: 用户注册时间
type: string
email:
description: 用户邮箱
type: string
id:
description: 用户ID
type: integer
isDelete:
description: 删除标志
type: integer
modifyTime:
type: string
password:
description: 用户密码
type: string
phone:
description: 用户手机号码
type: string
region:
description: 用户所属地域
type: string
role:
description: 用户角色
type: integer
username:
description: 用户真实姓名
type: string
type: object
models.ChinaAdd:
properties:
confirm:
@@ -137,6 +175,23 @@ definitions:
suspect:
type: integer
type: object
models.ListArticle:
properties:
cover:
type: string
createTime:
type: string
modifyTime:
type: string
resume:
type: string
tags:
type: string
title:
type: string
username:
type: string
type: object
models.UserApprove:
properties:
email:
@@ -170,6 +225,10 @@ definitions:
type: string
phone:
type: string
region:
type: string
role:
type: integer
username:
type: string
type: object
@@ -246,10 +305,6 @@ paths:
- application/json
description: Admin can get not published article
parameters:
- description: token
in: header
name: Token
type: string
- description: id
in: path
name: id
@@ -267,7 +322,7 @@ paths:
data:
$ref: '#/definitions/models.BackArticle'
type: object
summary: get all articles
summary: get an articles
tags:
- Article
/article/{id}/publish:
@@ -292,19 +347,47 @@ paths:
description: OK
schema:
$ref: '#/definitions/utils.GinResponse'
summary: get all articles
summary: publish an articles
tags:
- Article
/article/list:
get:
consumes:
- application/json
description: Admin can get not published article
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/utils.GinResponse'
- properties:
data:
items:
$ref: '#/definitions/models.ListArticle'
type: array
type: object
summary: get all articles
tags:
- Article
/article/list/{published}:
get:
consumes:
- application/json
parameters:
- description: token
in: header
name: Token
type: string
- description: string enums
enum:
- published
- notpublished
in: path
name: published
required: true
type: string
produces:
- application/json
responses:
@@ -319,7 +402,7 @@ paths:
$ref: '#/definitions/models.BackArticle'
type: array
type: object
summary: get all articles
summary: get user's articles
tags:
- Article
/statistics/china:
@@ -435,24 +518,6 @@ paths:
summary: province statistics
tags:
- Statistics
/user/{code}:
get:
parameters:
- description: email
in: path
name: email
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/utils.GinResponse'
summary: send verify code
tags:
- User
/user/approve:
post:
consumes:
@@ -500,6 +565,24 @@ paths:
summary: change user's password
tags:
- User
/user/code/{email}:
get:
parameters:
- description: email
in: path
name: email
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/utils.GinResponse'
summary: send verify code
tags:
- User
/user/code/{email}/{code}:
get:
parameters:
@@ -561,11 +644,16 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/utils.GinResponse'
allOf:
- $ref: '#/definitions/utils.GinResponse'
- properties:
data:
$ref: '#/definitions/models.BackUser'
type: object
summary: user register account
tags:
- User
/user/registers:
/user/registers/{approved}:
get:
parameters:
- description: token
@@ -573,6 +661,14 @@ paths:
name: Token
required: true
type: string
- description: string enums
enum:
- approved
- notapproved
in: path
name: approved
required: true
type: string
produces:
- application/json
responses: