790 lines
18 KiB
YAML
790 lines
18 KiB
YAML
definitions:
|
|
admin_handler.createResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
admin_handler.deleteResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
admin_handler.detailResponse:
|
|
properties:
|
|
mobile:
|
|
description: 手机号
|
|
type: string
|
|
nickname:
|
|
description: 昵称
|
|
type: string
|
|
username:
|
|
description: 用户名
|
|
type: string
|
|
type: object
|
|
admin_handler.listData:
|
|
properties:
|
|
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
|
|
mobile:
|
|
description: 手机号
|
|
type: string
|
|
nickname:
|
|
description: 昵称
|
|
type: string
|
|
updated_at:
|
|
description: 更新时间
|
|
type: string
|
|
updated_user:
|
|
description: 更新人
|
|
type: string
|
|
username:
|
|
description: 用户名
|
|
type: string
|
|
type: object
|
|
admin_handler.listResponse:
|
|
properties:
|
|
list:
|
|
items:
|
|
$ref: '#/definitions/admin_handler.listData'
|
|
type: array
|
|
pagination:
|
|
properties:
|
|
current_page:
|
|
type: integer
|
|
pre_page_count:
|
|
type: integer
|
|
total:
|
|
type: integer
|
|
type: object
|
|
type: object
|
|
admin_handler.loginResponse:
|
|
properties:
|
|
token:
|
|
description: 用户身份标识
|
|
type: string
|
|
type: object
|
|
admin_handler.logoutResponse:
|
|
properties:
|
|
username:
|
|
description: 用户账号
|
|
type: string
|
|
type: object
|
|
admin_handler.modifyPasswordResponse:
|
|
properties:
|
|
username:
|
|
description: 用户账号
|
|
type: string
|
|
type: object
|
|
admin_handler.modifyPersonalInfoResponse:
|
|
properties:
|
|
username:
|
|
description: 用户账号
|
|
type: string
|
|
type: object
|
|
admin_handler.resetPasswordResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
admin_handler.updateUsedResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
authorized_handler.createAPIResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
authorized_handler.createResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
authorized_handler.deleteAPIResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
authorized_handler.deleteResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
authorized_handler.listAPIData:
|
|
properties:
|
|
api:
|
|
description: 调用方对接人
|
|
type: string
|
|
business_key:
|
|
description: 调用方key
|
|
type: string
|
|
hash_id:
|
|
description: hashID
|
|
type: string
|
|
method:
|
|
description: 调用方secret
|
|
type: string
|
|
type: object
|
|
authorized_handler.listAPIResponse:
|
|
properties:
|
|
list:
|
|
items:
|
|
$ref: '#/definitions/authorized_handler.listAPIData'
|
|
type: array
|
|
type: object
|
|
authorized_handler.listData:
|
|
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
|
|
type: object
|
|
authorized_handler.listResponse:
|
|
properties:
|
|
list:
|
|
items:
|
|
$ref: '#/definitions/authorized_handler.listData'
|
|
type: array
|
|
pagination:
|
|
properties:
|
|
current_page:
|
|
type: integer
|
|
pre_page_count:
|
|
type: integer
|
|
total:
|
|
type: integer
|
|
type: object
|
|
type: object
|
|
authorized_handler.updateUsedResponse:
|
|
properties:
|
|
id:
|
|
description: 主键ID
|
|
type: integer
|
|
type: object
|
|
code.Failure:
|
|
properties:
|
|
code:
|
|
description: 业务码
|
|
type: integer
|
|
message:
|
|
description: 描述信息
|
|
type: string
|
|
type: object
|
|
config_handler.emailResponse:
|
|
properties:
|
|
email:
|
|
description: 邮箱地址
|
|
type: string
|
|
type: object
|
|
tool_handler.hashIdsDecodeResponse:
|
|
properties:
|
|
val:
|
|
description: 解密后的值
|
|
type: integer
|
|
type: object
|
|
tool_handler.hashIdsEncodeResponse:
|
|
properties:
|
|
val:
|
|
description: 加密后的值
|
|
type: string
|
|
type: object
|
|
host: 127.0.0.1:9999
|
|
info:
|
|
contact: {}
|
|
license:
|
|
name: MIT
|
|
url: https://github.com/xinliangnote/go-gin-api/blob/master/LICENSE
|
|
title: swagger 接口文档
|
|
version: "2.0"
|
|
paths:
|
|
/api/admin:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: 管理员列表
|
|
parameters:
|
|
- description: 第几页
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: 每页显示条数
|
|
in: query
|
|
name: page_size
|
|
type: string
|
|
- description: 用户名
|
|
in: query
|
|
name: username
|
|
type: string
|
|
- description: 昵称
|
|
in: query
|
|
name: nickname
|
|
type: string
|
|
- description: 手机号
|
|
in: query
|
|
name: mobile
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin_handler.listResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 管理员列表
|
|
tags:
|
|
- API.admin
|
|
post:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: 新增管理员
|
|
parameters:
|
|
- description: 用户名
|
|
in: formData
|
|
name: username
|
|
required: true
|
|
type: string
|
|
- description: 昵称
|
|
in: formData
|
|
name: nickname
|
|
required: true
|
|
type: string
|
|
- description: 手机号
|
|
in: formData
|
|
name: mobile
|
|
required: true
|
|
type: string
|
|
- description: 密码
|
|
in: formData
|
|
name: password
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin_handler.createResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 新增管理员
|
|
tags:
|
|
- API.admin
|
|
/api/admin/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: 删除管理员
|
|
parameters:
|
|
- description: hashId
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin_handler.deleteResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 删除管理员
|
|
tags:
|
|
- API.admin
|
|
/api/admin/info:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: 管理员详情
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin_handler.detailResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 管理员详情
|
|
tags:
|
|
- API.admin
|
|
/api/admin/login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 管理员登出
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin_handler.logoutResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 管理员登出
|
|
tags:
|
|
- API.admin
|
|
/api/admin/modify_password:
|
|
patch:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: 修改密码
|
|
parameters:
|
|
- description: 旧密码
|
|
in: formData
|
|
name: old_password
|
|
required: true
|
|
type: string
|
|
- description: 新密码
|
|
in: formData
|
|
name: new_password
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin_handler.modifyPasswordResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 修改密码
|
|
tags:
|
|
- API.admin
|
|
/api/admin/reset_password/{id}:
|
|
patch:
|
|
consumes:
|
|
- application/json
|
|
description: 重置密码
|
|
parameters:
|
|
- description: hashId
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin_handler.resetPasswordResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 重置密码
|
|
tags:
|
|
- API.admin
|
|
/api/admin/used:
|
|
patch:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: 更新管理员为启用/禁用
|
|
parameters:
|
|
- description: Hashid
|
|
in: formData
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: 是否启用 1:是 -1:否
|
|
in: formData
|
|
name: used
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin_handler.updateUsedResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 更新管理员为启用/禁用
|
|
tags:
|
|
- API.admin
|
|
/api/authorized:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: 调用方列表
|
|
parameters:
|
|
- description: 第几页
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: 每页显示条数
|
|
in: query
|
|
name: page_size
|
|
type: string
|
|
- description: 调用方key
|
|
in: query
|
|
name: business_key
|
|
type: string
|
|
- description: 调用方secret
|
|
in: query
|
|
name: business_secret
|
|
type: string
|
|
- description: 调用方对接人
|
|
in: query
|
|
name: business_developer
|
|
type: string
|
|
- description: 备注
|
|
in: path
|
|
name: remark
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/authorized_handler.listResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 调用方列表
|
|
tags:
|
|
- API.authorized
|
|
post:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: 新增调用方
|
|
parameters:
|
|
- description: 调用方key
|
|
in: formData
|
|
name: business_key
|
|
required: true
|
|
type: string
|
|
- description: 调用方对接人
|
|
in: formData
|
|
name: business_developer
|
|
required: true
|
|
type: string
|
|
- description: 备注
|
|
in: formData
|
|
name: remark
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/authorized_handler.createResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 新增调用方
|
|
tags:
|
|
- API.authorized
|
|
/api/authorized/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: 删除调用方
|
|
parameters:
|
|
- description: hashId
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/authorized_handler.deleteResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 删除调用方
|
|
tags:
|
|
- API.authorized
|
|
/api/authorized/used:
|
|
patch:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: 更新调用方为启用/禁用
|
|
parameters:
|
|
- description: Hashid
|
|
in: formData
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: 是否启用 1:是 -1:否
|
|
in: formData
|
|
name: used
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/authorized_handler.updateUsedResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 更新调用方为启用/禁用
|
|
tags:
|
|
- API.authorized
|
|
/api/authorized_api:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: 调用方接口地址列表
|
|
parameters:
|
|
- description: 调用方key
|
|
in: query
|
|
name: business_key
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/authorized_handler.listAPIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 调用方接口地址列表
|
|
tags:
|
|
- API.authorized
|
|
post:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: 授权调用方接口地址
|
|
parameters:
|
|
- description: HashID
|
|
in: formData
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: 请求方法
|
|
in: formData
|
|
name: method
|
|
required: true
|
|
type: string
|
|
- description: 请求地址
|
|
in: formData
|
|
name: api
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/authorized_handler.createAPIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 授权调用方接口地址
|
|
tags:
|
|
- API.authorized
|
|
/api/authorized_api/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: 删除调用方接口地址
|
|
parameters:
|
|
- description: 主键ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/authorized_handler.deleteAPIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 删除调用方接口地址
|
|
tags:
|
|
- API.authorized
|
|
/api/config/email:
|
|
patch:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: 修改邮件配置
|
|
parameters:
|
|
- description: 邮箱服务器
|
|
in: formData
|
|
name: host
|
|
required: true
|
|
type: string
|
|
- description: 端口
|
|
in: formData
|
|
name: port
|
|
required: true
|
|
type: string
|
|
- description: 发件人邮箱
|
|
in: formData
|
|
name: user
|
|
required: true
|
|
type: string
|
|
- description: 发件人密码
|
|
in: formData
|
|
name: pass
|
|
required: true
|
|
type: string
|
|
- description: 收件人邮箱地址,多个用,分割
|
|
in: formData
|
|
name: to
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/config_handler.emailResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 修改邮件配置
|
|
tags:
|
|
- API.config
|
|
/api/tool/hashids/decode/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: HashIds 解密
|
|
parameters:
|
|
- description: 需解密的密文
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/tool_handler.hashIdsDecodeResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: HashIds 解密
|
|
tags:
|
|
- API.tool
|
|
/api/tool/hashids/encode/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: HashIds 加密
|
|
parameters:
|
|
- description: 需加密的数字
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/tool_handler.hashIdsEncodeResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: HashIds 加密
|
|
tags:
|
|
- API.tool
|
|
swagger: "2.0"
|