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