548 lines
13 KiB
YAML
548 lines
13 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
|
|
keyword.createKeywordRequest:
|
|
properties:
|
|
app_id:
|
|
description: 小程序ID
|
|
type: string
|
|
keyword:
|
|
description: 关键字
|
|
type: string
|
|
required:
|
|
- app_id
|
|
- keyword
|
|
type: object
|
|
keyword.createKeywordResponse:
|
|
properties:
|
|
id:
|
|
description: 关键字ID
|
|
type: integer
|
|
message:
|
|
description: 提示信息
|
|
type: string
|
|
type: object
|
|
keyword.deleteKeywordResponse:
|
|
properties:
|
|
message:
|
|
description: 提示信息
|
|
type: string
|
|
type: object
|
|
keyword.keywordListData:
|
|
properties:
|
|
app_id:
|
|
description: 小程序ID
|
|
type: string
|
|
created_at:
|
|
description: 创建时间
|
|
type: string
|
|
created_user:
|
|
description: 创建人
|
|
type: string
|
|
id:
|
|
description: 关键字编号
|
|
type: integer
|
|
keyword:
|
|
description: 意图关键字
|
|
type: string
|
|
material_type_count:
|
|
description: 素材类型数量
|
|
type: string
|
|
updated_at:
|
|
description: 更新时间
|
|
type: string
|
|
updated_user:
|
|
description: 更新人
|
|
type: string
|
|
type: object
|
|
keyword.keywordPageListResponse:
|
|
properties:
|
|
list:
|
|
items:
|
|
$ref: '#/definitions/keyword.keywordListData'
|
|
type: array
|
|
page:
|
|
description: 当前页码
|
|
type: integer
|
|
page_size:
|
|
description: 每页返回的数据量
|
|
type: integer
|
|
total:
|
|
description: 符合查询条件的总记录数
|
|
type: integer
|
|
type: object
|
|
keyword.modifyKeywordRequest:
|
|
properties:
|
|
keyword:
|
|
description: 意图关键字
|
|
type: string
|
|
required:
|
|
- keyword
|
|
type: object
|
|
keyword.modifyKeywordResponse:
|
|
properties:
|
|
message:
|
|
description: 提示信息
|
|
type: string
|
|
type: object
|
|
upload.uploadImageResponse:
|
|
properties:
|
|
preview_image_url:
|
|
description: 可预览图片地址
|
|
type: string
|
|
real_image_url:
|
|
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/app/keyword:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 添加意图关键字
|
|
parameters:
|
|
- description: 请求参数
|
|
in: body
|
|
name: RequestBody
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/keyword.createKeywordRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/keyword.createKeywordResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
security:
|
|
- LoginVerifyToken: []
|
|
summary: 添加意图关键字
|
|
tags:
|
|
- 管理端.意图关键字
|
|
/admin/app/keyword/{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/keyword.deleteKeywordResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
security:
|
|
- LoginVerifyToken: []
|
|
summary: 删除意图关键字
|
|
tags:
|
|
- 管理端.意图关键字
|
|
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/keyword.modifyKeywordRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/keyword.modifyKeywordResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
security:
|
|
- LoginVerifyToken: []
|
|
summary: 修改意图关键字
|
|
tags:
|
|
- 管理端.意图关键字
|
|
/admin/app/keywords:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: 获取意图关键字列表
|
|
parameters:
|
|
- description: 小程序ID
|
|
in: query
|
|
name: app_id
|
|
required: true
|
|
type: integer
|
|
- description: 意图关键字
|
|
in: query
|
|
name: keyword
|
|
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/keyword.keywordPageListResponse'
|
|
"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:
|
|
- 管理端.登录
|
|
/admin/upload/image:
|
|
post:
|
|
consumes:
|
|
- multipart/form-data
|
|
description: 上传图片
|
|
parameters:
|
|
- description: 选择文件
|
|
in: formData
|
|
name: file
|
|
required: true
|
|
type: file
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/upload.uploadImageResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/code.Failure'
|
|
summary: 上传图片
|
|
tags:
|
|
- 通用
|
|
securityDefinitions:
|
|
LoginVerifyToken:
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|