300 lines
6.7 KiB
YAML
300 lines
6.7 KiB
YAML
basePath: /
|
|
definitions:
|
|
admin.loginRequest:
|
|
properties:
|
|
password:
|
|
description: 密码 (MD5加密后的密码)
|
|
type: string
|
|
username:
|
|
description: 用户名
|
|
type: string
|
|
required:
|
|
- password
|
|
- username
|
|
type: object
|
|
admin.loginResponse:
|
|
properties:
|
|
token:
|
|
description: 登录成功后颁发的 Token
|
|
type: string
|
|
type: object
|
|
app.createAppRequest:
|
|
properties:
|
|
app_id:
|
|
description: 小程序ID
|
|
type: string
|
|
avatar:
|
|
description: 头像
|
|
type: string
|
|
description:
|
|
description: 描述
|
|
type: string
|
|
name:
|
|
description: 名称
|
|
type: string
|
|
required:
|
|
- app_id
|
|
- name
|
|
type: object
|
|
app.createAppResponse:
|
|
properties:
|
|
message:
|
|
description: 提示信息
|
|
type: string
|
|
type: object
|
|
app.deleteAppRequest:
|
|
properties:
|
|
ids:
|
|
description: 小程序编号(多个用,分割)
|
|
type: string
|
|
required:
|
|
- ids
|
|
type: object
|
|
app.deleteAppResponse:
|
|
properties:
|
|
message:
|
|
description: 提示信息
|
|
type: string
|
|
type: object
|
|
app.listData:
|
|
properties:
|
|
app_id:
|
|
description: 小程序ID
|
|
type: string
|
|
avatar:
|
|
description: 小程序头像
|
|
type: string
|
|
created_at:
|
|
description: 创建时间
|
|
type: string
|
|
description:
|
|
description: 小程序描述
|
|
type: string
|
|
id:
|
|
description: 小程序编号
|
|
type: integer
|
|
name:
|
|
description: 小程序名称
|
|
type: string
|
|
updated_at:
|
|
description: 更新时间
|
|
type: string
|
|
type: object
|
|
app.listResponse:
|
|
properties:
|
|
list:
|
|
items:
|
|
$ref: '#/definitions/app.listData'
|
|
type: array
|
|
page:
|
|
description: 当前页码
|
|
type: integer
|
|
page_size:
|
|
description: 每页返回的数据量
|
|
type: integer
|
|
total:
|
|
description: 符合查询条件的总记录数
|
|
type: integer
|
|
type: object
|
|
app.modifyAppRequest:
|
|
properties:
|
|
app_id:
|
|
description: 小程序ID
|
|
type: string
|
|
avatar:
|
|
description: 头像
|
|
type: string
|
|
description:
|
|
description: 描述
|
|
type: string
|
|
name:
|
|
description: 名称
|
|
type: string
|
|
required:
|
|
- app_id
|
|
- name
|
|
type: object
|
|
app.modifyAppResponse:
|
|
properties:
|
|
message:
|
|
description: 提示信息
|
|
type: string
|
|
type: object
|
|
code.Failure:
|
|
properties:
|
|
code:
|
|
description: 业务码
|
|
type: integer
|
|
message:
|
|
description: 描述信息
|
|
type: string
|
|
type: object
|
|
info:
|
|
contact: {}
|
|
title: mini-chat 接口文档
|
|
version: v0.0.1
|
|
paths:
|
|
/admin/app/{id}:
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: 编辑小程序
|
|
parameters:
|
|
- description: 编号ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: string
|
|
- description: 请求参数
|
|
in: body
|
|
name: RequestBody
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/app.modifyAppRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/app.modifyAppResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
security:
|
|
- LoginVerifyToken: []
|
|
summary: 编辑小程序
|
|
tags:
|
|
- 管理端.小程序
|
|
/admin/app/create:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 新增小程序
|
|
parameters:
|
|
- description: 请求参数
|
|
in: body
|
|
name: RequestBody
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/app.createAppRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/app.createAppResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
security:
|
|
- LoginVerifyToken: []
|
|
summary: 新增小程序
|
|
tags:
|
|
- 管理端.小程序
|
|
/admin/app/delete:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 删除小程序
|
|
parameters:
|
|
- description: 请求参数
|
|
in: body
|
|
name: RequestBody
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/app.deleteAppRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/app.deleteAppResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
security:
|
|
- LoginVerifyToken: []
|
|
summary: 删除小程序
|
|
tags:
|
|
- 管理端.小程序
|
|
/admin/apps:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: 小程序列表
|
|
parameters:
|
|
- description: 小程序名称
|
|
in: query
|
|
name: name
|
|
type: string
|
|
- description: 小程序ID
|
|
in: query
|
|
name: app_id
|
|
type: string
|
|
- default: 1
|
|
description: 当前页码
|
|
in: query
|
|
name: page
|
|
required: true
|
|
type: integer
|
|
- default: 20
|
|
description: 每页返回的数据量,最多 100 条
|
|
in: query
|
|
name: page_size
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/app.listResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
security:
|
|
- LoginVerifyToken: []
|
|
summary: 小程序列表
|
|
tags:
|
|
- 管理端.小程序
|
|
/admin/login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 管理员登录
|
|
parameters:
|
|
- description: 请求参数
|
|
in: body
|
|
name: RequestBody
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/admin.loginRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/admin.loginResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 管理员登录
|
|
tags:
|
|
- 管理端.登录
|
|
securityDefinitions:
|
|
LoginVerifyToken:
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|