Files
go-gin-api/docs/docs.go

1551 lines
50 KiB
Go
Raw Normal View History

2020-12-27 20:40:43 +08:00
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import (
"bytes"
"encoding/json"
"strings"
"github.com/alecthomas/template"
"github.com/swaggo/swag"
)
var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"title": "{{.Title}}",
"contact": {},
2021-01-23 16:46:01 +08:00
"license": {
"name": "MIT",
"url": "https://github.com/xinliangnote/go-gin-api/blob/master/LICENSE"
},
2020-12-27 20:40:43 +08:00
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
2021-04-10 15:05:50 +08:00
"/api/admin": {
2021-03-28 15:52:02 +08:00
"get": {
2021-04-10 15:05:50 +08:00
"description": "管理员列表",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.admin"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "管理员列表",
2021-03-28 15:52:02 +08:00
"parameters": [
{
"type": "integer",
"description": "第几页",
"name": "page",
"in": "query"
},
{
"type": "string",
"description": "每页显示条数",
"name": "page_size",
"in": "query"
},
{
"type": "string",
2021-04-10 15:05:50 +08:00
"description": "用户名",
"name": "username",
2021-03-28 15:52:02 +08:00
"in": "query"
},
{
"type": "string",
2021-04-10 15:05:50 +08:00
"description": "昵称",
"name": "nickname",
2021-03-28 15:52:02 +08:00
"in": "query"
},
{
"type": "string",
2021-04-10 15:05:50 +08:00
"description": "手机号",
"name": "mobile",
2021-03-28 15:52:02 +08:00
"in": "query"
2021-04-10 15:05:50 +08:00
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin_handler.listResponse"
}
2021-03-28 15:52:02 +08:00
},
2021-04-10 15:05:50 +08:00
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
"description": "新增管理员",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "新增管理员",
"parameters": [
2021-03-28 15:52:02 +08:00
{
"type": "string",
2021-04-10 15:05:50 +08:00
"description": "用户名",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "昵称",
"name": "nickname",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "手机号",
"name": "mobile",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "密码",
"name": "password",
"in": "formData",
"required": true
2021-03-28 15:52:02 +08:00
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/admin_handler.createResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
2021-04-10 15:05:50 +08:00
}
},
"/api/admin/info": {
"get": {
"description": "管理员详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "管理员详情",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin_handler.detailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/login": {
2021-03-28 15:52:02 +08:00
"post": {
2021-04-10 15:05:50 +08:00
"description": "管理员登出",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.admin"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "管理员登出",
"responses": {
"200": {
"description": "OK",
2021-03-28 15:52:02 +08:00
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/admin_handler.logoutResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
2021-03-28 15:52:02 +08:00
}
}
2021-04-10 15:05:50 +08:00
}
}
},
"/api/admin/modify_password": {
"patch": {
"description": "修改个人信息",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "修改个人信息",
"parameters": [
{
"type": "string",
"description": "昵称",
"name": "nickname",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "手机号",
"name": "mobile",
"in": "formData",
"required": true
}
2021-03-28 15:52:02 +08:00
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/admin_handler.modifyPersonalInfoResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/admin/reset_password/{id}": {
2021-03-28 15:52:02 +08:00
"patch": {
2021-04-10 15:05:50 +08:00
"description": "重置密码",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.admin"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "重置密码",
2021-03-28 15:52:02 +08:00
"parameters": [
{
2021-04-10 15:05:50 +08:00
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin_handler.resetPasswordResponse"
}
},
"400": {
"description": "Bad Request",
2021-03-28 15:52:02 +08:00
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/code.Failure"
2021-03-28 15:52:02 +08:00
}
}
2021-04-10 15:05:50 +08:00
}
}
},
"/api/admin/used": {
"patch": {
"description": "更新管理员为启用/禁用",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "更新管理员为启用/禁用",
"parameters": [
{
"type": "string",
"description": "Hashid",
"name": "id",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "是否启用 1:是 -1:否",
"name": "used",
"in": "formData",
"required": true
}
2021-03-28 15:52:02 +08:00
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/admin_handler.updateUsedResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/admin/{id}": {
2021-03-28 15:52:02 +08:00
"delete": {
2021-04-10 15:05:50 +08:00
"description": "删除管理员",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.admin"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "删除管理员",
2021-03-28 15:52:02 +08:00
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/admin_handler.deleteResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/authorized": {
2021-03-28 15:52:02 +08:00
"get": {
2021-04-10 15:05:50 +08:00
"description": "调用方列表",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
2021-04-10 15:05:50 +08:00
"summary": "调用方列表",
2021-03-28 15:52:02 +08:00
"parameters": [
2021-04-10 15:05:50 +08:00
{
"type": "integer",
"description": "第几页",
"name": "page",
"in": "query"
},
{
"type": "string",
"description": "每页显示条数",
"name": "page_size",
"in": "query"
},
2021-03-28 15:52:02 +08:00
{
"type": "string",
"description": "调用方key",
"name": "business_key",
"in": "query"
2021-04-10 15:05:50 +08:00
},
{
"type": "string",
"description": "调用方secret",
"name": "business_secret",
"in": "query"
},
{
"type": "string",
"description": "调用方对接人",
"name": "business_developer",
"in": "query"
},
{
"type": "string",
"description": "备注",
"name": "remark",
"in": "path"
2021-03-28 15:52:02 +08:00
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/authorized_handler.listResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
2021-04-10 15:05:50 +08:00
"description": "新增调用方",
2021-03-28 15:52:02 +08:00
"consumes": [
2021-04-10 15:05:50 +08:00
"multipart/form-data"
2021-03-28 15:52:02 +08:00
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
2021-04-10 15:05:50 +08:00
"summary": "新增调用方",
2021-03-28 15:52:02 +08:00
"parameters": [
{
2021-04-10 15:05:50 +08:00
"type": "string",
"description": "调用方key",
"name": "business_key",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "调用方对接人",
"name": "business_developer",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "备注",
"name": "remark",
"in": "formData",
"required": true
2021-03-28 15:52:02 +08:00
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/authorized_handler.createResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/authorized/used": {
"patch": {
"description": "更新调用方为启用/禁用",
2021-03-28 15:52:02 +08:00
"consumes": [
2021-04-10 15:05:50 +08:00
"multipart/form-data"
2021-03-28 15:52:02 +08:00
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
2021-04-10 15:05:50 +08:00
"summary": "更新调用方为启用/禁用",
2021-03-28 15:52:02 +08:00
"parameters": [
{
2021-04-10 15:05:50 +08:00
"type": "string",
"description": "Hashid",
2021-03-28 15:52:02 +08:00
"name": "id",
2021-04-10 15:05:50 +08:00
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "是否启用 1:是 -1:否",
"name": "used",
"in": "formData",
2021-03-28 15:52:02 +08:00
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/authorized_handler.updateUsedResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/authorized/{id}": {
"delete": {
"description": "删除调用方",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.authorized"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "删除调用方",
2021-03-28 15:52:02 +08:00
"parameters": [
{
"type": "string",
2021-04-10 15:05:50 +08:00
"description": "hashId",
2021-03-28 15:52:02 +08:00
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/authorized_handler.deleteResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/authorized_api": {
2021-03-28 15:52:02 +08:00
"get": {
2021-04-10 15:05:50 +08:00
"description": "调用方接口地址列表",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.authorized"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "调用方接口地址列表",
2021-03-28 15:52:02 +08:00
"parameters": [
{
"type": "string",
2021-04-10 15:05:50 +08:00
"description": "调用方key",
"name": "business_key",
"in": "query"
2021-03-28 15:52:02 +08:00
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/authorized_handler.listAPIResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
2021-04-10 15:05:50 +08:00
},
2021-01-23 16:46:01 +08:00
"post": {
2021-04-10 15:05:50 +08:00
"description": "授权调用方接口地址",
2021-03-28 15:52:02 +08:00
"consumes": [
2021-04-10 15:05:50 +08:00
"multipart/form-data"
2021-03-28 15:52:02 +08:00
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.authorized"
],
"summary": "授权调用方接口地址",
"parameters": [
{
"type": "string",
"description": "HashID",
"name": "id",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "请求方法",
"name": "method",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "请求地址",
"name": "api",
"in": "formData",
"required": true
}
2021-03-28 15:52:02 +08:00
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/authorized_handler.createAPIResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/authorized_api/{id}": {
"delete": {
"description": "删除调用方接口地址",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.authorized"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "删除调用方接口地址",
2021-03-28 15:52:02 +08:00
"parameters": [
{
"type": "string",
2021-04-10 15:05:50 +08:00
"description": "主键ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/authorized_handler.deleteAPIResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/tool/hashids/decode/{id}": {
"get": {
"description": "HashIds 解密",
2021-01-23 16:46:01 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.tool"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "HashIds 解密",
2021-03-28 15:52:02 +08:00
"parameters": [
{
2021-04-10 15:05:50 +08:00
"type": "string",
"description": "需解密的密文",
"name": "id",
"in": "path",
"required": true
2021-03-28 15:52:02 +08:00
}
2021-01-23 16:46:01 +08:00
],
"responses": {
"200": {
2021-02-19 22:00:01 +08:00
"description": "OK",
2021-01-23 16:46:01 +08:00
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/tool_handler.hashIdsDecodeResponse"
2021-01-23 16:46:01 +08:00
}
2021-02-19 22:00:01 +08:00
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
2021-01-23 16:46:01 +08:00
}
}
}
},
2021-04-10 15:05:50 +08:00
"/api/tool/hashids/encode/{id}": {
"get": {
"description": "HashIds 加密",
2020-12-27 20:40:43 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"API.tool"
2020-12-27 20:40:43 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "HashIds 加密",
2020-12-27 20:40:43 +08:00
"parameters": [
2021-01-01 10:51:55 +08:00
{
2021-04-10 15:05:50 +08:00
"type": "string",
"description": "需加密的数字",
"name": "id",
"in": "path",
"required": true
2020-12-27 20:40:43 +08:00
}
],
"responses": {
"200": {
2021-02-19 22:00:01 +08:00
"description": "OK",
2020-12-27 20:40:43 +08:00
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/tool_handler.hashIdsEncodeResponse"
2021-03-28 15:52:02 +08:00
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
2021-04-10 15:05:50 +08:00
"/auth/get": {
2021-03-28 15:52:02 +08:00
"post": {
2021-04-10 15:05:50 +08:00
"description": "获取授权信息",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"Demo"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "获取授权信息",
2021-03-28 15:52:02 +08:00
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"$ref": "#/definitions/demo_handler.authResponse"
2020-12-27 20:40:43 +08:00
}
2021-02-19 22:00:01 +08:00
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
2021-03-28 15:52:02 +08:00
}
}
}
},
2021-04-10 15:05:50 +08:00
"/demo/trace": {
"get": {
"description": "Trace 示例",
2021-03-28 15:52:02 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-04-10 15:05:50 +08:00
"Demo"
2021-03-28 15:52:02 +08:00
],
2021-04-10 15:05:50 +08:00
"summary": "Trace 示例",
2021-03-28 15:52:02 +08:00
"parameters": [
{
2021-04-10 15:05:50 +08:00
"type": "string",
"description": "签名",
"name": "Authorization",
"in": "header",
"required": true
2021-03-28 15:52:02 +08:00
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
2021-04-10 15:05:50 +08:00
"type": "array",
"items": {
"type": "object",
"properties": {
"job": {
"description": "工作",
"type": "string"
},
"name": {
"description": "用户名",
"type": "string"
}
}
}
2021-03-28 15:52:02 +08:00
}
2021-02-19 22:00:01 +08:00
},
2021-03-28 15:52:02 +08:00
"400": {
"description": "Bad Request",
2021-02-19 22:00:01 +08:00
"schema": {
"$ref": "#/definitions/code.Failure"
}
2021-04-10 15:05:50 +08:00
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/code.Failure"
}
2020-12-27 20:40:43 +08:00
}
}
}
2021-01-01 10:51:55 +08:00
},
2021-01-09 20:10:13 +08:00
"/user/create": {
"post": {
"description": "创建用户",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-01-23 16:46:01 +08:00
"User"
2021-01-09 20:10:13 +08:00
],
"summary": "创建用户",
"parameters": [
{
"description": "请求信息",
2021-02-20 20:43:39 +08:00
"name": "Request",
2021-01-09 20:10:13 +08:00
"in": "body",
"required": true,
"schema": {
2021-02-20 20:43:39 +08:00
"$ref": "#/definitions/user_handler.createRequest"
2021-01-09 20:10:13 +08:00
}
2021-01-23 16:46:01 +08:00
},
{
"type": "string",
"description": "签名",
"name": "Authorization",
"in": "header",
"required": true
2021-01-09 20:10:13 +08:00
}
],
"responses": {
"200": {
2021-02-19 22:00:01 +08:00
"description": "OK",
2021-01-09 20:10:13 +08:00
"schema": {
2021-02-20 20:43:39 +08:00
"$ref": "#/definitions/user_handler.createResponse"
2021-01-09 20:10:13 +08:00
}
2021-02-19 22:00:01 +08:00
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/code.Failure"
}
2021-01-09 20:10:13 +08:00
}
}
}
},
2021-01-23 16:46:01 +08:00
"/user/delete/{id}": {
"patch": {
2021-02-27 09:29:34 +08:00
"description": "删除用户",
2021-01-09 20:10:13 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-01-23 16:46:01 +08:00
"User"
2021-01-09 20:10:13 +08:00
],
2021-02-27 09:29:34 +08:00
"summary": "删除用户",
2021-01-09 20:10:13 +08:00
"parameters": [
{
2021-01-23 16:46:01 +08:00
"type": "integer",
"description": "用户ID",
"name": "id",
2021-01-09 20:10:13 +08:00
"in": "path",
"required": true
2021-01-23 16:46:01 +08:00
},
{
"type": "string",
"description": "签名",
"name": "Authorization",
"in": "header",
"required": true
2021-01-09 20:10:13 +08:00
}
],
"responses": {
"200": {
2021-02-20 20:43:39 +08:00
"description": "OK",
"schema": {
"$ref": "#/definitions/user_handler.deleteResponse"
}
2021-02-19 22:00:01 +08:00
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/code.Failure"
}
2021-01-09 20:10:13 +08:00
}
}
}
},
2021-01-23 16:46:01 +08:00
"/user/info/{username}": {
"get": {
"description": "用户详情",
2021-01-01 10:51:55 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-01-23 16:46:01 +08:00
"User"
2021-01-01 10:51:55 +08:00
],
2021-01-23 16:46:01 +08:00
"summary": "用户详情",
2021-01-01 10:51:55 +08:00
"parameters": [
{
2021-01-23 16:46:01 +08:00
"type": "string",
"description": "用户名",
"name": "username",
"in": "path",
"required": true
},
{
"type": "string",
"description": "签名",
"name": "Authorization",
"in": "header",
"required": true
2021-01-01 10:51:55 +08:00
}
],
"responses": {
"200": {
2021-02-19 22:00:01 +08:00
"description": "OK",
2021-01-01 10:51:55 +08:00
"schema": {
2021-02-20 20:43:39 +08:00
"$ref": "#/definitions/user_handler.detailResponse"
2021-01-09 20:10:13 +08:00
}
2021-02-19 22:00:01 +08:00
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/code.Failure"
}
2021-01-09 20:10:13 +08:00
}
}
}
},
"/user/update": {
2021-01-23 16:46:01 +08:00
"put": {
"description": "编辑用户 - 通过用户主键ID更新用户昵称",
2021-01-09 20:10:13 +08:00
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-01-23 16:46:01 +08:00
"User"
2021-01-09 20:10:13 +08:00
],
2021-01-23 16:46:01 +08:00
"summary": "编辑用户 - 通过用户主键ID更新用户昵称",
2021-01-09 20:10:13 +08:00
"parameters": [
{
"description": "请求信息",
2021-02-20 20:43:39 +08:00
"name": "Request",
2021-01-09 20:10:13 +08:00
"in": "body",
"required": true,
"schema": {
2021-02-20 20:43:39 +08:00
"$ref": "#/definitions/user_handler.updateNickNameByIDRequest"
2021-01-09 20:10:13 +08:00
}
2021-01-23 16:46:01 +08:00
},
{
"type": "string",
"description": "签名",
"name": "Authorization",
"in": "header",
"required": true
2021-01-09 20:10:13 +08:00
}
],
"responses": {
"200": {
2021-02-19 22:00:01 +08:00
"description": "OK",
2021-01-09 20:10:13 +08:00
"schema": {
2021-02-20 20:43:39 +08:00
"$ref": "#/definitions/user_handler.updateNickNameByIDResponse"
2021-01-01 10:51:55 +08:00
}
2021-02-19 22:00:01 +08:00
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/code.Failure"
}
2021-01-01 10:51:55 +08:00
}
}
}
}
},
"definitions": {
2021-04-10 15:05:50 +08:00
"admin_handler.createResponse": {
2021-03-28 15:52:02 +08:00
"type": "object",
"properties": {
2021-04-10 15:05:50 +08:00
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"admin_handler.deleteResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"admin_handler.detailResponse": {
"type": "object",
"properties": {
"mobile": {
"description": "手机号",
2021-03-28 15:52:02 +08:00
"type": "string"
},
2021-04-10 15:05:50 +08:00
"nickname": {
"description": "昵称",
2021-03-28 15:52:02 +08:00
"type": "string"
},
2021-04-10 15:05:50 +08:00
"username": {
"description": "用户名",
2021-03-28 15:52:02 +08:00
"type": "string"
}
}
},
2021-04-10 15:05:50 +08:00
"admin_handler.listData": {
2021-03-28 15:52:02 +08:00
"type": "object",
"properties": {
2021-04-10 15:05:50 +08:00
"created_at": {
"description": "创建时间",
"type": "string"
},
"created_user": {
"description": "创建人",
"type": "string"
},
"hashid": {
"description": "hashid",
"type": "string"
},
2021-03-28 15:52:02 +08:00
"id": {
2021-04-10 15:05:50 +08:00
"description": "ID",
"type": "integer"
},
"is_used": {
"description": "是否启用 1:是 -1:否",
2021-03-28 15:52:02 +08:00
"type": "integer"
2021-04-10 15:05:50 +08:00
},
"mobile": {
"description": "手机号",
"type": "string"
},
"nickname": {
"description": "昵称",
"type": "string"
},
"updated_at": {
"description": "更新时间",
"type": "string"
},
"updated_user": {
"description": "更新人",
"type": "string"
},
"username": {
"description": "用户名",
"type": "string"
2021-03-28 15:52:02 +08:00
}
}
},
2021-04-10 15:05:50 +08:00
"admin_handler.listResponse": {
2021-03-28 15:52:02 +08:00
"type": "object",
"properties": {
2021-04-10 15:05:50 +08:00
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/admin_handler.listData"
}
2021-03-28 15:52:02 +08:00
},
2021-04-10 15:05:50 +08:00
"pagination": {
"type": "object",
"properties": {
"current_page": {
"type": "integer"
},
"pre_page_count": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
}
}
},
"admin_handler.loginResponse": {
"type": "object",
"properties": {
"token": {
"description": "用户身份标识",
2021-03-28 15:52:02 +08:00
"type": "string"
2021-04-10 15:05:50 +08:00
}
}
},
"admin_handler.logoutResponse": {
"type": "object",
"properties": {
"username": {
"description": "用户账号",
"type": "string"
}
}
},
"admin_handler.modifyPasswordResponse": {
"type": "object",
"properties": {
"username": {
"description": "用户账号",
"type": "string"
}
}
},
"admin_handler.modifyPersonalInfoResponse": {
"type": "object",
"properties": {
"username": {
"description": "用户账号",
2021-03-28 15:52:02 +08:00
"type": "string"
}
}
},
2021-04-10 15:05:50 +08:00
"admin_handler.resetPasswordResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"admin_handler.updateUsedResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized_handler.createAPIResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
2021-03-28 15:52:02 +08:00
"authorized_handler.createResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized_handler.deleteAPIResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized_handler.deleteResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized_handler.listAPIData": {
"type": "object",
"properties": {
"api": {
"description": "调用方对接人",
"type": "string"
},
"business_key": {
"description": "调用方key",
"type": "string"
},
"hash_id": {
"description": "hashID",
"type": "string"
},
"method": {
"description": "调用方secret",
"type": "string"
}
}
},
"authorized_handler.listAPIResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/authorized_handler.listAPIData"
}
}
}
},
"authorized_handler.listData": {
"type": "object",
"properties": {
"business_developer": {
"description": "调用方对接人",
"type": "string"
},
"business_key": {
"description": "调用方key",
"type": "string"
},
"business_secret": {
"description": "调用方secret",
"type": "string"
},
"created_at": {
"description": "创建时间",
"type": "string"
},
"created_user": {
"description": "创建人",
"type": "string"
},
"hashid": {
"description": "hashid",
"type": "string"
},
"id": {
"description": "ID",
"type": "integer"
},
"is_used": {
"description": "是否启用 1:是 -1:否",
"type": "integer"
},
"remark": {
"description": "备注",
"type": "string"
},
"updated_at": {
"description": "更新时间",
"type": "string"
},
"updated_user": {
"description": "更新人",
"type": "string"
}
}
},
"authorized_handler.listResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/authorized_handler.listData"
}
},
"pagination": {
"type": "object",
"properties": {
"current_page": {
"type": "integer"
},
"pre_page_count": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
}
}
},
"authorized_handler.updateUsedResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
2021-02-19 22:00:01 +08:00
"code.Failure": {
"type": "object",
"properties": {
"code": {
"description": "业务码",
"type": "integer"
},
"message": {
"description": "描述信息",
"type": "string"
}
}
},
2021-02-20 20:43:39 +08:00
"demo_handler.authResponse": {
2021-01-23 16:46:01 +08:00
"type": "object",
"properties": {
"authorization": {
"description": "签名",
"type": "string"
},
"expire_time": {
"description": "过期时间",
"type": "integer"
}
}
},
2021-03-28 15:52:02 +08:00
"tool_handler.hashIdsDecodeResponse": {
"type": "object",
"properties": {
"val": {
"description": "解密后的值",
"type": "integer"
}
}
},
"tool_handler.hashIdsEncodeResponse": {
"type": "object",
"properties": {
"val": {
"description": "加密后的值",
"type": "string"
}
}
},
2021-02-20 20:43:39 +08:00
"user_handler.createRequest": {
2021-01-09 20:10:13 +08:00
"type": "object",
"properties": {
"mobile": {
"description": "手机号",
"type": "string"
},
"nick_name": {
"description": "昵称",
"type": "string"
},
"user_name": {
"description": "用户名",
"type": "string"
}
}
},
2021-02-20 20:43:39 +08:00
"user_handler.createResponse": {
2021-01-09 20:10:13 +08:00
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
2021-02-20 20:43:39 +08:00
"user_handler.deleteResponse": {
"type": "object",
"properties": {
"id": {
"description": "用户主键ID",
"type": "integer"
}
}
},
"user_handler.detailResponse": {
2021-01-09 20:10:13 +08:00
"type": "object",
"properties": {
"id": {
"description": "用户主键ID",
"type": "integer"
},
"mobile": {
2021-02-19 22:00:01 +08:00
"description": "手机号(脱敏)",
2021-01-09 20:10:13 +08:00
"type": "string"
},
"nick_name": {
"description": "昵称",
"type": "string"
},
"user_name": {
"description": "用户名",
"type": "string"
}
}
},
2021-02-20 20:43:39 +08:00
"user_handler.updateNickNameByIDRequest": {
2021-01-09 20:10:13 +08:00
"type": "object",
"properties": {
"id": {
"description": "用户主键ID",
"type": "integer"
},
"nick_name": {
"description": "昵称",
"type": "string"
}
}
},
2021-02-20 20:43:39 +08:00
"user_handler.updateNickNameByIDResponse": {
2021-01-09 20:10:13 +08:00
"type": "object",
"properties": {
"id": {
"description": "用户主键ID",
"type": "integer"
2021-01-01 10:51:55 +08:00
}
}
2020-12-27 20:40:43 +08:00
}
}
}`
type swaggerInfo struct {
Version string
Host string
BasePath string
Schemes []string
Title string
Description string
}
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
2021-01-31 14:51:41 +08:00
Version: "2.0",
2021-01-01 10:51:55 +08:00
Host: "127.0.0.1:9999",
2020-12-27 20:40:43 +08:00
BasePath: "",
Schemes: []string{},
2021-01-31 14:51:41 +08:00
Title: "swagger 接口文档",
2020-12-27 20:40:43 +08:00
Description: "",
}
type s struct{}
func (s *s) ReadDoc() string {
sInfo := SwaggerInfo
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
t, err := template.New("swagger_info").Funcs(template.FuncMap{
"marshal": func(v interface{}) string {
a, _ := json.Marshal(v)
return string(a)
},
}).Parse(doc)
if err != nil {
return doc
}
var tpl bytes.Buffer
if err := t.Execute(&tpl, sInfo); err != nil {
return doc
}
return tpl.String()
}
func init() {
swag.Register(swag.Name, &s{})
}