Files
nCovTrack-Backend/docs/docs.go
2022-05-04 20:06:21 +08:00

1250 lines
40 KiB
Go

// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/article": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Article"
],
"summary": "save article",
"parameters": [
{
"description": "article",
"name": "Article",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.BackArticle"
}
},
{
"type": "string",
"description": "token",
"name": "Token",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.BackArticle"
}
}
}
]
}
}
}
}
},
"/article/list": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Article"
],
"summary": "get all articles",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ListArticle"
}
}
}
}
]
}
}
}
}
},
"/article/list/{published}": {
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Article"
],
"summary": "get user's articles",
"parameters": [
{
"type": "string",
"description": "token",
"name": "Token",
"in": "header"
},
{
"enum": [
"published",
"notpublished"
],
"type": "string",
"description": "string enums",
"name": "published",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.BackArticle"
}
}
}
}
]
}
}
}
}
},
"/article/{id}": {
"get": {
"description": "Admin can get not published article",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Article"
],
"summary": "get an articles",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.BackArticle"
}
}
}
]
}
}
}
},
"delete": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Article"
],
"summary": "delete an article",
"parameters": [
{
"type": "string",
"description": "token",
"name": "Token",
"in": "header",
"required": true
},
{
"type": "string",
"description": "id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/utils.GinResponse"
}
}
}
}
},
"/article/{id}/publish": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Article"
],
"summary": "publish an articles",
"parameters": [
{
"type": "string",
"description": "token",
"name": "Token",
"in": "header",
"required": true
},
{
"type": "string",
"description": "id",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/utils.GinResponse"
}
}
}
}
},
"/statistics/china": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Statistics"
],
"summary": "china data",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.ChinaData"
}
}
}
]
}
}
}
}
},
"/statistics/china/trend": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Statistics"
],
"summary": "china trend",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.ChinaTrend"
}
}
}
]
}
}
}
}
},
"/statistics/city/{sort}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Statistics"
],
"summary": "city statistics",
"parameters": [
{
"enum": [
"today",
"total",
"now",
"default"
],
"type": "string",
"description": "data sorted by",
"name": "sort",
"in": "path"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.AreaInfo"
}
}
}
}
]
}
}
}
}
},
"/statistics/country": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Statistics"
],
"summary": "country statistics",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.AreaInfo"
}
}
}
}
]
}
}
}
}
},
"/statistics/country/child": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Statistics"
],
"summary": "country statistics",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.AreaInfo"
}
}
}
}
]
}
}
}
}
},
"/statistics/province/{sort}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Statistics"
],
"summary": "province statistics",
"parameters": [
{
"enum": [
"today",
"total",
"now",
"default"
],
"type": "string",
"description": "data sorted by",
"name": "sort",
"in": "path"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.AreaInfo"
}
}
}
}
]
}
}
}
}
},
"/user/approve": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "admin approve account, user can use account after approved",
"parameters": [
{
"type": "string",
"description": "token",
"name": "Token",
"in": "header",
"required": true
},
{
"description": "json",
"name": "json",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UserApprove"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/utils.GinResponse"
}
}
}
}
},
"/user/chpwd": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "change user's password",
"parameters": [
{
"description": "json",
"name": "json",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UserChangePwd"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/utils.GinResponse"
}
}
}
}
},
"/user/code/{email}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "send verify code",
"parameters": [
{
"type": "string",
"description": "email",
"name": "email",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/utils.GinResponse"
}
}
}
}
},
"/user/code/{email}/{code}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "send verify code",
"parameters": [
{
"type": "string",
"description": "email",
"name": "email",
"in": "path",
"required": true
},
{
"type": "string",
"description": "code",
"name": "code",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/utils.GinResponse"
}
}
}
}
},
"/user/login": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "user login",
"parameters": [
{
"description": "json",
"name": "json",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UserLogin"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/utils.GinResponse"
}
}
}
}
},
"/user/register": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "user register account",
"parameters": [
{
"description": "json",
"name": "json",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UserRegister"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/utils.GinResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.BackUser"
}
}
}
]
}
}
}
}
},
"/user/registers/{approved}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "list register infos, which is to be approved",
"parameters": [
{
"type": "string",
"description": "token",
"name": "Token",
"in": "header",
"required": true
},
{
"enum": [
"approved",
"notapproved"
],
"type": "string",
"description": "string enums",
"name": "approved",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/utils.GinResponse"
}
}
}
}
}
},
"definitions": {
"models.AreaInfo": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.AreaInfo"
}
},
"name": {
"type": "string"
},
"parent": {
"type": "string"
},
"today": {
"$ref": "#/definitions/models.AreaToday"
},
"total": {
"$ref": "#/definitions/models.AreaTotal"
}
}
},
"models.AreaToday": {
"type": "object",
"properties": {
"confirm": {
"type": "integer"
},
"isUpdate": {
"type": "boolean"
}
}
},
"models.AreaTotal": {
"type": "object",
"properties": {
"confirm": {
"type": "integer"
},
"dead": {
"type": "integer"
},
"heal": {
"type": "integer"
},
"nowConfirm": {
"type": "integer"
},
"provinceLocalConfirm": {
"type": "integer"
},
"showHeal": {
"type": "boolean"
},
"showRate": {
"type": "boolean"
},
"wzz": {
"type": "integer"
}
}
},
"models.BackArticle": {
"type": "object",
"properties": {
"content": {
"description": "文章内容(如有需要可迁移至对象存储)",
"type": "string"
},
"cover": {
"description": "文章封面",
"type": "string"
},
"createTime": {
"description": "文章新建时间",
"type": "string"
},
"createUser": {
"description": "文章创建者id",
"type": "integer"
},
"isDelete": {
"description": "删除标志",
"type": "integer"
},
"isPublish": {
"description": "发布状态(0:未发布, 1: 发布)",
"type": "integer"
},
"modifyTime": {
"description": "文章最后更新时间",
"type": "string"
},
"modifyUser": {
"description": "文章最后更新者id",
"type": "integer"
},
"resume": {
"description": "文章简述",
"type": "string"
},
"tags": {
"description": "文章Tag",
"type": "string"
},
"title": {
"description": "文章标题",
"type": "string"
}
}
},
"models.BackUser": {
"type": "object",
"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"
}
}
},
"models.ChinaAdd": {
"type": "object",
"properties": {
"confirm": {
"type": "integer"
},
"dead": {
"type": "integer"
},
"heal": {
"type": "integer"
},
"importedCase": {
"type": "integer"
},
"localConfirm": {
"type": "integer"
},
"localConfirmH5": {
"type": "integer"
},
"noInfect": {
"type": "integer"
},
"noInfectH5": {
"type": "integer"
},
"nowConfirm": {
"type": "integer"
},
"nowSevere": {
"type": "integer"
},
"suspect": {
"type": "integer"
}
}
},
"models.ChinaData": {
"type": "object",
"properties": {
"chinaAdd": {
"$ref": "#/definitions/models.ChinaAdd"
},
"chinaTotal": {
"$ref": "#/definitions/models.ChinaTotal"
}
}
},
"models.ChinaDay": {
"type": "object",
"properties": {
"confirm": {
"type": "integer"
},
"date": {
"type": "string"
},
"dead": {
"type": "integer"
},
"deadRate": {
"type": "string"
},
"heal": {
"type": "integer"
},
"healRate": {
"type": "string"
},
"importedCase": {
"type": "integer"
},
"localConfirm": {
"type": "integer"
},
"localConfirmH5": {
"type": "integer"
},
"local_acc_confirm": {
"type": "integer"
},
"noInfect": {
"type": "integer"
},
"noInfectH5": {
"type": "integer"
},
"nowConfirm": {
"type": "integer"
},
"nowSevere": {
"type": "integer"
},
"suspect": {
"type": "integer"
},
"y": {
"type": "string"
}
}
},
"models.ChinaDayAdd": {
"type": "object",
"properties": {
"confirm": {
"type": "integer"
},
"date": {
"type": "string"
},
"dead": {
"type": "integer"
},
"deadRate": {
"type": "string"
},
"heal": {
"type": "integer"
},
"healRate": {
"type": "string"
},
"importedCase": {
"type": "integer"
},
"infect": {
"type": "integer"
},
"localConfirmadd": {
"type": "integer"
},
"localinfectionadd": {
"type": "integer"
},
"suspect": {
"type": "integer"
},
"y": {
"type": "string"
}
}
},
"models.ChinaTotal": {
"type": "object",
"properties": {
"confirm": {
"type": "integer"
},
"dead": {
"type": "integer"
},
"heal": {
"type": "integer"
},
"importedCase": {
"type": "integer"
},
"localConfirm": {
"type": "integer"
},
"localConfirmH5": {
"type": "integer"
},
"local_acc_confirm": {
"type": "integer"
},
"noInfect": {
"type": "integer"
},
"noInfectH5": {
"type": "integer"
},
"nowConfirm": {
"type": "integer"
},
"nowSevere": {
"type": "integer"
},
"showLocalConfirm": {
"type": "integer"
},
"showlocalinfeciton": {
"type": "integer"
},
"suspect": {
"type": "integer"
}
}
},
"models.ChinaTrend": {
"type": "object",
"properties": {
"ChinaDayList": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ChinaDay"
}
},
"chinaDayAddList": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ChinaDayAdd"
}
}
}
},
"models.ListArticle": {
"type": "object",
"properties": {
"cover": {
"type": "string"
},
"createTime": {
"type": "string"
},
"modifyTime": {
"type": "string"
},
"resume": {
"type": "string"
},
"tags": {
"type": "string"
},
"title": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"models.UserApprove": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"pass": {
"type": "boolean"
}
}
},
"models.UserChangePwd": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"email": {
"type": "string"
},
"newPassword": {
"type": "string"
}
}
},
"models.UserLogin": {
"type": "object",
"properties": {
"account": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"models.UserRegister": {
"type": "object",
"properties": {
"aptitude": {
"type": "string"
},
"email": {
"type": "string"
},
"password": {
"type": "string"
},
"phone": {
"type": "string"
},
"region": {
"type": "string"
},
"role": {
"type": "integer"
},
"username": {
"type": "string"
}
}
},
"utils.GinResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {},
"msg": {}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "nCov Tracker",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}