feat(1.0):路径追加 /api
This commit is contained in:
parent
e77223be17
commit
e61a293616
322
docs/docs.go
322
docs/docs.go
@ -15,7 +15,7 @@ const docTemplate = `{
|
||||
"host": "{{.Host}}",
|
||||
"basePath": "{{.BasePath}}",
|
||||
"paths": {
|
||||
"/admin/app/create": {
|
||||
"/api/admin/app/create": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -60,7 +60,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/delete": {
|
||||
"/api/admin/app/delete": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -105,7 +105,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keyword": {
|
||||
"/api/admin/app/keyword": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -150,7 +150,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keyword/material/{id}": {
|
||||
"/api/admin/app/keyword/material/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -252,7 +252,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keyword/materials": {
|
||||
"/api/admin/app/keyword/materials": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -311,7 +311,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keyword/{id}": {
|
||||
"/api/admin/app/keyword/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -404,7 +404,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keywords": {
|
||||
"/api/admin/app/keywords": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -469,7 +469,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/users": {
|
||||
"/api/admin/app/users": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -540,7 +540,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/{id}": {
|
||||
"/api/admin/app/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -592,7 +592,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/apps": {
|
||||
"/api/admin/apps": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -662,7 +662,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/create": {
|
||||
"/api/admin/create": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -707,7 +707,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/delete": {
|
||||
"/api/admin/delete": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -752,7 +752,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/list": {
|
||||
"/api/admin/list": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -816,7 +816,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/login": {
|
||||
"/api/admin/login": {
|
||||
"post": {
|
||||
"description": "管理员登录",
|
||||
"consumes": [
|
||||
@ -856,7 +856,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/messages": {
|
||||
"/api/admin/messages": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -922,7 +922,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/messages/latest": {
|
||||
"/api/admin/messages/latest": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -981,7 +981,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/rel_app/{id}": {
|
||||
"/api/admin/rel_app/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -1033,7 +1033,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/send_message": {
|
||||
"/api/admin/send_message": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -1078,7 +1078,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/upload/image": {
|
||||
"/api/admin/upload/image": {
|
||||
"post": {
|
||||
"description": "上传图片",
|
||||
"consumes": [
|
||||
@ -1116,7 +1116,7 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/{id}": {
|
||||
"/api/admin/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -1168,6 +1168,147 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/messages": {
|
||||
"get": {
|
||||
"description": "获取消息日志",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "获取消息日志",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "小程序ID",
|
||||
"name": "app_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "用户ID",
|
||||
"name": "user_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"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/message.appMessagePageListResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/send_message": {
|
||||
"post": {
|
||||
"description": "用户发送消息",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "用户发送消息",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求参数",
|
||||
"name": "RequestBody",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/message.userSendMessageRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/message.userSendMessageResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/user/create": {
|
||||
"post": {
|
||||
"description": "新增小程序用户",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "新增小程序用户",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求参数",
|
||||
"name": "RequestBody",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/app.createAppUserRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/app.createAppUserResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/wechat/miniprogram/login": {
|
||||
"post": {
|
||||
"description": "通过AppID和code获取用户的openid,系统自动生成用户名和头像",
|
||||
@ -1259,147 +1400,6 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/app/messages": {
|
||||
"get": {
|
||||
"description": "获取消息日志",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "获取消息日志",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "小程序ID",
|
||||
"name": "app_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "用户ID",
|
||||
"name": "user_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"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/message.appMessagePageListResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/app/send_message": {
|
||||
"post": {
|
||||
"description": "用户发送消息",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "用户发送消息",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求参数",
|
||||
"name": "RequestBody",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/message.userSendMessageRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/message.userSendMessageResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/app/user/create": {
|
||||
"post": {
|
||||
"description": "新增小程序用户",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "新增小程序用户",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求参数",
|
||||
"name": "RequestBody",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/app.createAppUserRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/app.createAppUserResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
},
|
||||
"basePath": "/",
|
||||
"paths": {
|
||||
"/admin/app/create": {
|
||||
"/api/admin/app/create": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -52,7 +52,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/delete": {
|
||||
"/api/admin/app/delete": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -97,7 +97,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keyword": {
|
||||
"/api/admin/app/keyword": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -142,7 +142,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keyword/material/{id}": {
|
||||
"/api/admin/app/keyword/material/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -244,7 +244,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keyword/materials": {
|
||||
"/api/admin/app/keyword/materials": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -303,7 +303,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keyword/{id}": {
|
||||
"/api/admin/app/keyword/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -396,7 +396,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/keywords": {
|
||||
"/api/admin/app/keywords": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -461,7 +461,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/users": {
|
||||
"/api/admin/app/users": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -532,7 +532,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/app/{id}": {
|
||||
"/api/admin/app/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -584,7 +584,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/apps": {
|
||||
"/api/admin/apps": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -654,7 +654,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/create": {
|
||||
"/api/admin/create": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -699,7 +699,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/delete": {
|
||||
"/api/admin/delete": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -744,7 +744,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/list": {
|
||||
"/api/admin/list": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -808,7 +808,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/login": {
|
||||
"/api/admin/login": {
|
||||
"post": {
|
||||
"description": "管理员登录",
|
||||
"consumes": [
|
||||
@ -848,7 +848,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/messages": {
|
||||
"/api/admin/messages": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -914,7 +914,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/messages/latest": {
|
||||
"/api/admin/messages/latest": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
@ -973,7 +973,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/rel_app/{id}": {
|
||||
"/api/admin/rel_app/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -1025,7 +1025,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/send_message": {
|
||||
"/api/admin/send_message": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -1070,7 +1070,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/upload/image": {
|
||||
"/api/admin/upload/image": {
|
||||
"post": {
|
||||
"description": "上传图片",
|
||||
"consumes": [
|
||||
@ -1108,7 +1108,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/{id}": {
|
||||
"/api/admin/{id}": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
@ -1160,6 +1160,147 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/messages": {
|
||||
"get": {
|
||||
"description": "获取消息日志",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "获取消息日志",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "小程序ID",
|
||||
"name": "app_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "用户ID",
|
||||
"name": "user_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"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/message.appMessagePageListResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/send_message": {
|
||||
"post": {
|
||||
"description": "用户发送消息",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "用户发送消息",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求参数",
|
||||
"name": "RequestBody",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/message.userSendMessageRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/message.userSendMessageResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/app/user/create": {
|
||||
"post": {
|
||||
"description": "新增小程序用户",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "新增小程序用户",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求参数",
|
||||
"name": "RequestBody",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/app.createAppUserRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/app.createAppUserResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/wechat/miniprogram/login": {
|
||||
"post": {
|
||||
"description": "通过AppID和code获取用户的openid,系统自动生成用户名和头像",
|
||||
@ -1251,147 +1392,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/app/messages": {
|
||||
"get": {
|
||||
"description": "获取消息日志",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "获取消息日志",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "小程序ID",
|
||||
"name": "app_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "用户ID",
|
||||
"name": "user_id",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"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/message.appMessagePageListResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/app/send_message": {
|
||||
"post": {
|
||||
"description": "用户发送消息",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "用户发送消息",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求参数",
|
||||
"name": "RequestBody",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/message.userSendMessageRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/message.userSendMessageResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/app/user/create": {
|
||||
"post": {
|
||||
"description": "新增小程序用户",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"用户端"
|
||||
],
|
||||
"summary": "新增小程序用户",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "请求参数",
|
||||
"name": "RequestBody",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/app.createAppUserRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/app.createAppUserResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/code.Failure"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
|
||||
@ -754,7 +754,7 @@ info:
|
||||
title: mini-chat 接口文档
|
||||
version: v0.0.1
|
||||
paths:
|
||||
/admin/{id}:
|
||||
/api/admin/{id}:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -787,7 +787,7 @@ paths:
|
||||
summary: 编辑客服
|
||||
tags:
|
||||
- 管理端.客服管理
|
||||
/admin/app/{id}:
|
||||
/api/admin/app/{id}:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -820,7 +820,7 @@ paths:
|
||||
summary: 编辑小程序
|
||||
tags:
|
||||
- 管理端.小程序
|
||||
/admin/app/create:
|
||||
/api/admin/app/create:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -848,7 +848,7 @@ paths:
|
||||
summary: 新增小程序
|
||||
tags:
|
||||
- 管理端.小程序
|
||||
/admin/app/delete:
|
||||
/api/admin/app/delete:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -876,7 +876,7 @@ paths:
|
||||
summary: 删除小程序
|
||||
tags:
|
||||
- 管理端.小程序
|
||||
/admin/app/keyword:
|
||||
/api/admin/app/keyword:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -904,7 +904,7 @@ paths:
|
||||
summary: 添加意图关键字
|
||||
tags:
|
||||
- 管理端.意图关键字
|
||||
/admin/app/keyword/{id}:
|
||||
/api/admin/app/keyword/{id}:
|
||||
delete:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -963,7 +963,7 @@ paths:
|
||||
summary: 修改意图关键字
|
||||
tags:
|
||||
- 管理端.意图关键字
|
||||
/admin/app/keyword/material/{id}:
|
||||
/api/admin/app/keyword/material/{id}:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1028,7 +1028,7 @@ paths:
|
||||
summary: 修改意图关键字素材
|
||||
tags:
|
||||
- 管理端.意图关键字
|
||||
/admin/app/keyword/materials:
|
||||
/api/admin/app/keyword/materials:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1067,7 +1067,7 @@ paths:
|
||||
summary: 获取意图关键字素材列表
|
||||
tags:
|
||||
- 管理端.意图关键字
|
||||
/admin/app/keywords:
|
||||
/api/admin/app/keywords:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1110,7 +1110,7 @@ paths:
|
||||
summary: 获取意图关键字列表
|
||||
tags:
|
||||
- 管理端.意图关键字
|
||||
/admin/app/users:
|
||||
/api/admin/app/users:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1157,7 +1157,7 @@ paths:
|
||||
summary: 小程序用户列表
|
||||
tags:
|
||||
- 管理端.小程序
|
||||
/admin/apps:
|
||||
/api/admin/apps:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1203,7 +1203,7 @@ paths:
|
||||
summary: 小程序列表
|
||||
tags:
|
||||
- 管理端.小程序
|
||||
/admin/create:
|
||||
/api/admin/create:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1231,7 +1231,7 @@ paths:
|
||||
summary: 新增客服
|
||||
tags:
|
||||
- 管理端.客服管理
|
||||
/admin/delete:
|
||||
/api/admin/delete:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1259,7 +1259,7 @@ paths:
|
||||
summary: 删除客服
|
||||
tags:
|
||||
- 管理端.客服管理
|
||||
/admin/list:
|
||||
/api/admin/list:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1301,7 +1301,7 @@ paths:
|
||||
summary: 客服列表
|
||||
tags:
|
||||
- 管理端.客服管理
|
||||
/admin/login:
|
||||
/api/admin/login:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1327,7 +1327,7 @@ paths:
|
||||
summary: 管理员登录
|
||||
tags:
|
||||
- 管理端.登录
|
||||
/admin/messages:
|
||||
/api/admin/messages:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1371,7 +1371,7 @@ paths:
|
||||
summary: 获取消息日志
|
||||
tags:
|
||||
- 管理端.小程序
|
||||
/admin/messages/latest:
|
||||
/api/admin/messages/latest:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1410,7 +1410,7 @@ paths:
|
||||
summary: 根据appid获取最新消息记录
|
||||
tags:
|
||||
- 管理端.小程序
|
||||
/admin/rel_app/{id}:
|
||||
/api/admin/rel_app/{id}:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1443,7 +1443,7 @@ paths:
|
||||
summary: 客服关联小程序
|
||||
tags:
|
||||
- 管理端.客服管理
|
||||
/admin/send_message:
|
||||
/api/admin/send_message:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -1471,7 +1471,7 @@ paths:
|
||||
summary: 管理员发送消息
|
||||
tags:
|
||||
- 管理端.小程序
|
||||
/admin/upload/image:
|
||||
/api/admin/upload/image:
|
||||
post:
|
||||
consumes:
|
||||
- multipart/form-data
|
||||
@ -1496,6 +1496,100 @@ paths:
|
||||
summary: 上传图片
|
||||
tags:
|
||||
- 通用
|
||||
/api/app/messages:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 获取消息日志
|
||||
parameters:
|
||||
- description: 小程序ID
|
||||
in: query
|
||||
name: app_id
|
||||
required: true
|
||||
type: string
|
||||
- description: 用户ID
|
||||
in: query
|
||||
name: user_id
|
||||
required: true
|
||||
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/message.appMessagePageListResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/code.Failure'
|
||||
summary: 获取消息日志
|
||||
tags:
|
||||
- 用户端
|
||||
/api/app/send_message:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 用户发送消息
|
||||
parameters:
|
||||
- description: 请求参数
|
||||
in: body
|
||||
name: RequestBody
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/message.userSendMessageRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/message.userSendMessageResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/code.Failure'
|
||||
summary: 用户发送消息
|
||||
tags:
|
||||
- 用户端
|
||||
/api/app/user/create:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 新增小程序用户
|
||||
parameters:
|
||||
- description: 请求参数
|
||||
in: body
|
||||
name: RequestBody
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/app.createAppUserRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/app.createAppUserResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/code.Failure'
|
||||
summary: 新增小程序用户
|
||||
tags:
|
||||
- 用户端
|
||||
/api/wechat/miniprogram/login:
|
||||
post:
|
||||
consumes:
|
||||
@ -1556,100 +1650,6 @@ paths:
|
||||
summary: 生成微信小程序二维码
|
||||
tags:
|
||||
- 微信
|
||||
/app/messages:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 获取消息日志
|
||||
parameters:
|
||||
- description: 小程序ID
|
||||
in: query
|
||||
name: app_id
|
||||
required: true
|
||||
type: string
|
||||
- description: 用户ID
|
||||
in: query
|
||||
name: user_id
|
||||
required: true
|
||||
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/message.appMessagePageListResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/code.Failure'
|
||||
summary: 获取消息日志
|
||||
tags:
|
||||
- 用户端
|
||||
/app/send_message:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 用户发送消息
|
||||
parameters:
|
||||
- description: 请求参数
|
||||
in: body
|
||||
name: RequestBody
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/message.userSendMessageRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/message.userSendMessageResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/code.Failure'
|
||||
summary: 用户发送消息
|
||||
tags:
|
||||
- 用户端
|
||||
/app/user/create:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 新增小程序用户
|
||||
parameters:
|
||||
- description: 请求参数
|
||||
in: body
|
||||
name: RequestBody
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/app.createAppUserRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/app.createAppUserResponse'
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/code.Failure'
|
||||
summary: 新增小程序用户
|
||||
tags:
|
||||
- 用户端
|
||||
securityDefinitions:
|
||||
LoginVerifyToken:
|
||||
in: header
|
||||
|
||||
@ -35,7 +35,7 @@ type createAdminResponse struct {
|
||||
// @Param RequestBody body createAdminRequest true "请求参数"
|
||||
// @Success 200 {object} createAdminResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/create [post]
|
||||
// @Router /api/admin/create [post]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) CreateAdmin() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -29,7 +29,7 @@ type deleteAdminResponse struct {
|
||||
// @Param RequestBody body deleteAdminRequest true "请求参数"
|
||||
// @Success 200 {object} deleteAdminResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/delete [post]
|
||||
// @Router /api/admin/delete [post]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) DeleteAdmin() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -48,7 +48,7 @@ type listResponse struct {
|
||||
// @Param page_size query int true "每页返回的数据量,最多 100 条" default(20)
|
||||
// @Success 200 {object} listResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/list [get]
|
||||
// @Router /api/admin/list [get]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) PageList() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -36,7 +36,7 @@ type modifyAdminResponse struct {
|
||||
// @Param RequestBody body modifyAdminRequest true "请求参数"
|
||||
// @Success 200 {object} modifyAdminResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/{id} [put]
|
||||
// @Router /api/admin/{id} [put]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) ModifyAdmin() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -32,7 +32,7 @@ type relAppResponse struct {
|
||||
// @Param RequestBody body relAppRequest true "请求参数"
|
||||
// @Success 200 {object} relAppResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/rel_app/{id} [put]
|
||||
// @Router /api/admin/rel_app/{id} [put]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) RelApp() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -35,7 +35,7 @@ type loginResponse struct {
|
||||
// @Param RequestBody body loginRequest true "请求参数"
|
||||
// @Success 200 {object} loginResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/login [post]
|
||||
// @Router /api/admin/login [post]
|
||||
func (h *handler) Login() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
req := new(loginRequest)
|
||||
|
||||
@ -34,7 +34,7 @@ type createAppResponse struct {
|
||||
// @Param RequestBody body createAppRequest true "请求参数"
|
||||
// @Success 200 {object} createAppResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/create [post]
|
||||
// @Router /api/admin/app/create [post]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) CreateApp() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -29,7 +29,7 @@ type deleteAppResponse struct {
|
||||
// @Param RequestBody body deleteAppRequest true "请求参数"
|
||||
// @Success 200 {object} deleteAppResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/delete [post]
|
||||
// @Router /api/admin/app/delete [post]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) DeleteApp() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -45,7 +45,7 @@ type latestMessageByAppIdResponse struct {
|
||||
// @Param page_size query int true "每页返回的数据量,最多 100 条" default(20)
|
||||
// @Success 200 {object} latestMessageByAppIdResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/messages/latest [get]
|
||||
// @Router /api/admin/messages/latest [get]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) LatestMessageByAppId() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -51,7 +51,7 @@ type listResponse struct {
|
||||
// @Param page_size query int true "每页返回的数据量,最多 100 条" default(20)
|
||||
// @Success 200 {object} listResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/apps [get]
|
||||
// @Router /api/admin/apps [get]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) PageList() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -47,7 +47,7 @@ type appMessagePageListResponse struct {
|
||||
// @Param page_size query int true "每页返回的数据量,最多 100 条" default(20)
|
||||
// @Success 200 {object} appMessagePageListResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/messages [get]
|
||||
// @Router /api/admin/messages [get]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) AppMessagePageList() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -31,7 +31,7 @@ type adminSendMessageResponse struct {
|
||||
// @Param RequestBody body adminSendMessageRequest true "请求参数"
|
||||
// @Success 200 {object} adminSendMessageResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/send_message [post]
|
||||
// @Router /api/admin/send_message [post]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) AdminSendMessage() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -35,7 +35,7 @@ type modifyAppResponse struct {
|
||||
// @Param RequestBody body modifyAppRequest true "请求参数"
|
||||
// @Success 200 {object} modifyAppResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/{id} [put]
|
||||
// @Router /api/admin/app/{id} [put]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) ModifyApp() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -34,7 +34,7 @@ type createAppUserResponse struct {
|
||||
// @Param RequestBody body createAppUserRequest true "请求参数"
|
||||
// @Success 200 {object} createAppUserResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /app/user/create [post]
|
||||
// @Router /api/app/user/create [post]
|
||||
func (h *handler) CreateAppUser() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
req := new(createAppUserRequest)
|
||||
|
||||
@ -48,7 +48,7 @@ type userListResponse struct {
|
||||
// @Param page_size query int true "每页返回的数据量,最多 100 条" default(20)
|
||||
// @Success 200 {object} userListResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/users [get]
|
||||
// @Router /api/admin/app/users [get]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) UserPageList() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -31,7 +31,7 @@ type createKeywordResponse struct {
|
||||
// @Param RequestBody body createKeywordRequest true "请求参数"
|
||||
// @Success 200 {object} createKeywordResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/keyword [post]
|
||||
// @Router /api/admin/app/keyword [post]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) CreateKeyword() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -24,7 +24,7 @@ type deleteKeywordResponse struct {
|
||||
// @Param id path string true "编号ID"
|
||||
// @Success 200 {object} deleteKeywordResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/keyword/{id} [delete]
|
||||
// @Router /api/admin/app/keyword/{id} [delete]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) DeleteKeyword() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -50,7 +50,7 @@ type keywordPageListResponse struct {
|
||||
// @Param page_size query int true "每页返回的数据量,最多 100 条" default(20)
|
||||
// @Success 200 {object} keywordPageListResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/keywords [get]
|
||||
// @Router /api/admin/app/keywords [get]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) KeywordPageList() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -38,7 +38,7 @@ type createKeywordMaterialResponse struct {
|
||||
// @Param RequestBody body createKeywordMaterialRequest true "请求参数"
|
||||
// @Success 200 {object} createKeywordMaterialResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/keyword/material/{id} [post]
|
||||
// @Router /api/admin/app/keyword/material/{id} [post]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) CreateKeywordMaterial() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -46,7 +46,7 @@ type keywordMaterialPageListResponse struct {
|
||||
// @Param page_size query int true "每页返回的数据量,最多 100 条" default(20)
|
||||
// @Success 200 {object} keywordMaterialPageListResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/keyword/materials [get]
|
||||
// @Router /api/admin/app/keyword/materials [get]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) KeywordMaterialPageList() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -33,7 +33,7 @@ type modifyKeywordMaterialResponse struct {
|
||||
// @Param RequestBody body modifyKeywordMaterialRequest true "请求参数"
|
||||
// @Success 200 {object} modifyKeywordMaterialResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/keyword/material/{id} [put]
|
||||
// @Router /api/admin/app/keyword/material/{id} [put]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) ModifyKeywordMaterial() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -32,7 +32,7 @@ type modifyKeywordResponse struct {
|
||||
// @Param RequestBody body modifyKeywordRequest true "请求参数"
|
||||
// @Success 200 {object} modifyKeywordResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/app/keyword/{id} [put]
|
||||
// @Router /api/admin/app/keyword/{id} [put]
|
||||
// @Security LoginVerifyToken
|
||||
func (h *handler) ModifyKeyword() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
|
||||
@ -47,7 +47,7 @@ type appMessagePageListResponse struct {
|
||||
// @Param page_size query int true "每页返回的数据量,最多 100 条" default(20)
|
||||
// @Success 200 {object} appMessagePageListResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /app/messages [get]
|
||||
// @Router /api/app/messages [get]
|
||||
func (h *handler) AppMessagePageList() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
req := new(appMessagePageListRequest)
|
||||
|
||||
@ -36,7 +36,7 @@ type userSendMessageResponse struct {
|
||||
// @Param RequestBody body userSendMessageRequest true "请求参数"
|
||||
// @Success 200 {object} userSendMessageResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /app/send_message [post]
|
||||
// @Router /api/app/send_message [post]
|
||||
func (h *handler) UserSendMessage() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
req := new(userSendMessageRequest)
|
||||
|
||||
@ -25,7 +25,7 @@ type uploadImageResponse struct {
|
||||
// @Param file formData file true "选择文件"
|
||||
// @Success 200 {object} uploadImageResponse
|
||||
// @Failure 400 {object} code.Failure
|
||||
// @Router /admin/upload/image [post]
|
||||
// @Router /api/admin/upload/image [post]
|
||||
func (h *handler) UploadImage() core.HandlerFunc {
|
||||
return func(ctx core.Context) {
|
||||
file, err := ctx.FormFile("file")
|
||||
|
||||
@ -51,7 +51,7 @@ func NewHTTPMux(logger logger.CustomLogger, db mysql.Repo, cron cron.Server) (co
|
||||
wechatHandler := wechat.New(logger, db)
|
||||
|
||||
// 管理端非认证接口路由组
|
||||
adminNonAuthApiRouter := mux.Group("/admin")
|
||||
adminNonAuthApiRouter := mux.Group("/api/admin")
|
||||
{
|
||||
adminNonAuthApiRouter.GET("/license/status", func(ctx core.Context) {
|
||||
ctx.Payload(startup.Info())
|
||||
@ -61,7 +61,7 @@ func NewHTTPMux(logger logger.CustomLogger, db mysql.Repo, cron cron.Server) (co
|
||||
adminNonAuthApiRouter.POST("/upload/image", uploadHandler.UploadImage()) // 上传图片
|
||||
}
|
||||
|
||||
appNonAuthApiRouter := mux.Group("/app")
|
||||
appNonAuthApiRouter := mux.Group("/api/app")
|
||||
{
|
||||
appNonAuthApiRouter.POST("/user/create", appHandler.CreateAppUser()) // 新增小程序用户
|
||||
appNonAuthApiRouter.GET("/messages", messageHandler.AppMessagePageList()) // 消息列表
|
||||
@ -76,7 +76,7 @@ func NewHTTPMux(logger logger.CustomLogger, db mysql.Repo, cron cron.Server) (co
|
||||
}
|
||||
|
||||
// 管理端认证接口路由组
|
||||
adminAuthApiRouter := mux.Group("/admin", core.WrapAuthHandler(interceptorHandler.AdminTokenAuthVerify))
|
||||
adminAuthApiRouter := mux.Group("/api/admin", core.WrapAuthHandler(interceptorHandler.AdminTokenAuthVerify))
|
||||
{
|
||||
adminAuthApiRouter.POST("/app/create", appHandler.CreateApp()) // 关联小程序
|
||||
adminAuthApiRouter.POST("/app/delete", appHandler.DeleteApp()) // 删除小程序
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user