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

3421 lines
110 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import (
"bytes"
"encoding/json"
"strings"
"text/template"
"github.com/swaggo/swag"
)
var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"license": {
"name": "MIT",
"url": "https://github.com/xinliangnote/go-gin-api/blob/master/LICENSE"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/admin": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "管理员列表",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "管理员列表",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "第几页",
"name": "page",
"in": "query",
"required": true
},
{
"type": "integer",
"default": 10,
"description": "每页显示条数",
"name": "page_size",
"in": "query",
"required": true
},
{
"type": "string",
"description": "用户名",
"name": "username",
"in": "query"
},
{
"type": "string",
"description": "昵称",
"name": "nickname",
"in": "query"
},
{
"type": "string",
"description": "手机号",
"name": "mobile",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.listResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "新增管理员",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "新增管理员",
"parameters": [
{
"type": "string",
"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": "MD5后的密码",
"name": "password",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.createResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/info": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "管理员详情",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "管理员详情",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.detailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/logout": {
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "管理员登出",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "管理员登出",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.logoutResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/menu": {
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "提交菜单授权",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "提交菜单授权",
"parameters": [
{
"type": "string",
"description": "Hashid",
"name": "id",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "功能权限ID,多个用,分割",
"name": "actions",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.createResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/menu/{id}": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "菜单授权列表",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "菜单授权列表",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.listAdminMenuResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/modify_password": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "修改密码",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "修改密码",
"parameters": [
{
"type": "string",
"description": "旧密码",
"name": "old_password",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "新密码",
"name": "new_password",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.modifyPasswordResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/modify_personal_info": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "修改个人信息",
"consumes": [
"application/x-www-form-urlencoded"
],
"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
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.modifyPersonalInfoResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/offline": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "下线管理员",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "下线管理员",
"parameters": [
{
"type": "string",
"description": "Hashid",
"name": "id",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.offlineResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/reset_password/{id}": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "重置密码",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "重置密码",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.resetPasswordResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/used": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "更新管理员为启用/禁用",
"consumes": [
"application/x-www-form-urlencoded"
],
"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
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.updateUsedResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/admin/{id}": {
"delete": {
"security": [
{
"LoginToken": []
}
],
"description": "删除管理员",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "删除管理员",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.deleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/authorized": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "调用方列表",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
"summary": "调用方列表",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "第几页",
"name": "page",
"in": "query",
"required": true
},
{
"type": "integer",
"default": 10,
"description": "每页显示条数",
"name": "page_size",
"in": "query",
"required": true
},
{
"type": "string",
"description": "调用方key",
"name": "business_key",
"in": "query"
},
{
"type": "string",
"description": "调用方secret",
"name": "business_secret",
"in": "query"
},
{
"type": "string",
"description": "调用方对接人",
"name": "business_developer",
"in": "query"
},
{
"type": "string",
"description": "备注",
"name": "remark",
"in": "path"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/authorized.listResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "新增调用方",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
"summary": "新增调用方",
"parameters": [
{
"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
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/authorized.createResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/authorized/used": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "更新调用方为启用/禁用",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
"summary": "更新调用方为启用/禁用",
"parameters": [
{
"type": "string",
"description": "hashID",
"name": "id",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "是否启用 1:是 -1:否",
"name": "used",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/authorized.updateUsedResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/authorized/{id}": {
"delete": {
"security": [
{
"LoginToken": []
}
],
"description": "删除调用方",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
"summary": "删除调用方",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/authorized.deleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/authorized_api": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "调用方接口地址列表",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
"summary": "调用方接口地址列表",
"parameters": [
{
"type": "string",
"description": "hashID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/authorized.listAPIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "授权调用方接口地址",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"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
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/authorized.createAPIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/authorized_api/{id}": {
"delete": {
"security": [
{
"LoginToken": []
}
],
"description": "删除调用方接口地址",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.authorized"
],
"summary": "删除调用方接口地址",
"parameters": [
{
"type": "string",
"description": "主键ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/authorized.deleteAPIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/config/email": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "修改邮件配置",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.config"
],
"summary": "修改邮件配置",
"parameters": [
{
"type": "string",
"description": "邮箱服务器",
"name": "host",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "端口",
"name": "port",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "发件人邮箱",
"name": "user",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "发件人密码",
"name": "pass",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "收件人邮箱地址,多个用,分割",
"name": "to",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/config.emailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/cron": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "任务列表",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.cron"
],
"summary": "任务列表",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "第几页",
"name": "page",
"in": "query",
"required": true
},
{
"type": "integer",
"default": 10,
"description": "每页显示条数",
"name": "page_size",
"in": "query",
"required": true
},
{
"type": "string",
"description": "任务名称",
"name": "name",
"in": "query"
},
{
"type": "integer",
"description": "执行方式 1:shell 2:http",
"name": "protocol",
"in": "query"
},
{
"type": "integer",
"description": "是否启用 1:是 -1:否",
"name": "is_used",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cron.listResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "创建任务",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.cron"
],
"summary": "创建任务",
"parameters": [
{
"type": "string",
"description": "任务名称",
"name": "name",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "crontab 表达式",
"name": "spec",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "执行命令",
"name": "command",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "执行方式 1:shell 2:http",
"name": "protocol",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "http 请求方式 1:get 2:post",
"name": "http_method",
"in": "formData"
},
{
"type": "integer",
"description": "超时时间(单位:秒)",
"name": "timeout",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "重试次数",
"name": "retry_times",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "重试间隔(单位:秒)",
"name": "retry_interval",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "执行结束是否通知 1:不通知 2:失败通知 3:结束通知 4:结果关键字匹配通知",
"name": "notify_status",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "通知类型 1:邮件 2:webhook",
"name": "notify_type",
"in": "formData"
},
{
"type": "string",
"description": "通知者邮箱地址(多个用,分割)",
"name": "notify_receiver_email",
"in": "formData"
},
{
"type": "string",
"description": "通知匹配关键字(多个用,分割)",
"name": "notify_keyword",
"in": "formData"
},
{
"type": "string",
"description": "备注",
"name": "remark",
"in": "formData"
},
{
"type": "integer",
"description": "是否启用 1:是 -1:否",
"name": "is_used",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cron.createResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/cron/exec/{id}": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "手动执行单条任务",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.cron"
],
"summary": "手动执行单条任务",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cron.detailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/cron/used": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "更新任务为启用/禁用",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.cron"
],
"summary": "更新任务为启用/禁用",
"parameters": [
{
"type": "string",
"description": "hashID",
"name": "id",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "是否启用 1:是 -1:否",
"name": "used",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cron.updateUsedResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/cron/{id}": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "获取单条任务详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.cron"
],
"summary": "获取单条任务详情",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cron.detailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "编辑任务",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.cron"
],
"summary": "编辑任务",
"parameters": [
{
"type": "string",
"description": "hashID",
"name": "id",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "任务名称",
"name": "name",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "crontab 表达式",
"name": "spec",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "执行命令",
"name": "command",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "执行方式 1:shell 2:http",
"name": "protocol",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "http 请求方式 1:get 2:post",
"name": "http_method",
"in": "formData"
},
{
"type": "integer",
"description": "超时时间(单位:秒)",
"name": "timeout",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "重试次数",
"name": "retry_times",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "重试间隔(单位:秒)",
"name": "retry_interval",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "执行结束是否通知 1:不通知 2:失败通知 3:结束通知 4:结果关键字匹配通知",
"name": "notify_status",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "通知类型 1:邮件 2:webhook",
"name": "notify_type",
"in": "formData"
},
{
"type": "string",
"description": "通知者邮箱地址(多个用,分割)",
"name": "notify_receiver_email",
"in": "formData"
},
{
"type": "string",
"description": "通知匹配关键字(多个用,分割)",
"name": "notify_keyword",
"in": "formData"
},
{
"type": "string",
"description": "备注",
"name": "remark",
"in": "formData"
},
{
"type": "integer",
"description": "是否启用 1:是 -1:否",
"name": "is_used",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/cron.modifyResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/login": {
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "管理员登录",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.admin"
],
"summary": "管理员登录",
"parameters": [
{
"type": "string",
"description": "用户名",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "MD5后的密码",
"name": "password",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.loginResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/menu": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "菜单列表",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"summary": "菜单列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.listResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "创建/编辑菜单",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"summary": "创建/编辑菜单",
"parameters": [
{
"description": "请求信息",
"name": "Request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/menu.createRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.createResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/menu/sort": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "更新菜单排序",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"summary": "更新菜单排序",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "排序",
"name": "sort",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.updateSortResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/menu/used": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "更新菜单为启用/禁用",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"summary": "更新菜单为启用/禁用",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "是否启用 1:是 -1:否",
"name": "used",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.updateUsedResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/menu/{id}": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "菜单详情",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"summary": "菜单详情",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.detailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"delete": {
"security": [
{
"LoginToken": []
}
],
"description": "删除菜单",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"summary": "删除菜单",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.deleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/menu_action": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "功能权限列表",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"summary": "功能权限列表",
"parameters": [
{
"type": "string",
"description": "hashID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.listActionResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
},
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "创建功能权限",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"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
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.createActionResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/menu_action/{id}": {
"delete": {
"security": [
{
"LoginToken": []
}
],
"description": "删除功能权限",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"API.menu"
],
"summary": "删除功能权限",
"parameters": [
{
"type": "string",
"description": "hashId",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/menu.deleteActionResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/tool/cache/clear": {
"patch": {
"security": [
{
"LoginToken": []
}
],
"description": "清空缓存",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "清空缓存",
"parameters": [
{
"type": "string",
"description": "Redis Key",
"name": "redis_key",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool.searchCacheResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/tool/cache/search": {
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "查询缓存",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "查询缓存",
"parameters": [
{
"type": "string",
"description": "Redis Key",
"name": "redis_key",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool.searchCacheResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/tool/data/dbs": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "查询 DB",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "查询 DB",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool.dbsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/tool/data/mysql": {
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "执行 SQL 语句",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "执行 SQL 语句",
"parameters": [
{
"type": "string",
"description": "数据库名称",
"name": "db_name",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "数据表名称",
"name": "table_name",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "SQL 语句",
"name": "sql",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool.searchMySQLResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/tool/data/tables": {
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "查询 Table",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "查询 Table",
"parameters": [
{
"type": "string",
"description": "数据库名称",
"name": "db_name",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool.tablesResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/tool/hashids/decode/{id}": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "HashIds 解密",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "HashIds 解密",
"parameters": [
{
"type": "string",
"description": "需解密的密文",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool.hashIdsDecodeResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/tool/hashids/encode/{id}": {
"get": {
"security": [
{
"LoginToken": []
}
],
"description": "HashIds 加密",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "HashIds 加密",
"parameters": [
{
"type": "string",
"description": "需加密的数字",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool.hashIdsEncodeResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/api/tool/send_message": {
"post": {
"security": [
{
"LoginToken": []
}
],
"description": "发送消息",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"API.tool"
],
"summary": "发送消息",
"parameters": [
{
"type": "string",
"description": "消息内容",
"name": "message",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/tool.sendMessageResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/helper/md5/{str}": {
"get": {
"description": "加密",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Helper"
],
"summary": "加密",
"parameters": [
{
"type": "string",
"description": "需要加密的字符串",
"name": "str",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/helper.md5Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
},
"/helper/sign": {
"post": {
"description": "签名",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"Helper"
],
"summary": "签名",
"parameters": [
{
"type": "string",
"description": "调用方 KEY",
"name": "key",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "请求路径 (不附带 querystring),例如:/api/login",
"name": "path",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "请求方式例如POST",
"name": "method",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "请求参数例如username=tom\u0026password=123456",
"name": "params",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/helper.signResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/code.Failure"
}
}
}
}
}
},
"definitions": {
"admin.ListMenuData": {
"type": "object",
"properties": {
"id": {
"description": "ID",
"type": "integer"
},
"is_have": {
"description": "是否已拥有权限",
"type": "integer"
},
"name": {
"description": "菜单名称",
"type": "string"
},
"pid": {
"description": "父类ID",
"type": "integer"
}
}
},
"admin.ListMyMenuData": {
"type": "object",
"properties": {
"icon": {
"description": "图标",
"type": "string"
},
"id": {
"description": "ID",
"type": "integer"
},
"link": {
"description": "链接地址",
"type": "string"
},
"name": {
"description": "菜单名称",
"type": "string"
},
"pid": {
"description": "父类ID",
"type": "integer"
}
}
},
"admin.createResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"admin.deleteResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"admin.detailResponse": {
"type": "object",
"properties": {
"menu": {
"description": "菜单栏",
"type": "array",
"items": {
"$ref": "#/definitions/admin.ListMyMenuData"
}
},
"mobile": {
"description": "手机号",
"type": "string"
},
"nickname": {
"description": "昵称",
"type": "string"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"admin.listAdminMenuResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/admin.ListMenuData"
}
},
"username": {
"type": "string"
}
}
},
"admin.listData": {
"type": "object",
"properties": {
"created_at": {
"description": "创建时间",
"type": "string"
},
"created_user": {
"description": "创建人",
"type": "string"
},
"hashid": {
"description": "hashid",
"type": "string"
},
"id": {
"description": "ID",
"type": "integer"
},
"is_online": {
"description": "是否在线 1:是 -1:否",
"type": "integer"
},
"is_used": {
"description": "是否启用 1:是 -1:否",
"type": "integer"
},
"mobile": {
"description": "手机号",
"type": "string"
},
"nickname": {
"description": "昵称",
"type": "string"
},
"updated_at": {
"description": "更新时间",
"type": "string"
},
"updated_user": {
"description": "更新人",
"type": "string"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"admin.listResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/admin.listData"
}
},
"pagination": {
"type": "object",
"properties": {
"current_page": {
"type": "integer"
},
"per_page_count": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
}
}
},
"admin.loginResponse": {
"type": "object",
"properties": {
"token": {
"description": "用户身份标识",
"type": "string"
}
}
},
"admin.logoutResponse": {
"type": "object",
"properties": {
"username": {
"description": "用户账号",
"type": "string"
}
}
},
"admin.modifyPasswordResponse": {
"type": "object",
"properties": {
"username": {
"description": "用户账号",
"type": "string"
}
}
},
"admin.modifyPersonalInfoResponse": {
"type": "object",
"properties": {
"username": {
"description": "用户账号",
"type": "string"
}
}
},
"admin.offlineResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"admin.resetPasswordResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"admin.updateUsedResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized.createAPIResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized.createResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized.deleteAPIResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized.deleteResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"authorized.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.listAPIResponse": {
"type": "object",
"properties": {
"business_key": {
"description": "调用方key",
"type": "string"
},
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/authorized.listAPIData"
}
}
}
},
"authorized.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.listResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/authorized.listData"
}
},
"pagination": {
"type": "object",
"properties": {
"current_page": {
"type": "integer"
},
"per_page_count": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
}
}
},
"authorized.updateUsedResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"code.Failure": {
"type": "object",
"properties": {
"code": {
"description": "业务码",
"type": "integer"
},
"message": {
"description": "描述信息",
"type": "string"
}
}
},
"config.emailResponse": {
"type": "object",
"properties": {
"email": {
"description": "邮箱地址",
"type": "string"
}
}
},
"cron.createResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"cron.detailResponse": {
"type": "object",
"properties": {
"command": {
"description": "执行命令",
"type": "string"
},
"http_method": {
"description": "http 请求方式 1:get 2:post",
"type": "integer"
},
"is_used": {
"description": "是否启用 1:是 -1:否",
"type": "integer"
},
"name": {
"description": "任务名称",
"type": "string"
},
"notify_keyword": {
"description": "通知匹配关键字(多个用,分割)",
"type": "string"
},
"notify_receiver_email": {
"description": "通知者邮箱地址(多个用,分割)",
"type": "string"
},
"notify_status": {
"description": "执行结束是否通知 1:不通知 2:失败通知 3:结束通知 4:结果关键字匹配通知",
"type": "integer"
},
"notify_type": {
"description": "通知类型 1:邮件 2:webhook",
"type": "integer"
},
"protocol": {
"description": "执行方式 1:shell 2:http",
"type": "integer"
},
"remark": {
"description": "备注",
"type": "string"
},
"retry_interval": {
"description": "重试间隔(单位:秒)",
"type": "integer"
},
"retry_times": {
"description": "重试次数",
"type": "integer"
},
"spec": {
"description": "crontab 表达式",
"type": "string"
},
"timeout": {
"description": "超时时间(单位:秒)",
"type": "integer"
}
}
},
"cron.listData": {
"type": "object",
"properties": {
"command": {
"description": "执行命令",
"type": "string"
},
"created_at": {
"description": "创建时间",
"type": "string"
},
"created_user": {
"description": "创建人",
"type": "string"
},
"hashid": {
"description": "hashid",
"type": "string"
},
"http_method": {
"description": "http 请求方式 1:get 2:post",
"type": "integer"
},
"http_method_text": {
"description": "http 请求方式",
"type": "string"
},
"id": {
"description": "ID",
"type": "integer"
},
"is_used": {
"description": "是否启用 1=启用 2=禁用",
"type": "integer"
},
"is_used_text": {
"description": "是否启用",
"type": "string"
},
"name": {
"description": "任务名称",
"type": "string"
},
"notify_status": {
"description": "执行结束是否通知 1:不通知 2:失败通知 3:结束通知 4:结果关键字匹配通知",
"type": "integer"
},
"notify_status_text": {
"description": "执行结束是否通知",
"type": "string"
},
"protocol": {
"description": "执行方式 1:shell 2:http",
"type": "integer"
},
"protocol_text": {
"description": "执行方式",
"type": "string"
},
"retry_interval": {
"description": "重试间隔(单位:秒)",
"type": "integer"
},
"retry_times": {
"description": "重试次数",
"type": "integer"
},
"spec": {
"description": "crontab 表达式",
"type": "string"
},
"timeout": {
"description": "超时时间(单位:秒)",
"type": "integer"
},
"updated_at": {
"description": "更新时间",
"type": "string"
},
"updated_user": {
"description": "更新人",
"type": "string"
}
}
},
"cron.listResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/cron.listData"
}
},
"pagination": {
"type": "object",
"properties": {
"current_page": {
"type": "integer"
},
"per_page_count": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
}
}
},
"cron.modifyResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"cron.updateUsedResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"helper.md5Response": {
"type": "object",
"properties": {
"md5_str": {
"description": "MD5后的字符串",
"type": "string"
}
}
},
"helper.signResponse": {
"type": "object",
"properties": {
"authorization": {
"description": "签名信息-Authorization",
"type": "string"
},
"authorization_date": {
"description": "签名信息-Authorization-Date",
"type": "string"
}
}
},
"menu.createActionResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"menu.createRequest": {
"type": "object",
"properties": {
"icon": {
"description": "图标",
"type": "string"
},
"id": {
"description": "ID",
"type": "string"
},
"level": {
"description": "菜单类型 1:一级菜单 2:二级菜单",
"type": "integer"
},
"link": {
"description": "链接地址",
"type": "string"
},
"name": {
"description": "菜单名称",
"type": "string"
},
"pid": {
"description": "父类ID",
"type": "integer"
}
}
},
"menu.createResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"menu.deleteActionResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"menu.deleteResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"menu.detailResponse": {
"type": "object",
"properties": {
"icon": {
"description": "图标",
"type": "string"
},
"id": {
"description": "主键ID",
"type": "integer"
},
"link": {
"description": "链接地址",
"type": "string"
},
"name": {
"description": "菜单名称",
"type": "string"
},
"pid": {
"description": "父类ID",
"type": "integer"
}
}
},
"menu.listActionData": {
"type": "object",
"properties": {
"api": {
"description": "调用方对接人",
"type": "string"
},
"hash_id": {
"description": "hashID",
"type": "string"
},
"menu_id": {
"description": "菜单栏ID",
"type": "integer"
},
"method": {
"description": "调用方secret",
"type": "string"
}
}
},
"menu.listActionResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/menu.listActionData"
}
},
"menu_name": {
"type": "string"
}
}
},
"menu.listData": {
"type": "object",
"properties": {
"hashid": {
"description": "hashid",
"type": "string"
},
"icon": {
"description": "图标",
"type": "string"
},
"id": {
"description": "ID",
"type": "integer"
},
"is_used": {
"description": "是否启用 1=启用 -1=禁用",
"type": "integer"
},
"link": {
"description": "链接地址",
"type": "string"
},
"name": {
"description": "菜单名称",
"type": "string"
},
"pid": {
"description": "父类ID",
"type": "integer"
},
"sort": {
"description": "排序",
"type": "integer"
}
}
},
"menu.listResponse": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/menu.listData"
}
}
}
},
"menu.updateSortResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"menu.updateUsedResponse": {
"type": "object",
"properties": {
"id": {
"description": "主键ID",
"type": "integer"
}
}
},
"tool.dbData": {
"type": "object",
"properties": {
"db_name": {
"description": "数据库名称",
"type": "string"
}
}
},
"tool.dbsResponse": {
"type": "object",
"properties": {
"list": {
"description": "数据库列表",
"type": "array",
"items": {
"$ref": "#/definitions/tool.dbData"
}
}
}
},
"tool.hashIdsDecodeResponse": {
"type": "object",
"properties": {
"val": {
"description": "解密后的值",
"type": "integer"
}
}
},
"tool.hashIdsEncodeResponse": {
"type": "object",
"properties": {
"val": {
"description": "加密后的值",
"type": "string"
}
}
},
"tool.searchCacheResponse": {
"type": "object",
"properties": {
"ttl": {
"description": "过期时间",
"type": "string"
},
"val": {
"description": "查询后的值",
"type": "string"
}
}
},
"tool.searchMySQLResponse": {
"type": "object",
"properties": {
"cols": {
"description": "查询后的行",
"type": "array",
"items": {
"type": "string"
}
},
"cols_info": {
"description": "行信息",
"type": "array",
"items": {
"$ref": "#/definitions/tool.tableColumn"
}
},
"list": {
"description": "查询后的数据",
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
},
"tool.sendMessageResponse": {
"type": "object",
"properties": {
"status": {
"description": "状态",
"type": "string"
}
}
},
"tool.tableColumn": {
"type": "object",
"properties": {
"column_comment": {
"description": "字段注释",
"type": "string"
},
"column_name": {
"description": "字段名称",
"type": "string"
}
}
},
"tool.tableData": {
"type": "object",
"properties": {
"table_comment": {
"description": "数据表备注",
"type": "string"
},
"table_name": {
"description": "数据表名称",
"type": "string"
}
}
},
"tool.tablesResponse": {
"type": "object",
"properties": {
"list": {
"description": "数据表列表",
"type": "array",
"items": {
"$ref": "#/definitions/tool.tableData"
}
}
}
}
},
"securityDefinitions": {
"LoginToken": {
"type": "apiKey",
"name": "token",
"in": "header"
}
}
}`
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{
Version: "2.0",
Host: "",
BasePath: "/",
Schemes: []string{},
Title: "swagger 接口文档",
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)
},
"escape": func(v interface{}) string {
// escape tabs
str := strings.Replace(v.(string), "\t", "\\t", -1)
// replace " with \", and if that results in \\", replace that with \\\"
str = strings.Replace(str, "\"", "\\\"", -1)
return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
},
}).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("swagger", &s{})
}