parent
ebdef3122c
commit
b5975790a9
@ -0,0 +1,52 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/taoshihan1991/imaptool/controller"
|
||||
"github.com/taoshihan1991/imaptool/middleware"
|
||||
)
|
||||
|
||||
func InitApiRouter(engine *gin.Engine){
|
||||
//首页
|
||||
engine.GET("/", controller.Index)
|
||||
engine.POST("/check", controller.LoginCheckPass)
|
||||
engine.POST("/check_auth",middleware.JwtApiMiddleware, controller.MainCheckAuth)
|
||||
//前后聊天
|
||||
engine.GET("/chat_server", controller.NewChatServer)
|
||||
//获取消息
|
||||
engine.GET("/messages", controller.GetVisitorMessage)
|
||||
//发送单条消息
|
||||
engine.POST("/message",controller.SendMessage)
|
||||
//上传文件
|
||||
engine.POST("/uploadimg",controller.UploadImg)
|
||||
//获取未读消息数
|
||||
engine.GET("/message_status",controller.GetVisitorMessage)
|
||||
//设置消息已读
|
||||
engine.POST("/message_status",controller.GetVisitorMessage)
|
||||
|
||||
//获取客服信息
|
||||
engine.GET("/kefuinfo",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.GetKefuInfo)
|
||||
engine.GET("/kefuinfo_setting",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.GetKefuInfoSetting)
|
||||
engine.POST("/kefuinfo",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.PostKefuInfo)
|
||||
engine.DELETE("/kefuinfo",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.DeleteKefuInfo)
|
||||
engine.GET("/kefulist",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.GetKefuList)
|
||||
//角色列表
|
||||
engine.GET("/roles",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.GetRoleList)
|
||||
engine.POST("/role",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.PostRole)
|
||||
//邮件夹列表
|
||||
engine.GET("/folders", controller.GetFolders)
|
||||
|
||||
engine.GET("/mysql",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.MysqlGetConf)
|
||||
engine.POST("/mysql",middleware.JwtApiMiddleware,middleware.RbacAuth, controller.MysqlSetConf)
|
||||
engine.GET("/visitors_online", controller.GetVisitorOnlines)
|
||||
engine.GET("/clear_online_tcp", controller.DeleteOnlineTcp)
|
||||
engine.POST("/visitor",controller.PostVisitor)
|
||||
engine.GET("/visitor",middleware.JwtApiMiddleware, controller.GetVisitor)
|
||||
engine.GET("/visitors",middleware.JwtApiMiddleware, controller.GetVisitors)
|
||||
engine.GET("/statistics",middleware.JwtApiMiddleware, controller.GetStatistics)
|
||||
//前台接口
|
||||
engine.GET("/notice",middleware.SetLanguage, controller.GetNotice)
|
||||
engine.POST("/notice",middleware.JwtApiMiddleware, controller.PostNotice)
|
||||
engine.DELETE("/notice",middleware.JwtApiMiddleware, controller.DelNotice)
|
||||
engine.GET("/notices",middleware.JwtApiMiddleware, controller.GetNotices)
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/taoshihan1991/imaptool/middleware"
|
||||
"github.com/taoshihan1991/imaptool/tmpl"
|
||||
)
|
||||
|
||||
func InitViewRouter(engine *gin.Engine){
|
||||
engine.GET("/index", tmpl.PageIndex)
|
||||
engine.GET("/login", tmpl.PageLogin)
|
||||
engine.GET("/chat_page",middleware.SetLanguage, tmpl.PageChat)
|
||||
engine.GET("/chatIndex",middleware.SetLanguage, tmpl.PageChat)
|
||||
engine.GET("/main",middleware.JwtPageMiddleware,tmpl.PageMain)
|
||||
engine.GET("/chat_main",middleware.JwtPageMiddleware,tmpl.PageChatMain)
|
||||
engine.GET("/setting", tmpl.PageSetting)
|
||||
engine.GET("/setting_mysql", tmpl.PageSettingMysql)
|
||||
engine.GET("/setting_welcome", tmpl.PageSettingWelcome)
|
||||
engine.GET("/setting_deploy", tmpl.PageSettingDeploy)
|
||||
engine.GET("/setting_kefu_list",tmpl.PageKefuList)
|
||||
engine.GET("/mail_list", tmpl.PageMailList)
|
||||
engine.GET("/roles_list", tmpl.PageRoleList)
|
||||
engine.GET("/webjs", tmpl.PageWebJs)
|
||||
engine.GET("/webcss", tmpl.PageWebCss)
|
||||
}
|
Loading…
Reference in new issue