389 lines
12 KiB
Go
389 lines
12 KiB
Go
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
|
// This file was generated by swaggo/swag
|
|
package docs
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
const docTemplate_swagger = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{escape .Description}}",
|
|
"title": "{{.Title}}",
|
|
"contact": {},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/login": {
|
|
"post": {
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"summary": "用户登录",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "username",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/errcode.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/register": {
|
|
"post": {
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"summary": "用户注册",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "username",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "昵称",
|
|
"name": "nickname",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/errcode.Error"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "用户列表",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "页码",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "每页数量",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "username",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"type": "string",
|
|
"description": "昵称",
|
|
"name": "nickname",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "新增用户",
|
|
"parameters": [
|
|
{
|
|
"maxLength": 30,
|
|
"minLength": 1,
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "username",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 18,
|
|
"minLength": 1,
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"type": "string",
|
|
"description": "昵称",
|
|
"name": "nickname",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/{id}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "用户",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "用户 ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "删除用户",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "用户ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "更新用户",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "用户ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"type": "string",
|
|
"description": "用户名",
|
|
"name": "username",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"maxLength": 18,
|
|
"type": "string",
|
|
"description": "密码",
|
|
"name": "password",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"maxLength": 30,
|
|
"type": "string",
|
|
"description": "昵称",
|
|
"name": "nickname",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"errcode.Error": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer"
|
|
},
|
|
"data": {},
|
|
"msg": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"model.User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"is_admin": {
|
|
"type": "boolean"
|
|
},
|
|
"nickname": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"ApiKeyAuth": {
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo_swagger holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo_swagger = &swag.Spec{
|
|
Version: "1.0",
|
|
Host: "",
|
|
BasePath: "/api",
|
|
Schemes: []string{},
|
|
Title: "AccountServer Api",
|
|
Description: "账号服务",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate_swagger,
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo_swagger.InstanceName(), SwaggerInfo_swagger)
|
|
}
|