From c68a58efdb7d3a5b99ba2780d075cdf08e7b327c Mon Sep 17 00:00:00 2001 From: taoshihan Date: Fri, 1 Aug 2025 22:44:00 +0800 Subject: [PATCH] fix module name --- cmd/install.go | 4 +- cmd/server.go | 8 +-- common/config.go | 2 +- controller/about.go | 2 +- controller/chart.go | 4 +- controller/index.go | 2 +- controller/ip.go | 4 +- controller/kefu.go | 6 +- controller/login.go | 4 +- controller/main.go | 8 +-- controller/message.go | 8 +-- controller/notice.go | 2 +- controller/reply.go | 2 +- controller/role.go | 2 +- controller/setting.go | 2 +- controller/shout.go | 6 +- controller/visitor.go | 8 +-- controller/weixin.go | 2 +- go.mod | 3 +- go.sum | 4 -- gofly.go | 2 +- middleware/ipblack.go | 2 +- middleware/jwt.go | 2 +- middleware/logger.go | 2 +- models/models.go | 2 +- router/api.go | 6 +- router/view.go | 4 +- static/templates/index.html | 138 ------------------------------------ tmpl/common.go | 12 ++-- tmpl/detail.go | 2 +- tmpl/login.go | 9 +-- ws/user.go | 4 +- ws/visitor.go | 4 +- ws/ws.go | 8 +-- 34 files changed, 69 insertions(+), 211 deletions(-) diff --git a/cmd/install.go b/cmd/install.go index 89846c6..d48da4e 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -2,8 +2,8 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/models" + "goflylivechat/tools" "log" "os" "strings" diff --git a/cmd/server.go b/cmd/server.go index ace384a..4d2cd42 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/gin-gonic/gin" "github.com/spf13/cobra" - "github.com/taoshihan1991/imaptool/middleware" - "github.com/taoshihan1991/imaptool/router" - "github.com/taoshihan1991/imaptool/tools" - "github.com/taoshihan1991/imaptool/ws" "github.com/zh-five/xdaemon" + "goflylivechat/middleware" + "goflylivechat/router" + "goflylivechat/tools" + "goflylivechat/ws" "log" "os" ) diff --git a/common/config.go b/common/config.go index 36f9573..2e75ea7 100644 --- a/common/config.go +++ b/common/config.go @@ -2,7 +2,7 @@ package common import ( "encoding/json" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/tools" "io/ioutil" ) diff --git a/controller/about.go b/controller/about.go index 4345ba3..ab534ea 100644 --- a/controller/about.go +++ b/controller/about.go @@ -2,7 +2,7 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" ) func GetAbout(c *gin.Context) { diff --git a/controller/chart.go b/controller/chart.go index c663835..fc942be 100644 --- a/controller/chart.go +++ b/controller/chart.go @@ -2,8 +2,8 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/models" + "goflylivechat/tools" "time" ) diff --git a/controller/index.go b/controller/index.go index 9e44038..f97f940 100644 --- a/controller/index.go +++ b/controller/index.go @@ -2,7 +2,7 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" ) func Index(c *gin.Context) { diff --git a/controller/ip.go b/controller/ip.go index 979cd07..03e4439 100644 --- a/controller/ip.go +++ b/controller/ip.go @@ -2,8 +2,8 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/common" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/common" + "goflylivechat/models" "strconv" ) diff --git a/controller/kefu.go b/controller/kefu.go index 83c8a4a..6e02d38 100644 --- a/controller/kefu.go +++ b/controller/kefu.go @@ -2,9 +2,9 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" - "github.com/taoshihan1991/imaptool/ws" + "goflylivechat/models" + "goflylivechat/tools" + "goflylivechat/ws" "net/http" ) diff --git a/controller/login.go b/controller/login.go index 79cedd3..a7774d0 100644 --- a/controller/login.go +++ b/controller/login.go @@ -2,8 +2,8 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/models" + "goflylivechat/tools" "time" ) diff --git a/controller/main.go b/controller/main.go index c81f1e5..99932ca 100644 --- a/controller/main.go +++ b/controller/main.go @@ -5,10 +5,10 @@ import ( "fmt" "github.com/gin-gonic/gin" "github.com/jinzhu/gorm" - "github.com/taoshihan1991/imaptool/common" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" - "github.com/taoshihan1991/imaptool/ws" + "goflylivechat/common" + "goflylivechat/models" + "goflylivechat/tools" + "goflylivechat/ws" "io/ioutil" "log" "os" diff --git a/controller/message.go b/controller/message.go index 24b3491..ecc4d07 100644 --- a/controller/message.go +++ b/controller/message.go @@ -5,10 +5,10 @@ import ( "fmt" "github.com/gin-gonic/gin" "github.com/gorilla/websocket" - "github.com/taoshihan1991/imaptool/common" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" - "github.com/taoshihan1991/imaptool/ws" + "goflylivechat/common" + "goflylivechat/models" + "goflylivechat/tools" + "goflylivechat/ws" "os" "path" "strconv" diff --git a/controller/notice.go b/controller/notice.go index 25b847b..a645b1c 100644 --- a/controller/notice.go +++ b/controller/notice.go @@ -2,7 +2,7 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" ) func GetNotice(c *gin.Context) { diff --git a/controller/reply.go b/controller/reply.go index 2bb2f23..4ec8857 100644 --- a/controller/reply.go +++ b/controller/reply.go @@ -2,7 +2,7 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" "log" ) diff --git a/controller/role.go b/controller/role.go index 23ff565..bb322f7 100644 --- a/controller/role.go +++ b/controller/role.go @@ -2,7 +2,7 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" ) func GetRoleList(c *gin.Context) { diff --git a/controller/setting.go b/controller/setting.go index 37fcd18..9e4dbcd 100644 --- a/controller/setting.go +++ b/controller/setting.go @@ -2,7 +2,7 @@ package controller import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" ) func GetConfigs(c *gin.Context) { diff --git a/controller/shout.go b/controller/shout.go index ec86cc0..0bf73d1 100644 --- a/controller/shout.go +++ b/controller/shout.go @@ -3,9 +3,9 @@ package controller import ( "encoding/json" "fmt" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" - "github.com/taoshihan1991/imaptool/ws" + "goflylivechat/models" + "goflylivechat/tools" + "goflylivechat/ws" "log" "strconv" "time" diff --git a/controller/visitor.go b/controller/visitor.go index 766e565..3cf83f6 100644 --- a/controller/visitor.go +++ b/controller/visitor.go @@ -3,10 +3,10 @@ package controller import ( "encoding/json" "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/common" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" - "github.com/taoshihan1991/imaptool/ws" + "goflylivechat/common" + "goflylivechat/models" + "goflylivechat/tools" + "goflylivechat/ws" "strconv" ) diff --git a/controller/weixin.go b/controller/weixin.go index 4c1ef03..747e7f2 100644 --- a/controller/weixin.go +++ b/controller/weixin.go @@ -4,7 +4,7 @@ import ( "crypto/sha1" "encoding/hex" "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" "log" "sort" ) diff --git a/go.mod b/go.mod index c8c2232..120d475 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/taoshihan1991/imaptool +module goflylivechat go 1.16 @@ -6,7 +6,6 @@ require ( github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 github.com/emersion/go-smtp v0.13.0 - github.com/gin-contrib/pprof v1.3.0 github.com/gin-contrib/sessions v0.0.3 github.com/gin-gonic/gin v1.7.7 github.com/go-sql-driver/mysql v1.5.0 diff --git a/go.sum b/go.sum index 1ff9396..6793666 100644 --- a/go.sum +++ b/go.sum @@ -23,14 +23,11 @@ github.com/emersion/go-smtp v0.13.0/go.mod h1:qm27SGYgoIPRot6ubfQ/GpiPy/g3PaZAVR github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gin-contrib/pprof v1.3.0 h1:G9eK6HnbkSqDZBYbzG4wrjCsA4e+cvYAHUZw6W+W9K0= -github.com/gin-contrib/pprof v1.3.0/go.mod h1:waMjT1H9b179t3CxuG1cV3DHpga6ybizwfBaM5OXaB0= github.com/gin-contrib/sessions v0.0.3 h1:PoBXki+44XdJdlgDqDrY5nDVe3Wk7wDV/UCOuLP6fBI= github.com/gin-contrib/sessions v0.0.3/go.mod h1:8C/J6cad3Il1mWYYgtw0w+hqasmpvy25mPkXdOgeB9I= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gin-gonic/gin v1.6.2/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= @@ -42,7 +39,6 @@ github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTM github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= diff --git a/gofly.go b/gofly.go index af2abc2..b09e7a1 100644 --- a/gofly.go +++ b/gofly.go @@ -1,7 +1,7 @@ package main import ( - "github.com/taoshihan1991/imaptool/cmd" + "goflylivechat/cmd" ) func main() { diff --git a/middleware/ipblack.go b/middleware/ipblack.go index 2c1a4ab..c830a66 100644 --- a/middleware/ipblack.go +++ b/middleware/ipblack.go @@ -2,7 +2,7 @@ package middleware import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" ) func Ipblack(c *gin.Context) { diff --git a/middleware/jwt.go b/middleware/jwt.go index 96a0c73..a210b54 100644 --- a/middleware/jwt.go +++ b/middleware/jwt.go @@ -2,7 +2,7 @@ package middleware import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/tools" "time" ) diff --git a/middleware/logger.go b/middleware/logger.go index 0d139e9..fa472cb 100644 --- a/middleware/logger.go +++ b/middleware/logger.go @@ -2,7 +2,7 @@ package middleware import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/tools" "time" ) diff --git a/models/models.go b/models/models.go index 9ea75a0..e29ce90 100644 --- a/models/models.go +++ b/models/models.go @@ -3,7 +3,7 @@ package models import ( "fmt" "github.com/jinzhu/gorm" - "github.com/taoshihan1991/imaptool/common" + "goflylivechat/common" "log" "time" ) diff --git a/router/api.go b/router/api.go index 86cad40..36ba4cc 100644 --- a/router/api.go +++ b/router/api.go @@ -2,9 +2,9 @@ package router import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/controller" - "github.com/taoshihan1991/imaptool/middleware" - "github.com/taoshihan1991/imaptool/ws" + "goflylivechat/controller" + "goflylivechat/middleware" + "goflylivechat/ws" ) func InitApiRouter(engine *gin.Engine) { diff --git a/router/view.go b/router/view.go index d73b16e..c7628e5 100644 --- a/router/view.go +++ b/router/view.go @@ -2,8 +2,8 @@ package router import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/middleware" - "github.com/taoshihan1991/imaptool/tmpl" + "goflylivechat/middleware" + "goflylivechat/tmpl" ) func InitViewRouter(engine *gin.Engine) { diff --git a/static/templates/index.html b/static/templates/index.html index 7c53ec7..e69de29 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -1,138 +0,0 @@ - - - - - - - 独立私有化智能在线客服系统 - - - -
-

开源在线客服系统

-

郑重提示

-

禁止将本项目用于含病毒、木马、色情、赌博、诈骗、违禁用品、假冒产品、虚假信息、数字货币、金融等违法违规业务

-

当前项目仅供个人学习测试,禁止一切线上商用行为,禁止一切违法使用!!!

-

项目简介

-

Golang语言开源客服系统,主要使用了gin + jwt-go + websocket + go.uuid + gorm + cobra + VueJS + ElementUI + MySQL等技术

-

安装使用

- - - -

程序正常运行后,监听端口8081,可以直接ip+端口8081访问

-

也可以配置域名访问,反向代理到8081端口,就能隐藏端口号

- -

客服对接

-

聊天链接

-

http://127.0.0.1:8081/chatIndex?kefu_id=kefu2

-

弹窗使用

-
    (function(a, b, c, d) {
-        let h = b.getElementsByTagName('head')[0];let s = b.createElement('script');
-        s.type = 'text/javascript';s.src = c+"/static/js/kefu-front.js";s.onload = s.onreadystatechange = function () {
-            if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") d(c);
-        };h.appendChild(s);
-    })(window, document,"http://127.0.0.1:8081",function(u){
-        KEFU.init({
-            KEFU_URL:u,
-            KEFU_KEFU_ID: "kefu2",
-        })
-    });
-
- - -

版权声明

-

当前项目是完整功能代码 , 但是仍然仅支持个人演示测试 , 不包含线上使用 ,禁止一切商用行为。 - 使用本软件时,请遵守当地法律法规,任何违法用途一切后果请自行承担.

- - -
- - - \ No newline at end of file diff --git a/tmpl/common.go b/tmpl/common.go index be7a35b..8057109 100644 --- a/tmpl/common.go +++ b/tmpl/common.go @@ -2,7 +2,7 @@ package tmpl import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/tools" "html/template" "net/http" ) @@ -41,7 +41,7 @@ func (obj *CommonHtml) Display(file string, data interface{}) { t.Execute(obj.Rw, data) } -//首页 +// 首页 func PageIndex(c *gin.Context) { if c.Request.RequestURI == "/favicon.ico" { return @@ -52,7 +52,7 @@ func PageIndex(c *gin.Context) { c.HTML(http.StatusOK, "index.html", gin.H{}) } -//登陆界面 +// 登陆界面 func PageMain(c *gin.Context) { nav := tools.FileGetContent("html/nav.html") c.HTML(http.StatusOK, "main.html", gin.H{ @@ -60,12 +60,12 @@ func PageMain(c *gin.Context) { }) } -//客服界面 +// 客服界面 func PageChatMain(c *gin.Context) { c.HTML(http.StatusOK, "chat_main.html", nil) } -//安装界面 +// 安装界面 func PageInstall(c *gin.Context) { if noExist, _ := tools.IsFileNotExist("./install.lock"); !noExist { c.Redirect(302, "/login") @@ -73,7 +73,7 @@ func PageInstall(c *gin.Context) { c.HTML(http.StatusOK, "install.html", nil) } -//面板界面 +// 面板界面 func PagePannel(c *gin.Context) { c.HTML(http.StatusOK, "pannel.html", nil) } diff --git a/tmpl/detail.go b/tmpl/detail.go index 1589779..a4a0ee8 100644 --- a/tmpl/detail.go +++ b/tmpl/detail.go @@ -2,7 +2,7 @@ package tmpl import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/models" "html" "html/template" "net/http" diff --git a/tmpl/login.go b/tmpl/login.go index 4099a99..355952c 100644 --- a/tmpl/login.go +++ b/tmpl/login.go @@ -2,18 +2,19 @@ package tmpl import ( "github.com/gin-gonic/gin" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/tools" "net/http" ) -//登陆界面 +// 登陆界面 func PageLogin(c *gin.Context) { if noExist, _ := tools.IsFileNotExist("./install.lock"); noExist { c.Redirect(302, "/install") } c.HTML(http.StatusOK, "login.html", nil) } -//绑定界面 + +// 绑定界面 func PageBind(c *gin.Context) { c.HTML(http.StatusOK, "bind.html", gin.H{}) -} \ No newline at end of file +} diff --git a/ws/user.go b/ws/user.go index 50dd8a5..37e1c9a 100644 --- a/ws/user.go +++ b/ws/user.go @@ -4,8 +4,8 @@ import ( "encoding/json" "github.com/gin-gonic/gin" "github.com/gorilla/websocket" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/models" + "goflylivechat/tools" "log" "time" ) diff --git a/ws/visitor.go b/ws/visitor.go index 0557e32..2cc3d6e 100644 --- a/ws/visitor.go +++ b/ws/visitor.go @@ -4,8 +4,8 @@ import ( "encoding/json" "github.com/gin-gonic/gin" "github.com/gorilla/websocket" - "github.com/taoshihan1991/imaptool/common" - "github.com/taoshihan1991/imaptool/models" + "goflylivechat/common" + "goflylivechat/models" "log" "time" ) diff --git a/ws/ws.go b/ws/ws.go index df91a51..e207e57 100644 --- a/ws/ws.go +++ b/ws/ws.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/gin-gonic/gin" "github.com/gorilla/websocket" - "github.com/taoshihan1991/imaptool/models" - "github.com/taoshihan1991/imaptool/tools" + "goflylivechat/models" + "goflylivechat/tools" "log" "net/http" "strconv" @@ -85,7 +85,7 @@ func SendFlyServerJiang(title string, content string, domain string) string { return "" } -//定时给更新数据库状态 +// 定时给更新数据库状态 func UpdateVisitorStatusCron() { for { visitors := models.FindVisitorsOnline() @@ -103,7 +103,7 @@ func UpdateVisitorStatusCron() { } } -//后端广播发送消息 +// 后端广播发送消息 func WsServerBackend() { for { message := <-message