增加聊天记录文档

pull/30/head
taoshihan1991 4 years ago
parent 0ace37765c
commit ff9c1b32d6

@ -42,7 +42,7 @@ func LoginCheckPass(c *gin.Context) {
})
return
}
case "kefulogin":
case "kefu":
info,uRole,ok:=CheckKefuPass(username, password)
userinfo:= make(map[string]interface{})
if !ok{

@ -39,6 +39,14 @@ func GetVisitors(c *gin.Context) {
},
})
}
// @Summary 获取访客聊天信息接口
// @Produce json
// @Accept multipart/form-data
// @Param visitorId query string true "访客ID"
// @Param token header string true "认证token"
// @Success 200 {object} controller.Response
// @Failure 200 {object} controller.Response
// @Router /messages [get]
func GetVisitorMessage(c *gin.Context) {
visitorId:=c.Query("visitorId")
messages:=models.FindMessageByVisitorId(visitorId)

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2020-07-13 15:09:32.8830515 +0800 CST m=+0.102005901
// 2020-07-13 19:22:07.3168355 +0800 CST m=+0.136007801
package docs
@ -66,6 +66,42 @@ var doc = `{
}
}
},
"/messages": {
"get": {
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"summary": "获取访客聊天信息接口",
"parameters": [
{
"type": "string",
"description": "访客ID",
"name": "visitorId",
"in": "query",
"required": true
},
{
"type": "string",
"description": "认证token",
"name": "token",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/controller.Response"
}
}
}
}
},
"/visitors": {
"get": {
"consumes": [

@ -53,6 +53,42 @@
}
}
},
"/messages": {
"get": {
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"summary": "获取访客聊天信息接口",
"parameters": [
{
"type": "string",
"description": "访客ID",
"name": "visitorId",
"in": "query",
"required": true
},
{
"type": "string",
"description": "认证token",
"name": "token",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"$ref": "#/definitions/controller.Response"
}
}
}
}
},
"/visitors": {
"get": {
"consumes": [

@ -46,6 +46,30 @@ paths:
$ref: '#/definitions/controller.Response'
type: object
summary: 登陆验证接口
/messages:
get:
consumes:
- multipart/form-data
parameters:
- description: 访客ID
in: query
name: visitorId
required: true
type: string
- description: 认证token
in: header
name: token
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/controller.Response'
type: object
summary: 获取访客聊天信息接口
/visitors:
get:
consumes:

@ -73,9 +73,10 @@ func main() {
engine.GET("/webcss", tmpl.PageWebCss)
//文档服务
docs.SwaggerInfo.Title = "GO-FLY接口文档"
docs.SwaggerInfo.Description = "go-fly即时通讯web客服管理系统"
docs.SwaggerInfo.Description = "go-fly即时通讯web客服管理系统 , 测试账户:kefu2 测试密码:123 类型:kefu"
docs.SwaggerInfo.Version = "0.0.6"
docs.SwaggerInfo.Host = "127.0.0.1:"+port
//docs.SwaggerInfo.Host = "127.0.0.1:"+port
docs.SwaggerInfo.Host = "gofly.sopans.com"
docs.SwaggerInfo.BasePath = "/"
//docs.SwaggerInfo.Schemes = []string{"http"}
engine.GET("/docs/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))

@ -309,6 +309,10 @@
;
}
});
},
//获取聊天记录
getHistoryByApi(){
},
initCss(){
$(function () {

@ -77,6 +77,7 @@
<el-form-item>
<el-button :loading="loading" type="primary" @click="kefuLogin('kefuForm')">客服登陆</el-button>
<el-button type="primary" @click="showKefu">访客咨询</el-button>
<el-button type="primary" @click="window.location.href='/docs/index.html'">接口文档</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
@ -138,7 +139,7 @@
return false;
} else {
let data = {};
data.type="kefulogin";
data.type="kefu";
data.username = _this.kefuForm.username;
data.password = _this.kefuForm.password;
_this.loading = true;

Loading…
Cancel
Save