diff --git a/config/go-fly.sql b/config/go-fly.sql index 763862a..4b0f170 100644 --- a/config/go-fly.sql +++ b/config/go-fly.sql @@ -129,3 +129,17 @@ UNIQUE KEY `page` (`page`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8| INSERT INTO `about` (`id`, `title_cn`, `title_en`, `keywords_cn`, `keywords_en`, `desc_cn`, `desc_en`, `css_js`, `html_cn`, `html_en`, `page`) VALUES (NULL, 'GO-FLY - 极简强大的Go语言在线客服系统', 'GO-FLY - Simple and Powerful Go language online customer chat system', 'GO-FLY,GO-FLY', 'GO-FLY,GO-FLY', 'GO-FLY,GO-FLY,一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统', 'GO-FLY,GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers', ' ', '
\n
\n

GO-FLY

\n English (United States)\n 中文版 (简体)\n Github\n 客服入口\n 接口文档\n
\n
\n
\n

极简强大的Go语言在线客服系统

\n

GO-FLY,一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统

\n
\n
\n \n \n \n
\n
\n
\n

主要技术架构

\n

github.com/dgrijalva/jwt-go

\n

github.com/gin-gonic/gin

\n

github.com/go-sql-driver/mysql

\n

github.com/gobuffalo/packr/v2

\n

github.com/gorilla/websocket

\n

github.com/ipipdotnet/ipdb-go

\n

github.com/jinzhu/gorm

\n

github.com/satori/go.uuid

\n

github.com/spf13/cobra

\n

github.com/swaggo/gin-swagger

\n

github.com/swaggo/swag\n

\n
\n \n
\n\n\n', '
\n
\n

GO-FLY

\n English (United States)\n 中文版 (简体)\n Github\n Agents Here\n API Documents\n
\n
\n

Simple and Powerful Go language online customer chat system

GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers

Main technical architecture

github.com/dgrijalva/jwt-go

github.com/gin-gonic/gin

github.com/go-sql-driver/mysql

github.com/gobuffalo/packr/v2

github.com/gorilla/websocket

github.com/ipipdotnet/ipdb-go

github.com/jinzhu/gorm

github.com/satori/go.uuid

github.com/spf13/cobra

github.com/swaggo/gin-swagger

github.com/swaggo/swag

\n\n\n', 'index')| +DROP TABLE IF EXISTS `reply_group`| +CREATE TABLE `reply_group` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `group_name` varchar(50) NOT NULL DEFAULT '', + `user_id` varchar(50) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8| +DROP TABLE IF EXISTS `reply_item`| +CREATE TABLE `reply_item` ( + `id` int(11) NOT NULL, + `content` varchar(1024) NOT NULL DEFAULT '', + `group_id` int(11) NOT NULL DEFAULT '0', + `user_id` int(11) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8| \ No newline at end of file diff --git a/controller/reply.go b/controller/reply.go new file mode 100644 index 0000000..a6b6b93 --- /dev/null +++ b/controller/reply.go @@ -0,0 +1,11 @@ +package controller + +import ( + "github.com/gin-gonic/gin" + "github.com/taoshihan1991/imaptool/models" +) + +func GetReplys(c *gin.Context) { + kefuId, _ := c.Get("kefu_id") + models.FindReplyByUserId(kefuId) +} diff --git a/models/replys.go b/models/replys.go new file mode 100644 index 0000000..9ae71e0 --- /dev/null +++ b/models/replys.go @@ -0,0 +1,18 @@ +package models + +type ReplyItem struct { + Id string `json:"item_id"` + Content string `json:"item_content"` + GroupId string `json:"group_id"` +} +type ReplyGroup struct { + Id string `json:"group_id"` + GroupName string `json:"group_name"` + Items []ReplyItem `json:"items"` +} + +func FindReplyByUserId(userId interface{}) ReplyGroup { + var replyGroup ReplyGroup + DB.Raw("select a.*,b.* from reply_group a left join reply_items b on a.id=b.group_id where a.user_id=? ", userId).Scan(&replyGroup) + return replyGroup +} diff --git a/router/api.go b/router/api.go index fee8668..d5a1d9e 100644 --- a/router/api.go +++ b/router/api.go @@ -81,6 +81,7 @@ func InitApiRouter(engine *gin.Engine) { engine.GET("/configs", middleware.JwtApiMiddleware, middleware.RbacAuth, controller.GetConfigs) engine.POST("/config", middleware.JwtApiMiddleware, middleware.RbacAuth, controller.PostConfig) engine.GET("/config", controller.GetConfig) + engine.GET("/replys", controller.GetReplys) //微信接口 - engine.GET("/micro_program", controller.GetCheckWeixinSign) + engine.GET("/micro_program", middleware.JwtApiMiddleware, controller.GetCheckWeixinSign) }