Documentation
¶
Index ¶
- Variables
- func CheckKefuPass(username string, password string) (models.User, models.User_role, bool)
- func DelIpblack(c *gin.Context)
- func DelReplyContent(c *gin.Context)
- func DelReplyGroup(c *gin.Context)
- func DeleteKefuInfo(c *gin.Context)
- func DeleteOnlineTcp(c *gin.Context)
- func GetAbout(c *gin.Context)
- func GetAbouts(c *gin.Context)
- func GetAutoReplys(c *gin.Context)
- func GetCaptcha(c *gin.Context)
- func GetChartStatistic(c *gin.Context)
- func GetCheckWeixinSign(c *gin.Context)
- func GetConfig(c *gin.Context)
- func GetConfigs(c *gin.Context)
- func GetIpblacks(c *gin.Context)
- func GetIpblacksByKefuId(c *gin.Context)
- func GetKefuInfo(c *gin.Context)
- func GetKefuInfoAll(c *gin.Context)
- func GetKefuInfoSetting(c *gin.Context)
- func GetKefuList(c *gin.Context)
- func GetKefusVisitorOnlines(c *gin.Context)
- func GetMessagesV2(c *gin.Context)
- func GetMessagespages(c *gin.Context)
- func GetNotice(c *gin.Context)
- func GetOtherKefuList(c *gin.Context)
- func GetReplys(c *gin.Context)
- func GetRoleList(c *gin.Context)
- func GetStatistics(c *gin.Context)
- func GetVisitor(c *gin.Context)
- func GetVisitorMessage(c *gin.Context)
- func GetVisitorOnlines(c *gin.Context)
- func GetVisitors(c *gin.Context)
- func Index(c *gin.Context)
- func LoginCheckPass(c *gin.Context)
- func MainCheckAuth(c *gin.Context)
- func NewTcpServer(tcpBaseServer string)
- func PostAbout(c *gin.Context)
- func PostBindOfficial(c *gin.Context)
- func PostConfig(c *gin.Context)
- func PostInstall(c *gin.Context)
- func PostIpblack(c *gin.Context)
- func PostKefuAvator(c *gin.Context)
- func PostKefuClient(c *gin.Context)
- func PostKefuInfo(c *gin.Context)
- func PostKefuPass(c *gin.Context)
- func PostKefuRegister(c *gin.Context)
- func PostReply(c *gin.Context)
- func PostReplyContent(c *gin.Context)
- func PostReplyContentSave(c *gin.Context)
- func PostReplySearch(c *gin.Context)
- func PostRole(c *gin.Context)
- func PostTransKefu(c *gin.Context)
- func PostVisitorLogin(c *gin.Context)
- func PushServerTcp(str []byte)
- func SendAppGetuiPush(kefu string, title, content string)
- func SendCloseMessageV2(c *gin.Context)
- func SendMessageV2(c *gin.Context)
- func SendNoticeEmail(username, msg string)
- func SendServerJiang(title string, content string, domain string) string
- func SendVisitorLoginNotice(kefuName, visitorName, avator, content, visitorId string)
- func SendVisitorNotice(c *gin.Context)
- func Serve(w http.ResponseWriter, r *http.Request, id, ext, lang string, download bool, ...) error
- func UploadFile(c *gin.Context)
- func UploadImg(c *gin.Context)
- type ChatMessage
- type GetuiResponse
- type ReplyContentForm
- type ReplyForm
- type Response
- type VisitorExtra
- type VisitorOnline
Constants ¶
This section is empty.
Variables ¶
var (
Port string
)
Functions ¶
func CheckKefuPass ¶
func DelIpblack ¶
func DelReplyContent ¶
func DelReplyGroup ¶
func DeleteKefuInfo ¶
func DeleteOnlineTcp ¶
func GetAutoReplys ¶
func GetCaptcha ¶
func GetChartStatistic ¶
func GetCheckWeixinSign ¶
func GetConfigs ¶
func GetIpblacks ¶
func GetIpblacksByKefuId ¶
func GetKefuInfo ¶
func GetKefuInfoAll ¶
func GetKefuInfoSetting ¶
func GetKefuList ¶
func GetKefusVisitorOnlines ¶
@Summary 获取客服的在线访客列表接口 @Produce json @Success 200 {object} controller.Response @Failure 200 {object} controller.Response @Router /visitors_kefu_online [get]
func GetMessagesV2 ¶
func GetMessagespages ¶
func GetOtherKefuList ¶
func GetRoleList ¶
func GetStatistics ¶
func GetVisitor ¶
func GetVisitorMessage ¶
@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 GetVisitorOnlines ¶
@Summary 获取在线访客列表接口 @Produce json @Success 200 {object} controller.Response @Failure 200 {object} controller.Response @Router /visitors_online [get]
func GetVisitors ¶
@Summary 获取访客列表接口 @Produce json @Accept multipart/form-data @Param page query string true "分页" @Param token header string true "认证token" @Success 200 {object} controller.Response @Failure 200 {object} controller.Response @Router /visitors [get]
func LoginCheckPass ¶
@Summary 登陆验证接口 @Produce json @Accept multipart/form-data @Param username formData string true "用户名" @Param password formData string true "密码" @Param type formData string true "类型" @Success 200 {object} controller.Response @Failure 200 {object} controller.Response @Router /check [post] 验证接口
func MainCheckAuth ¶
func NewTcpServer ¶
func NewTcpServer(tcpBaseServer string)
func PostConfig ¶
func PostInstall ¶
func PostIpblack ¶
func PostKefuAvator ¶
func PostKefuClient ¶
func PostKefuInfo ¶
func PostKefuPass ¶
func PostKefuRegister ¶
func PostReplyContent ¶
func PostReplyContentSave ¶
func PostReplySearch ¶
func PostTransKefu ¶
func PostVisitorLogin ¶
func PostVisitor(c *gin.Context) {
name := c.PostForm("name")
avator := c.PostForm("avator")
toId := c.PostForm("to_id")
id := c.PostForm("id")
refer := c.PostForm("refer")
city := c.PostForm("city")
client_ip := c.PostForm("client_ip")
if name == "" || avator == "" || toId == "" || id == "" || refer == "" || city == "" || client_ip == "" {
c.JSON(200, gin.H{
"code": 400,
"msg": "error",
})
return
}
kefuInfo := models.FindUser(toId)
if kefuInfo.ID == 0 {
c.JSON(200, gin.H{
"code": 400,
"msg": "用户不存在",
})
return
}
models.CreateVisitor(name, avator, c.ClientIP(), toId, id, refer, city, client_ip)
userInfo := make(map[string]string)
userInfo["uid"] = id
userInfo["username"] = name
userInfo["avator"] = avator
msg := TypeMessage{
Type: "userOnline",
Data: userInfo,
}
str, _ := json.Marshal(msg)
kefuConns := kefuList[toId]
if kefuConns != nil {
for k, kefuConn := range kefuConns {
log.Println(k, "xxxxxxxx")
kefuConn.WriteMessage(websocket.TextMessage, str)
}
}
c.JSON(200, gin.H{
"code": 200,
"msg": "ok",
})
}
func PushServerTcp ¶
func PushServerTcp(str []byte)
func SendAppGetuiPush ¶
func SendCloseMessageV2 ¶
func SendMessageV2 ¶
func SendNoticeEmail ¶
func SendNoticeEmail(username, msg string)
func SendVisitorLoginNotice ¶
func SendVisitorLoginNotice(kefuName, visitorName, avator, content, visitorId string)