瀏覽代碼

Merge branch 'master' into debug

xyxie 1 年之前
父節點
當前提交
78e7489fa8

+ 1 - 1
controller/auth.go

@@ -1,8 +1,8 @@
 package controller
 
 import (
+	"eta/eta_docs/controller/resp"
 	"github.com/gin-gonic/gin"
-	"hongze/hz_eta_docs_api/controller/resp"
 )
 
 type AuthController struct {

+ 8 - 10
controller/help_doc.go

@@ -2,14 +2,13 @@ package controller
 
 import (
 	"encoding/json"
+	"eta/eta_docs/controller/resp"
+	"eta/eta_docs/global"
+	"eta/eta_docs/models/crm"
+	"eta/eta_docs/models/request"
+	"eta/eta_docs/services"
+	"eta/eta_docs/utils"
 	"github.com/gin-gonic/gin"
-	"github.com/go-playground/validator/v10"
-	"hongze/hz_eta_docs_api/controller/resp"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/models/crm"
-	"hongze/hz_eta_docs_api/models/request"
-	"hongze/hz_eta_docs_api/services"
-	"hongze/hz_eta_docs_api/utils"
 	"html"
 )
 
@@ -43,7 +42,7 @@ func (a *HelpDocController) ClassifyList(c *gin.Context) {
 
 	nodeAll := make([]*crm.HelpDocClassifyItems, 0)
 
-	if etaBusiness != nil{
+	if etaBusiness != nil {
 		// 获取列表数据
 		docOb := new(crm.HelpDocClassify)
 		var pars []interface{}
@@ -101,7 +100,6 @@ func (a *HelpDocController) ClassifyList(c *gin.Context) {
 		}
 	}
 
-
 	resp.OkData("获取成功", nodeAll, c)
 }
 
@@ -179,4 +177,4 @@ func (a *HelpDocController) Detail(c *gin.Context) {
 		respItem.PublishTime = ""
 	}
 	resp.OkData("获取成功", respItem, c)
-}
+}

+ 2 - 2
controller/resp/base.go

@@ -2,10 +2,10 @@ package resp
 
 import (
 	"encoding/json"
+	"eta/eta_docs/global"
+	"eta/eta_docs/utils"
 	"fmt"
 	"github.com/gin-gonic/gin"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/utils"
 	"strings"
 )
 

+ 5 - 6
controller/version_update_log.go

@@ -1,14 +1,13 @@
 package controller
 
 import (
+	"eta/eta_docs/controller/resp"
+	"eta/eta_docs/models/crm"
+	"eta/eta_docs/models/request"
+	"eta/eta_docs/models/response"
+	"eta/eta_docs/utils"
 	"github.com/gin-gonic/gin"
 	"github.com/go-playground/validator/v10"
-	"hongze/hz_eta_docs_api/controller/resp"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/models/crm"
-	"hongze/hz_eta_docs_api/models/request"
-	"hongze/hz_eta_docs_api/models/response"
-	"hongze/hz_eta_docs_api/utils"
 )
 
 // VersionUpdateLogController 版本更新日志

+ 4 - 4
core/log.go

@@ -1,13 +1,13 @@
 package core
 
 import (
+	"eta/eta_docs/config"
+	"eta/eta_docs/global"
+	"eta/eta_docs/utils"
 	"fmt"
 	"github.com/gin-gonic/gin"
 	rotatelogs "github.com/lestrrat-go/file-rotatelogs"
 	oplogging "github.com/op/go-logging"
-	"hongze/hz_eta_docs_api/config"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/utils"
 	"io"
 	"os"
 	"strings"
@@ -15,7 +15,7 @@ import (
 )
 
 const (
-	Module = "hz_eta_docs_api"
+	Module = "eta_docs"
 )
 
 var (

+ 2 - 2
core/run_server.go

@@ -1,9 +1,9 @@
 package core
 
 import (
+	"eta/eta_docs/global"
+	"eta/eta_docs/init_serve"
 	"fmt"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/init_serve"
 )
 
 func RunServe() {

+ 2 - 2
global/global.go

@@ -1,14 +1,14 @@
 package global
 
 import (
+	"eta/eta_docs/config"
+	"eta/eta_docs/utils"
 	"fmt"
 	"github.com/fsnotify/fsnotify"
 	"github.com/go-redis/redis/v8"
 	oplogging "github.com/op/go-logging"
 	"github.com/spf13/viper"
 	"gorm.io/gorm"
-	"hongze/hz_eta_docs_api/config"
-	"hongze/hz_eta_docs_api/utils"
 	"io"
 
 	"github.com/rdlucklib/rdluck_tools/cache"

+ 1 - 1
go.mod

@@ -1,4 +1,4 @@
-module hongze/hz_eta_docs_api
+module eta/eta_docs
 
 go 1.19
 

+ 1 - 1
init_serve/mysql.go

@@ -1,11 +1,11 @@
 package init_serve
 
 import (
+	"eta/eta_docs/global"
 	"fmt"
 	"gorm.io/driver/mysql"
 	"gorm.io/gorm"
 	"gorm.io/gorm/logger"
-	"hongze/hz_eta_docs_api/global"
 	"io"
 	"log"
 	"os"

+ 1 - 1
init_serve/redis.go

@@ -2,9 +2,9 @@ package init_serve
 
 import (
 	"context"
+	"eta/eta_docs/global"
 	"fmt"
 	"github.com/go-redis/redis/v8"
-	"hongze/hz_eta_docs_api/global"
 
 	"github.com/rdlucklib/rdluck_tools/cache"
 )

+ 4 - 4
init_serve/router.go

@@ -1,11 +1,11 @@
 package init_serve
 
 import (
+	_ "eta/eta_docs/docs"
+	"eta/eta_docs/global"
+	"eta/eta_docs/middleware"
+	"eta/eta_docs/routers"
 	"github.com/gin-gonic/gin"
-	_ "hongze/hz_eta_docs_api/docs"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/middleware"
-	"hongze/hz_eta_docs_api/routers"
 )
 
 // InitRouter 初始化路由

+ 1 - 1
main.go

@@ -1,8 +1,8 @@
 package main
 
 import (
+	"eta/eta_docs/core"
 	"fmt"
-	"hongze/hz_eta_docs_api/core"
 	"os"
 	"path/filepath"
 	"strings"

+ 4 - 4
middleware/recover.go

@@ -1,12 +1,12 @@
 package middleware
 
 import (
+	"eta/eta_docs/controller/resp"
+	"eta/eta_docs/global"
+	"eta/eta_docs/services/alarm_msg"
+	"eta/eta_docs/utils"
 	"fmt"
 	"github.com/gin-gonic/gin"
-	"hongze/hz_eta_docs_api/controller/resp"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/services/alarm_msg"
-	"hongze/hz_eta_docs_api/utils"
 	"net/http"
 	"runtime"
 	"time"

+ 1 - 1
middleware/token.go

@@ -1,9 +1,9 @@
 package middleware
 
 import (
+	"eta/eta_docs/controller/resp"
 	"fmt"
 	"github.com/gin-gonic/gin"
-	"hongze/hz_eta_docs_api/controller/resp"
 )
 
 func Token() gin.HandlerFunc {

+ 2 - 3
models/crm/eta_business.go

@@ -1,7 +1,7 @@
 package crm
 
 import (
-	"hongze/hz_eta_docs_api/global"
+	"eta/eta_docs/global"
 	"time"
 )
 
@@ -32,7 +32,6 @@ type EtaBusiness struct {
 	ModifyTime       time.Time `gorm:"column:modify_time" json:"modify_time"`                          // 更新时间
 }
 
-
 func (m *EtaBusiness) TableName() string {
 	return "`eta_business`"
 }
@@ -44,4 +43,4 @@ func (m *EtaBusiness) GetItemByCondition(condition string, pars []interface{}, o
 	}
 	err = global.MYSQL["hz_crm"].Where(condition, pars...).Order(orderRule).Limit(1).Find(&item).Error
 	return
-}
+}

+ 1 - 1
models/crm/eta_version_update_log.go

@@ -1,7 +1,7 @@
 package crm
 
 import (
-	"hongze/hz_eta_docs_api/global"
+	"eta/eta_docs/global"
 	"time"
 )
 

+ 1 - 1
models/crm/help_doc.go

@@ -1,7 +1,7 @@
 package crm
 
 import (
-	"hongze/hz_eta_docs_api/global"
+	"eta/eta_docs/global"
 	"time"
 )
 

+ 1 - 1
models/crm/help_doc_classify.go

@@ -1,6 +1,6 @@
 package crm
 
-import "hongze/hz_eta_docs_api/global"
+import "eta/eta_docs/global"
 
 type HelpDocClassify struct {
 	ClassifyId         int    `gorm:"column:classify_id;primary_key;AUTO_INCREMENT" json:"classify_id"`

+ 1 - 1
routers/auth.go

@@ -1,8 +1,8 @@
 package routers
 
 import (
+	"eta/eta_docs/controller"
 	"github.com/gin-gonic/gin"
-	"hongze/hz_eta_docs_api/controller"
 )
 
 func InitAuth(baseGroup *gin.RouterGroup) {

+ 1 - 2
routers/help_doc.go

@@ -1,8 +1,8 @@
 package routers
 
 import (
+	"eta/eta_docs/controller"
 	"github.com/gin-gonic/gin"
-	"hongze/hz_eta_docs_api/controller"
 )
 
 func InitHelpDoc(r *gin.RouterGroup) {
@@ -11,4 +11,3 @@ func InitHelpDoc(r *gin.RouterGroup) {
 	authGroup.GET("classify/list", c.ClassifyList)
 	authGroup.GET("detail", c.Detail)
 }
-

+ 1 - 1
routers/version_update_log.go

@@ -1,8 +1,8 @@
 package routers
 
 import (
+	"eta/eta_docs/controller"
 	"github.com/gin-gonic/gin"
-	"hongze/hz_eta_docs_api/controller"
 )
 
 func InitVersionUpdateLog(r *gin.RouterGroup) {

+ 2 - 2
services/alarm_msg/alarm_msg.go

@@ -2,9 +2,9 @@ package alarm_msg
 
 import (
 	"encoding/json"
+	"eta/eta_docs/global"
+	"eta/eta_docs/utils"
 	"github.com/rdlucklib/rdluck_tools/http"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/utils"
 )
 
 var (

+ 1 - 1
services/help_doc_classify.go

@@ -1,6 +1,6 @@
 package services
 
-import "hongze/hz_eta_docs_api/models/crm"
+import "eta/eta_docs/models/crm"
 
 func helpDocClassifyHaveChild(allNode []*crm.HelpDocClassifyItems, node *crm.HelpDocClassifyItems) (childs []*crm.HelpDocClassifyItems, yes bool) {
 	for _, v := range allNode {

+ 3 - 3
task/task.go

@@ -1,10 +1,10 @@
 package task
 
 import (
+	"eta/eta_docs/global"
+	"eta/eta_docs/services/alarm_msg"
+	"eta/eta_docs/utils"
 	"fmt"
-	"hongze/hz_eta_docs_api/global"
-	"hongze/hz_eta_docs_api/services/alarm_msg"
-	"hongze/hz_eta_docs_api/utils"
 	"os"
 	"runtime"
 	"sync"

+ 5 - 5
utils/des3.go

@@ -1,4 +1,4 @@
-//加密工具类,用了3des和base64
+// 加密工具类,用了3des和base64
 package utils
 
 import (
@@ -12,10 +12,10 @@ import (
 )
 
 const (
-	key = ""
+	key = "Y2kBxILL6jTkc80N860qbHc6"
 )
 
-//des3 + base64 encrypt
+// des3 + base64 encrypt
 func DesBase64Encrypt(origData []byte) []byte {
 	result, err := TripleDesEncrypt(origData, []byte(key))
 	if err != nil {
@@ -94,7 +94,7 @@ func PKCS5UnPadding(origData []byte) []byte {
 	return origData[:(length - unpadding)]
 }
 
-//DES加密
+// DES加密
 func DesEncrypt(content string, key string) string {
 	contents := []byte(content)
 	keys := []byte(key)
@@ -121,7 +121,7 @@ func byteToHexString(bytes []byte) string {
 	return str
 }
 
-//DES解密
+// DES解密
 func DesDecrypt(content string, key string) string {
 	contentBytes, err := hex.DecodeString(content)
 	if err != nil {