Sfoglia il codice sorgente

修改项目目录结构

hongze 1 mese fa
parent
commit
c526d31b87

+ 3 - 4
controllers/base_auth.go

@@ -2,9 +2,9 @@ package controllers
 
 import (
 	"encoding/json"
-	"eta/eta_report/models"
-	"eta/eta_report/services"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"github.com/beego/beego/v2/server/web"
 	"net/http"
@@ -98,7 +98,6 @@ func (c *BaseAuthController) JSON(data interface{}, hasIndent bool, coding bool)
 	return c.Ctx.Output.Body(content)
 }
 
-
 func (c *BaseAuthController) ServeJSONNoEncryption(encoding ...bool) {
 	var (
 		hasIndent   = false

+ 3 - 3
controllers/base_common.go

@@ -2,9 +2,9 @@ package controllers
 
 import (
 	"encoding/json"
-	"eta/eta_report/models"
-	"eta/eta_report/services"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services"
+	"eta_gn/eta_report/utils"
 	"github.com/beego/beego/v2/server/web"
 	"net/http"
 	"net/url"

+ 5 - 6
controllers/chart.go

@@ -2,9 +2,9 @@ package controllers
 
 import (
 	"encoding/json"
-	"eta/eta_report/models"
-	"eta/eta_report/services"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"io/ioutil"
 	"net/http"
@@ -15,13 +15,12 @@ type ChartController struct {
 	BaseAuthController
 }
 
-
 // ExcelDetail
 // @Title 表格详情
 // @Description 表格详情
 // @Success 200 {object} models.EnglishReportShareDetailResp
 // @router /detail [post]
-func (this *ChartController) ChartDetail()  {
+func (this *ChartController) ChartDetail() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
 		if br.ErrMsg == "" {
@@ -43,7 +42,7 @@ func (this *ChartController) ChartDetail()  {
 		br.ErrMsg = "参数不能为空!"
 		return
 	}
-	url := utils.ChartLibUrl+`/chart/common/detail?UniqueCode=%s`
+	url := utils.ChartLibUrl + `/chart/common/detail?UniqueCode=%s`
 	url = fmt.Sprintf(url, req.UniqueCode)
 
 	resp, e := http.Get(url)

+ 3 - 3
controllers/english_report.go

@@ -2,9 +2,9 @@ package controllers
 
 import (
 	"errors"
-	"eta/eta_report/models"
-	"eta/eta_report/services/alarm_msg"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services/alarm_msg"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"html"
 	"time"

+ 1 - 1
controllers/error.go

@@ -1,6 +1,6 @@
 package controllers
 
-import "eta/eta_report/models"
+import "eta_gn/eta_report/models"
 
 // ErrorController
 // @Description: 该控制器处理页面错误请求

+ 5 - 5
controllers/excel.go

@@ -2,9 +2,9 @@ package controllers
 
 import (
 	"encoding/json"
-	"eta/eta_report/models"
-	"eta/eta_report/services"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"io/ioutil"
 	"net/http"
@@ -20,7 +20,7 @@ type ExcelController struct {
 // @Description 表格详情
 // @Success 200 {object} models.EnglishReportShareDetailResp
 // @router /detail [post]
-func (this *ExcelController) ExcelDetail()  {
+func (this *ExcelController) ExcelDetail() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
 		if br.ErrMsg == "" {
@@ -37,7 +37,7 @@ func (this *ExcelController) ExcelDetail()  {
 		br.ErrMsg = "参数解析失败,Err:" + err.Error()
 		return
 	}
-	url := fmt.Sprintf(utils.ChartLibUrl+`/excel_info/detail?UniqueCode=%s&FromScene=%d`, req.UniqueCode,req.FromScene )
+	url := fmt.Sprintf(utils.ChartLibUrl+`/excel_info/detail?UniqueCode=%s&FromScene=%d`, req.UniqueCode, req.FromScene)
 
 	resp, e := http.Get(url)
 	if e != nil {

+ 1 - 1
controllers/report_share.go

@@ -1,7 +1,7 @@
 package controllers
 
 import (
-	"eta/eta_report/models"
+	"eta_gn/eta_report/models"
 	"html"
 )
 

+ 2 - 2
controllers/smart_report.go

@@ -1,8 +1,8 @@
 package controllers
 
 import (
-	"eta/eta_report/models"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"strconv"
 	"strings"

+ 4 - 4
controllers/wechat.go

@@ -1,10 +1,10 @@
 package controllers
 
 import (
-	"eta/eta_report/models"
-	"eta/eta_report/services"
-	"eta/eta_report/services/wechat"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services"
+	"eta_gn/eta_report/services/wechat"
+	"eta_gn/eta_report/utils"
 	"fmt"
 )
 

+ 1 - 1
go.mod

@@ -1,4 +1,4 @@
-module eta/eta_report
+module eta_gn/eta_report
 
 go 1.21.7
 

+ 3 - 3
main.go

@@ -1,9 +1,9 @@
 package main
 
 import (
-	"eta/eta_report/controllers"
-	_ "eta/eta_report/routers"
-	"eta/eta_report/services"
+	"eta_gn/eta_report/controllers"
+	_ "eta_gn/eta_report/routers"
+	"eta_gn/eta_report/services"
 
 	"github.com/beego/beego/v2/server/web"
 )

+ 1 - 1
models/db.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 	_ "github.com/go-sql-driver/mysql"
 	"time"
 

+ 1 - 1
models/report_chapter_type.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 	"github.com/beego/beego/v2/client/orm"
 	"time"
 )

+ 1 - 1
models/response/excel_info.go

@@ -1,7 +1,7 @@
 package response
 
 import (
-	"eta/eta_report/services/excel"
+	"eta_gn/eta_report/services/excel"
 )
 
 // ExcelTableDetailResp  excel表格详情

+ 1 - 1
models/smart_report.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"github.com/beego/beego/v2/client/orm"
 	"html"

+ 1 - 1
models/wechat.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"encoding/json"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"github.com/rdlucklib/rdluck_tools/http"
 )

+ 63 - 63
routers/commentsRouter.go

@@ -7,76 +7,76 @@ import (
 
 func init() {
 
-    beego.GlobalControllerRouter["eta/eta_report/controllers:ChartController"] = append(beego.GlobalControllerRouter["eta/eta_report/controllers:ChartController"],
-        beego.ControllerComments{
-            Method: "ChartDetail",
-            Router: `/detail`,
-            AllowHTTPMethods: []string{"post"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
+	beego.GlobalControllerRouter["eta_gn/eta_report/controllers:ChartController"] = append(beego.GlobalControllerRouter["eta_gn/eta_report/controllers:ChartController"],
+		beego.ControllerComments{
+			Method:           "ChartDetail",
+			Router:           `/detail`,
+			AllowHTTPMethods: []string{"post"},
+			MethodParams:     param.Make(),
+			Filters:          nil,
+			Params:           nil})
 
-    beego.GlobalControllerRouter["eta/eta_report/controllers:EnglishReportShareController"] = append(beego.GlobalControllerRouter["eta/eta_report/controllers:EnglishReportShareController"],
-        beego.ControllerComments{
-            Method: "EnglishReportDetail",
-            Router: `/share/detail`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
+	beego.GlobalControllerRouter["eta_gn/eta_report/controllers:EnglishReportShareController"] = append(beego.GlobalControllerRouter["eta_gn/eta_report/controllers:EnglishReportShareController"],
+		beego.ControllerComments{
+			Method:           "EnglishReportDetail",
+			Router:           `/share/detail`,
+			AllowHTTPMethods: []string{"get"},
+			MethodParams:     param.Make(),
+			Filters:          nil,
+			Params:           nil})
 
-    beego.GlobalControllerRouter["eta/eta_report/controllers:EnglishReportShareController"] = append(beego.GlobalControllerRouter["eta/eta_report/controllers:EnglishReportShareController"],
-        beego.ControllerComments{
-            Method: "TrialEnglishReportDetail",
-            Router: `/trial/share/detail`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
+	beego.GlobalControllerRouter["eta_gn/eta_report/controllers:EnglishReportShareController"] = append(beego.GlobalControllerRouter["eta_gn/eta_report/controllers:EnglishReportShareController"],
+		beego.ControllerComments{
+			Method:           "TrialEnglishReportDetail",
+			Router:           `/trial/share/detail`,
+			AllowHTTPMethods: []string{"get"},
+			MethodParams:     param.Make(),
+			Filters:          nil,
+			Params:           nil})
 
-    beego.GlobalControllerRouter["eta/eta_report/controllers:ExcelController"] = append(beego.GlobalControllerRouter["eta/eta_report/controllers:ExcelController"],
-        beego.ControllerComments{
-            Method: "ExcelDetail",
-            Router: `/detail`,
-            AllowHTTPMethods: []string{"post"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
+	beego.GlobalControllerRouter["eta_gn/eta_report/controllers:ExcelController"] = append(beego.GlobalControllerRouter["eta_gn/eta_report/controllers:ExcelController"],
+		beego.ControllerComments{
+			Method:           "ExcelDetail",
+			Router:           `/detail`,
+			AllowHTTPMethods: []string{"post"},
+			MethodParams:     param.Make(),
+			Filters:          nil,
+			Params:           nil})
 
-    beego.GlobalControllerRouter["eta/eta_report/controllers:ReportShareController"] = append(beego.GlobalControllerRouter["eta/eta_report/controllers:ReportShareController"],
-        beego.ControllerComments{
-            Method: "Detail",
-            Router: `/share/detail`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
+	beego.GlobalControllerRouter["eta_gn/eta_report/controllers:ReportShareController"] = append(beego.GlobalControllerRouter["eta_gn/eta_report/controllers:ReportShareController"],
+		beego.ControllerComments{
+			Method:           "Detail",
+			Router:           `/share/detail`,
+			AllowHTTPMethods: []string{"get"},
+			MethodParams:     param.Make(),
+			Filters:          nil,
+			Params:           nil})
 
-    beego.GlobalControllerRouter["eta/eta_report/controllers:SmartReportController"] = append(beego.GlobalControllerRouter["eta/eta_report/controllers:SmartReportController"],
-        beego.ControllerComments{
-            Method: "Detail",
-            Router: `/share/detail`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
+	beego.GlobalControllerRouter["eta_gn/eta_report/controllers:SmartReportController"] = append(beego.GlobalControllerRouter["eta_gn/eta_report/controllers:SmartReportController"],
+		beego.ControllerComments{
+			Method:           "Detail",
+			Router:           `/share/detail`,
+			AllowHTTPMethods: []string{"get"},
+			MethodParams:     param.Make(),
+			Filters:          nil,
+			Params:           nil})
 
-    beego.GlobalControllerRouter["eta/eta_report/controllers:SmartReportController"] = append(beego.GlobalControllerRouter["eta/eta_report/controllers:SmartReportController"],
-        beego.ControllerComments{
-            Method: "WechatShareDetail",
-            Router: `/wechat_share/detail`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
-            Params: nil})
+	beego.GlobalControllerRouter["eta_gn/eta_report/controllers:SmartReportController"] = append(beego.GlobalControllerRouter["eta_gn/eta_report/controllers:SmartReportController"],
+		beego.ControllerComments{
+			Method:           "WechatShareDetail",
+			Router:           `/wechat_share/detail`,
+			AllowHTTPMethods: []string{"get"},
+			MethodParams:     param.Make(),
+			Filters:          nil,
+			Params:           nil})
 
-    beego.GlobalControllerRouter["eta/eta_report/controllers:WechatCommonController"] = append(beego.GlobalControllerRouter["eta/eta_report/controllers:WechatCommonController"],
-        beego.ControllerComments{
-            Method: "GetWxSign",
-            Router: `/open/getWxSign`,
-            AllowHTTPMethods: []string{"get"},
-            MethodParams: param.Make(),
-            Filters: nil,
+	beego.GlobalControllerRouter["eta_gn/eta_report/controllers:WechatCommonController"] = append(beego.GlobalControllerRouter["eta_gn/eta_report/controllers:WechatCommonController"],
+		beego.ControllerComments{
+			Method:           "GetWxSign",
+			Router:           `/open/getWxSign`,
+			AllowHTTPMethods: []string{"get"},
+			MethodParams:     param.Make(),
+			Filters: nil,
             Params: nil})
 
 }

+ 1 - 1
routers/router.go

@@ -8,7 +8,7 @@
 package routers
 
 import (
-	"eta/eta_report/controllers"
+	"eta_gn/eta_report/controllers"
 	"github.com/beego/beego/v2/server/web"
 )
 

+ 1 - 1
services/alarm_msg/alarm_msg.go

@@ -2,7 +2,7 @@ package alarm_msg
 
 import (
 	"encoding/json"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 	"github.com/rdlucklib/rdluck_tools/http"
 )
 

+ 1 - 1
services/aws_s3.go

@@ -3,7 +3,7 @@ package services
 import (
 	"bytes"
 	"crypto/tls"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"github.com/aws/aws-sdk-go/aws"
 	"github.com/aws/aws-sdk-go/aws/credentials"

+ 1 - 1
services/minio.go

@@ -3,7 +3,7 @@ package services
 import (
 	"context"
 	"errors"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 	"github.com/minio/minio-go/v7"
 	"github.com/minio/minio-go/v7/pkg/credentials"
 	"log"

+ 1 - 1
services/oss.go

@@ -6,7 +6,7 @@ import (
 	"os"
 	"time"
 
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 )
 
 // UploadAliyunToDir 上传至hzchart

+ 3 - 3
services/report2img.go

@@ -3,9 +3,9 @@ package services
 import (
 	"bytes"
 	"encoding/json"
-	"eta/eta_report/models"
-	"eta/eta_report/services/alarm_msg"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services/alarm_msg"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"io/ioutil"
 	"net/http"

+ 1 - 1
services/task.go

@@ -2,7 +2,7 @@ package services
 
 import (
 	"encoding/json"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 	"fmt"
 )
 

+ 1 - 1
services/verify.go

@@ -1,7 +1,7 @@
 package services
 
 import (
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/utils"
 )
 
 // CheckEncryption 校验需要是否加密

+ 3 - 3
services/wechat.go

@@ -3,9 +3,9 @@ package services
 import (
 	"encoding/json"
 	"errors"
-	"eta/eta_report/models"
-	"eta/eta_report/services/wechat"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services/wechat"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"github.com/rdlucklib/rdluck_tools/http"
 	"strconv"

+ 3 - 3
services/wechat/token.go

@@ -3,9 +3,9 @@ package wechat
 import (
 	"encoding/json"
 	"errors"
-	"eta/eta_report/models"
-	"eta/eta_report/services/alarm_msg"
-	"eta/eta_report/utils"
+	"eta_gn/eta_report/models"
+	"eta_gn/eta_report/services/alarm_msg"
+	"eta_gn/eta_report/utils"
 	"fmt"
 	"io/ioutil"
 	"net/http"

+ 1 - 1
utils/config.go

@@ -115,7 +115,7 @@ func init() {
 			RunMode = "release"
 		}
 		fmt.Println("RunMode:", RunMode)
-		configPath := `/home/code/config/eta_report/conf/app.conf`
+		configPath := `/home/code/config/eta_gn/eta_report/conf/app.conf`
 		fmt.Println("configPath:", configPath)
 		err = web.LoadAppConfig("ini", configPath)
 		if err != nil {

+ 1 - 1
utils/redis.go

@@ -1,7 +1,7 @@
 package utils
 
 import (
-	"eta/eta_report/utils/redis"
+	"eta_gn/eta_report/utils/redis"
 	"time"
 )