Roc 5 months ago
parent
commit
ace9db1e2a

+ 0 - 23
controllers/base_auth.go

@@ -22,19 +22,6 @@ func (this *BaseAuthController) Prepare() {
 	fmt.Println("Url:", uri)
 	if method != "HEAD" {
 		if method == "POST" {
-			//authorization := this.Ctx.Input.Header("authorization")
-			//if authorization == "" {
-			//	this.JSON(models.BaseResponse{Ret: 408, Msg: "请重新授权!", ErrMsg: "请重新授权:authorization is empty "}, false, false)
-			//	this.StopRun()
-			//	return
-			//}
-			//checkAuthorization := utils.MD5(utils.EtaReportAppNameEn + utils.EtaReportKey)
-			//fmt.Println(checkAuthorization)
-			//if authorization != checkAuthorization {
-			//	this.JSON(models.BaseResponse{Ret: 408, Msg: "签名错误!", ErrMsg: "签名错误:authorization is err "}, false, false)
-			//	this.StopRun()
-			//	return
-			//}
 		} else {
 			this.JSON(models.BaseResponse{Ret: 408, Msg: "请求异常,请联系客服!", ErrMsg: "POST之外的请求,暂不支持"}, false, false)
 			this.StopRun()
@@ -89,10 +76,8 @@ func (c *BaseAuthController) JSON(data interface{}, hasIndent bool, coding bool)
 		content = []byte(utils.StringsToJSON(string(content)))
 	}
 
-	// 数据加密
 	if services.CheckEncryption() {
 		content = utils.DesBase64Encrypt(content, utils.DesKey)
-		// get请求时,不加双引号就获取不到数据,不知道什么原因,所以还是在前后加上双引号吧
 		content = []byte(`"` + string(content) + `"`)
 	}
 	return c.Ctx.Output.Body(content)
@@ -123,8 +108,6 @@ func (c *BaseAuthController) ServeJSONNoEncryption(encoding ...bool) {
 
 func (c *BaseAuthController) JSONNoEncryption(data interface{}, hasIndent bool, coding bool) error {
 	c.Ctx.Output.Header("Content-Type", "application/json; charset=utf-8")
-	//desEncrypt := utils.DesBase64Encrypt([]byte(utils.DesKey), utils.DesKeySalt)
-	//c.Ctx.Output.Header("Dk", string(desEncrypt)) // des3加解密key
 	var content []byte
 	var err error
 	if hasIndent {
@@ -140,11 +123,5 @@ func (c *BaseAuthController) JSONNoEncryption(data interface{}, hasIndent bool,
 		content = []byte(utils.StringsToJSON(string(content)))
 	}
 
-	//// 数据加密
-	//if services.CheckEncryption() {
-	//	content = utils.DesBase64Encrypt(content, utils.DesKey)
-	//	// get请求时,不加双引号就获取不到数据,不知道什么原因,所以还是在前后加上双引号吧
-	//	content = []byte(`"` + string(content) + `"`)
-	//}
 	return c.Ctx.Output.Body(content)
 }

+ 0 - 2
controllers/base_common.go

@@ -69,10 +69,8 @@ func (c *BaseCommonController) JSON(data interface{}, hasIndent bool, coding boo
 		content = []byte(utils.StringsToJSON(string(content)))
 	}
 
-	// 数据加密
 	if services.CheckEncryption() {
 		content = utils.DesBase64Encrypt(content, utils.DesKey)
-		// get请求时,不加双引号就获取不到数据,不知道什么原因,所以还是在前后加上双引号吧
 		content = []byte(`"` + string(content) + `"`)
 	}
 

+ 0 - 5
controllers/chart.go

@@ -10,15 +10,10 @@ import (
 	"net/http"
 )
 
-// ChartController 图表详情
 type ChartController struct {
 	BaseAuthController
 }
 
-// ExcelDetail
-// @Title 表格详情
-// @Description 表格详情
-// @Success 200 {object} models.EnglishReportShareDetailResp
 // @router /detail [post]
 func (this *ChartController) ChartDetail() {
 	br := new(models.BaseResponse).Init()

+ 0 - 26
controllers/english_report.go

@@ -10,17 +10,10 @@ import (
 	"time"
 )
 
-// EnglishReportShareController 报告分享
 type EnglishReportShareController struct {
 	BaseCommonController
 }
 
-// EnglishReportDetail
-// @Title 英文研报-分享详情
-// @Description 英文研报-分享详情
-// @Param   ReportCode   query   string  true	"报告唯一编码"
-// @Param   ShareEmail   query   int  false	"推送的邮箱ID"
-// @Success 200 {object} models.EnglishReportShareDetailResp
 // @router /share/detail [get]
 func (this *EnglishReportShareController) EnglishReportDetail() {
 	br := new(models.BaseResponse).Init()
@@ -50,7 +43,6 @@ func (this *EnglishReportShareController) EnglishReportDetail() {
 	report.ContentSub = html.UnescapeString(report.ContentSub)
 	report.Content = html.UnescapeString(report.Content)
 
-	// 记录邮箱
 	shareEmail, _ := this.GetInt("ShareEmail", 0)
 	if shareEmail != 0 {
 		go func() {
@@ -70,12 +62,10 @@ func (this *EnglishReportShareController) EnglishReportDetail() {
 			if userEmail == nil {
 				return
 			}
-			// 更新报告邮箱pv(冗余)
 			if e = models.UpdateEnglishReportEmailCounts(reportCode); e != nil {
 				errMsg = errors.New("更新报告邮箱PV失败, Err:" + e.Error())
 				return
 			}
-			// 记录邮箱PV
 			pv := &models.EnglishReportEmailPV{
 				ReportId:   report.Id,
 				EmailId:    userEmail.Id,
@@ -85,7 +75,6 @@ func (this *EnglishReportShareController) EnglishReportDetail() {
 				errMsg = errors.New("新增邮箱PV失败, Err: " + e.Error())
 				return
 			}
-			// 更新阅读量
 			if e = models.UpdateEnglishReportEmailViewTotal(userEmail.Id); e != nil {
 				errMsg = errors.New("更新英文联系人阅读量失败, Err: " + e.Error())
 				return
@@ -100,14 +89,12 @@ func (this *EnglishReportShareController) EnglishReportDetail() {
 	}
 
 	resp := new(models.EnglishReportShareDetailResp)
-	// 免责声明
 	conf, e := models.GetBusinessConf()
 	if e != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取免责声明失败, Err: " + e.Error()
 		return
 	}
-	// 研报分享抬头
 	if v, ok := conf[models.BusinessConfH5ShareEnName]; ok {
 		resp.H5ShareEnName = v
 	}
@@ -123,7 +110,6 @@ func (this *EnglishReportShareController) EnglishReportDetail() {
 	if conf[models.BusinessConfDisclaimerEn] != "" {
 		resp.DisclaimerEn = conf[models.BusinessConfDisclaimerEn]
 	}
-	// 报告Logo
 	if v, ok := conf[models.BusinessConfReportEnLogoShow]; ok {
 		if v == `true` {
 			if reportLogo, ok := conf[models.BusinessConfReportLogo]; ok {
@@ -140,12 +126,6 @@ func (this *EnglishReportShareController) EnglishReportDetail() {
 	br.Data = resp
 }
 
-// TrialEnglishReportDetail
-// @Title 英文研报-分享详情-ETA试用平台
-// @Description 英文研报-分享详情
-// @Param   ReportCode   query   string  true	"报告唯一编码"
-// @Param   ShareEmail   query   int  false	"推送的邮箱ID"
-// @Success 200 {object} models.EnglishReportShareDetailResp
 // @router /trial/share/detail [get]
 func (this *EnglishReportShareController) TrialEnglishReportDetail() {
 	br := new(models.BaseResponse).Init()
@@ -175,7 +155,6 @@ func (this *EnglishReportShareController) TrialEnglishReportDetail() {
 	report.ContentSub = html.UnescapeString(report.ContentSub)
 	report.Content = html.UnescapeString(report.Content)
 
-	// 记录邮箱
 	shareEmail, _ := this.GetInt("ShareEmail", 0)
 	if shareEmail != 0 {
 		go func() {
@@ -194,12 +173,10 @@ func (this *EnglishReportShareController) TrialEnglishReportDetail() {
 			if userEmail == nil {
 				return
 			}
-			// 更新报告邮箱pv(冗余)
 			if e = models.UpdateTrialEnglishReportEmailCounts(reportCode); e != nil {
 				errMsg = errors.New("更新报告邮箱PV失败, Err:" + e.Error())
 				return
 			}
-			// 记录邮箱PV
 			pv := &models.EnglishReportEmailPV{
 				ReportId:   report.Id,
 				EmailId:    userEmail.Id,
@@ -209,7 +186,6 @@ func (this *EnglishReportShareController) TrialEnglishReportDetail() {
 				errMsg = errors.New("新增邮箱PV失败, Err: " + e.Error())
 				return
 			}
-			// 更新阅读量
 			if e = models.UpdateTrialEnglishReportEmailViewTotal(userEmail.Id); e != nil {
 				errMsg = errors.New("更新英文联系人阅读量失败, Err: " + e.Error())
 				return
@@ -224,7 +200,6 @@ func (this *EnglishReportShareController) TrialEnglishReportDetail() {
 	}
 
 	resp := new(models.EnglishReportShareDetailResp)
-	// 免责声明
 	conf, e := models.GetBusinessConf()
 	if e != nil {
 		br.Msg = "获取失败"
@@ -232,7 +207,6 @@ func (this *EnglishReportShareController) TrialEnglishReportDetail() {
 		return
 	}
 
-	// 研报分享抬头
 	if v, ok := conf[models.BusinessConfH5ShareEnName]; ok {
 		resp.H5ShareEnName = v
 	}

+ 0 - 3
controllers/error.go

@@ -2,15 +2,12 @@ package controllers
 
 import "eta_gn/eta_report/models"
 
-// ErrorController
-// @Description: 该控制器处理页面错误请求
 type ErrorController struct {
 	BaseCommonController
 }
 
 func (c *ErrorController) Error404() {
 	c.Data["content"] = "很抱歉您访问的地址或者方法不存在"
-	//c.TplName = "error/404.html"
 
 	br := new(models.BaseResponse).Init()
 

+ 0 - 5
controllers/excel.go

@@ -10,15 +10,10 @@ import (
 	"net/http"
 )
 
-// ExcelController 表格详情
 type ExcelController struct {
 	BaseAuthController
 }
 
-// ExcelDetail
-// @Title 表格详情
-// @Description 表格详情
-// @Success 200 {object} models.EnglishReportShareDetailResp
 // @router /detail [post]
 func (this *ExcelController) ExcelDetail() {
 	br := new(models.BaseResponse).Init()

+ 0 - 13
controllers/report_share.go

@@ -5,16 +5,10 @@ import (
 	"html"
 )
 
-// ReportShareController 报告分享
 type ReportShareController struct {
 	BaseCommonController
 }
 
-// Detail
-// @Title 日评详情
-// @Description 日评详情接口
-// @Param   ReportCode   query   string  true       "报告唯一编码"
-// @Success 200 {object} models.ReportShareDetailResp
 // @router /share/detail [get]
 func (this *ReportShareController) Detail() {
 	br := new(models.BaseResponse).Init()
@@ -62,7 +56,6 @@ func (this *ReportShareController) Detail() {
 	}
 
 	resp := new(models.ReportShareDetailResp)
-	// 免责声明
 	conf, e := models.GetBusinessConf()
 	if e != nil {
 		br.Msg = "获取失败"
@@ -72,7 +65,6 @@ func (this *ReportShareController) Detail() {
 	if conf[models.BusinessConfDisclaimer] != "" {
 		resp.Disclaimer = conf[models.BusinessConfDisclaimer]
 	}
-	// 研报分享抬头
 	if v, ok := conf[models.BusinessConfH5ShareName]; ok {
 		resp.H5ShareName = v
 	}
@@ -85,7 +77,6 @@ func (this *ReportShareController) Detail() {
 	if v, ok := conf[models.BusinessConfWatermarkReport]; ok {
 		resp.WatermarkReport = v
 	}
-	// 报告Logo
 	if v, ok := conf[models.BusinessConfReportCenterLogoShow]; ok {
 		if v == `true` {
 			if reportLogo, ok := conf[models.BusinessConfReportLogo]; ok {
@@ -94,11 +85,9 @@ func (this *ReportShareController) Detail() {
 		}
 	}
 
-	// 章节类型的报告
 	resp.Report = new(models.ReportItem)
 	reportChapters := make([]*models.ReportChapter, 0)
 	if report.HasChapter == 1 {
-		// 获取章节内容
 		chapters, e := models.GetPublishedChapterListByReportId(report.Id)
 		if e != nil {
 			br.Msg = "获取失败"
@@ -113,10 +102,8 @@ func (this *ReportShareController) Detail() {
 				reportChapters = append(reportChapters, chapter)
 			}
 		}
-		//report.Abstract = report.Title
 	}
 
-	// 更新pv
 	if e = models.UpdateReportPv(report.Id); e != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "更新报告pv失败, Err: " + e.Error()

+ 0 - 16
controllers/smart_report.go

@@ -8,16 +8,10 @@ import (
 	"strings"
 )
 
-// SmartReportController 智能研报
 type SmartReportController struct {
 	BaseCommonController
 }
 
-// Detail
-// @Title 报告详情
-// @Description 报告详情
-// @Param   ReportCode	query	string	true	"报告唯一编码"
-// @Success 200 {object} models.SmartReportShareDetailResp
 // @router /share/detail [get]
 func (this *SmartReportController) Detail() {
 	br := new(models.BaseResponse).Init()
@@ -72,7 +66,6 @@ func (this *SmartReportController) Detail() {
 		resp.Report.EndImg = endResource.ImgUrl
 		resp.Report.EndStyle = endResource.Style
 	}
-	// 免责声明
 	conf, e := models.GetBusinessConf()
 	if e != nil {
 		br.Msg = "获取失败"
@@ -82,7 +75,6 @@ func (this *SmartReportController) Detail() {
 	if conf[models.BusinessConfDisclaimer] != "" {
 		resp.Disclaimer = conf[models.BusinessConfDisclaimer]
 	}
-	// 研报分享抬头
 	if v, ok := conf[models.BusinessConfH5ShareName]; ok {
 		resp.H5ShareName = v
 	}
@@ -90,7 +82,6 @@ func (this *SmartReportController) Detail() {
 		resp.H5ReportShareImg = v
 	}
 
-	// 更新pv
 	if e = models.UpdateSmartReportPv(item.SmartReportId); e != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "更新报告pv失败, Err: " + e.Error()
@@ -103,11 +94,6 @@ func (this *SmartReportController) Detail() {
 	br.Data = resp
 }
 
-// Detail
-// @Title 微信分享详情
-// @Description 微信分享详情
-// @Param   ReportCode	query	string	true	"报告唯一编码"
-// @Success 200 {object} models.SmartReportWechatShareDetailResp
 // @router /wechat_share/detail [get]
 func (this *SmartReportController) WechatShareDetail() {
 	br := new(models.BaseResponse).Init()
@@ -136,7 +122,6 @@ func (this *SmartReportController) WechatShareDetail() {
 		br.ErrMsg = "获取报告失败, Err: " + e.Error()
 		return
 	}
-	// 免责声明
 	conf, e := models.GetBusinessConf()
 	if e != nil {
 		br.Msg = "获取失败"
@@ -147,7 +132,6 @@ func (this *SmartReportController) WechatShareDetail() {
 	date := strings.Replace(item.CreateTime, "-", "", -1)
 	dateStr := date[4:9]
 	var shareTitle string
-	// 研报分享抬头
 	if utils.BusinessCode == "E2023080700" || utils.BusinessCode == "E2023080900" || utils.BusinessCode == "E2023080901" {
 		shareTitle = "【第" + strconv.Itoa(item.Stage) + "期|FICC】" + item.Title + "(" + dateStr + ")"
 	} else {

+ 0 - 9
controllers/wechat.go

@@ -12,11 +12,6 @@ type WechatCommonController struct {
 	BaseCommonController
 }
 
-// GetWxSign
-// @Title 微信获取签名接口-无token校验
-// @Description 微信获取签名接口
-// @Param   Url   query   string  true       "url地址"
-// @Success 200 {object} models.WechatSign
 // @router /open/getWxSign [get]
 func (this *WechatCommonController) GetWxSign() {
 	br := new(models.BaseResponse).Init()
@@ -25,7 +20,6 @@ func (this *WechatCommonController) GetWxSign() {
 		this.ServeJSON()
 	}()
 
-	// 微信配置信息
 	conf, e := models.GetBusinessConf()
 	if e != nil {
 		br.Msg = "获取失败"
@@ -55,7 +49,6 @@ func (this *WechatCommonController) GetWxSign() {
 
 	var accessToken string
 	if utils.BusinessCode == utils.BusinessCodeRelease {
-		// 弘则ETA从eta_pub统一获取
 		token, e, msg := wechat.GetAccessToken(tReq)
 		if e != nil {
 			br.Msg = "获取微信配置失败"
@@ -64,7 +57,6 @@ func (this *WechatCommonController) GetWxSign() {
 		}
 		accessToken = token
 	} else {
-		// 从eta_report获取
 		token, e, msg := wechat.GetWxAccessToken(tReq.WxAppId, tReq.WxAppSecret)
 		if e != nil {
 			br.Msg = "获取微信信息失败"
@@ -77,7 +69,6 @@ func (this *WechatCommonController) GetWxSign() {
 	errCode, ticket, err := services.GetWxTicket(accessToken)
 	if err != nil {
 		if errCode == 40001 {
-			// 重新获取
 			if utils.BusinessCode == utils.BusinessCodeRelease {
 				token, e, msg := wechat.GetAccessToken(tReq)
 				if e != nil {

+ 0 - 25
global/dm.go

@@ -17,12 +17,9 @@ import (
 	_ "github.com/go-sql-driver/mysql"
 )
 
-// InitDm
-// @Description: 达梦数据库初始化
 func InitDm() {
 	dmSqlMap := make(map[string]*gorm.DB)
 
-	//开启日志
 	logWriter := io.MultiWriter(utils.Binlog) //binlog日志,记录到文件中去
 	if utils.RunMode == `dev` {               // 测试环境,默认输出在控制台,不需要的话,可以注释if里面下面的这行
 		logWriter = io.MultiWriter(utils.Binlog, os.Stdout)
@@ -34,34 +31,19 @@ func InitDm() {
 		Colorful:                  true,                   //是否颜色输出
 	})
 
-	// eta_report
 	connectDm(utils.MYSQL_URL, "default", newLogger, dmSqlMap, true)
 
-	// eta_master
 	connectDm(utils.MYSQL_URL_ETA, "eta", newLogger, dmSqlMap, false)
 
-	// crm_master
-	//connectDm(utils.MYSQL_WEEKLY_URL, "weekly", newLogger, dmSqlMap, false)
 
-	//全局赋值数据库链接
 	DmSQL = dmSqlMap
 
 }
 
-// connectDm
-// @Description: 达梦数据库连接
-// @param dsn
-// @param aliasName
-// @param newLogger
-// @param dmSqlMap
-// @param isDefault
 func connectDm(dsn, aliasName string, newLogger logger.Interface, dmSqlMap map[string]*gorm.DB, isDefault bool) {
-	//fmt.Println("dsn:", dsn, "  ==  ;aliasName:", aliasName)
 	if dsn == `` {
 		return
 	}
-	//dsn := "dm://SYSDBA:SYSDBA001@8.136.199.33:30236?schema=\"eta_master\""
-	//dsn := "dm://ETA:Han6258199118%60@localhost:5236?schema=ECOLOGY_TARGET"
 	db, err := gorm.Open(dm.Open(dsn), &gorm.Config{
 		Logger: newLogger,
 		NamingStrategy: schema.NamingStrategy{
@@ -69,31 +51,24 @@ func connectDm(dsn, aliasName string, newLogger logger.Interface, dmSqlMap map[s
 		},
 	})
 	if err != nil {
-		//global.LOG.Errorf("mysql 启动异常,数据库:default;Err:", err)
 		panic(fmt.Errorf("mysql 启动异常,数据库:%s;Err:%s", aliasName, err))
 	}
 
-	//创建连接池
 	sqlDB, err := db.DB()
 	if err != nil {
-		//global.LOG.Errorf("mysql 创建连接池失败,数据库:default;Err:", err)
 		panic(fmt.Errorf("mysql 创建连接池失败,数据库:%s;Err:%s", aliasName, err))
 	}
 
 	dmSqlMap[aliasName] = db
 
-	//默认数据库连接
 	if isDefault {
 		DEFAULT_DmSQL = db
 	}
 
-	// SetMaxIdleConns 设置空闲连接池中连接的最大数量
 	sqlDB.SetMaxIdleConns(50)
 
-	// SetMaxOpenConns 设置打开数据库连接的最大数量。
 	sqlDB.SetMaxOpenConns(100)
 
-	// SetConnMaxLifetime 设置了连接可复用的最大时间。
 	sqlDB.SetConnMaxLifetime(10 * time.Minute)
 
 }

+ 0 - 1
global/global.go

@@ -12,6 +12,5 @@ var (
 )
 
 func init() {
-	// 初始化达梦连接
 	InitDm()
 }

+ 0 - 1
main.go

@@ -15,7 +15,6 @@ func main() {
 	}
 	go services.InitTask()
 
-	// 异常处理
 	web.ErrorController(&controllers.ErrorController{})
 	web.Run()
 }

+ 0 - 3
models/business_conf.go

@@ -23,7 +23,6 @@ const (
 	BusinessConfDisclaimerEn         = "DisclaimerEn"         // 英文免责声明
 )
 
-// BusinessConf 商户配置表
 type BusinessConf struct {
 	Id         int    `gorm:"primaryKey;autoIncrement;column:id"`
 	ConfKey    string `description:"配置Key"`
@@ -34,11 +33,9 @@ type BusinessConf struct {
 	CreateTime time.Time
 }
 
-// GetBusinessConf 获取商家配置
 func GetBusinessConf() (list map[string]string, err error) {
 	list = make(map[string]string)
 
-	// TODO 改写为 gorm 操作达梦数据库
 	var items []*BusinessConf
 	o := global.DmSQL["eta"]
 	sql := `SELECT * FROM business_conf`

+ 0 - 4
models/db.go

@@ -8,21 +8,18 @@ func init() {
 	/**
 
 
-	// eta_report
 	_ = orm.RegisterDataBase("default", "mysql", utils.MYSQL_URL)
 	orm.SetMaxIdleConns("default", 50)
 	orm.SetMaxOpenConns("default", 100)
 	db, _ := orm.GetDB("default")
 	db.SetConnMaxLifetime(10 * time.Minute)
 
-	// eta_master
 	_ = orm.RegisterDataBase("eta", "mysql", utils.MYSQL_URL_ETA)
 	orm.SetMaxIdleConns("eta", 50)
 	orm.SetMaxOpenConns("eta", 100)
 	etaDb, _ := orm.GetDB("eta")
 	etaDb.SetConnMaxLifetime(10 * time.Minute)
 
-	// crm_master
 	if utils.MYSQL_WEEKLY_URL != `` && utils.BusinessCode == utils.BusinessCodeRelease {
 		_ = orm.RegisterDataBase("weekly", "mysql", utils.MYSQL_WEEKLY_URL)
 		orm.SetMaxIdleConns("weekly", 50)
@@ -34,7 +31,6 @@ func init() {
 	orm.Debug = true
 	orm.DebugLog = orm.NewLog(utils.Binlog)
 
-	//注册对象
 	orm.RegisterModel(
 		new(Report),
 		new(SmartReport),

+ 0 - 4
models/english_company.go

@@ -5,7 +5,6 @@ import (
 	"time"
 )
 
-// EnglishCompany 英文客户
 type EnglishCompany struct {
 	CompanyId   int       `gorm:"primaryKey;autoIncrement;column:company_id"`
 	CompanyName string    `gorm:"column:company_name" description:"客户名称"`
@@ -30,7 +29,6 @@ func (item *EnglishCompany) Create() (err error) {
 	return
 }
 
-// EnglishCompanySaveReq 英文客户-保存请求体
 type EnglishCompanySaveReq struct {
 	CompanyId   int    `description:"客户ID"`
 	CompanyName string `description:"客户名称"`
@@ -46,7 +44,6 @@ func (item *EnglishCompany) Update(cols []string) (err error) {
 	return
 }
 
-// UpdateEnglishCompanyViewTotal 更新英文客户阅读量
 func UpdateEnglishCompanyViewTotal(companyId int) (err error) {
 
 	sql := `UPDATE english_company SET view_total = view_total+1 WHERE company_id = ? `
@@ -55,7 +52,6 @@ func UpdateEnglishCompanyViewTotal(companyId int) (err error) {
 	return
 }
 
-// UpdateTrialEnglishCompanyViewTotal 更新英文客户阅读量-ETA试用平台
 func UpdateTrialEnglishCompanyViewTotal(companyId int) (err error) {
 
 	sql := `UPDATE english_company SET view_total = view_total+1 WHERE company_id = ? `

+ 0 - 7
models/english_report_email.go

@@ -5,7 +5,6 @@ import (
 	"time"
 )
 
-// EnglishReportEmail 英文研报-邮箱/客户联系人
 type EnglishReportEmail struct {
 	Id           int       `gorm:"primaryKey;autoIncrement;column:id"`
 	CompanyId    int       `gorm:"column:company_id" description:"客户ID"`
@@ -24,7 +23,6 @@ func (item *EnglishReportEmail) TableName() string {
 	return "english_report_email"
 }
 
-// EnglishReportEmailSaveReq 保存邮箱请求体
 type EnglishReportEmailSaveReq struct {
 	Id    int    `description:"邮箱ID, 大于0为编辑"`
 	Name  string `description:"客户名称"`
@@ -32,7 +30,6 @@ type EnglishReportEmailSaveReq struct {
 }
 
 func (item *EnglishReportEmail) Create() (err error) {
-	// 使用 GORM 插入记录
 	err = global.DEFAULT_DmSQL.Create(item).Error
 
 	return
@@ -45,7 +42,6 @@ func (item *EnglishReportEmail) Update(cols []string) (err error) {
 	return
 }
 
-// GetEnglishReportEmailById 主键获取邮箱
 func GetEnglishReportEmailById(id int) (item *EnglishReportEmail, err error) {
 
 	sql := `SELECT * FROM english_report_email WHERE is_deleted = 0 AND id = ? LIMIT 1`
@@ -54,7 +50,6 @@ func GetEnglishReportEmailById(id int) (item *EnglishReportEmail, err error) {
 	return
 }
 
-// UpdateEnglishReportEmailViewTotal 更新英文联系人阅读量
 func UpdateEnglishReportEmailViewTotal(emailId int) (err error) {
 
 	sql := `UPDATE english_report_email SET view_total = view_total+1, last_view_time = NOW() WHERE id = ? `
@@ -63,7 +58,6 @@ func UpdateEnglishReportEmailViewTotal(emailId int) (err error) {
 
 }
 
-// GetTrialEnglishReportEmailById 主键获取邮箱-ETA试用平台
 func GetTrialEnglishReportEmailById(id int) (item *EnglishReportEmail, err error) {
 
 	sql := `SELECT * FROM english_report_email WHERE is_deleted = 0 AND id = ? LIMIT 1`
@@ -71,7 +65,6 @@ func GetTrialEnglishReportEmailById(id int) (item *EnglishReportEmail, err error
 	return
 }
 
-// UpdateTrialEnglishReportEmailViewTotal 更新英文联系人阅读量-ETA试用平台
 func UpdateTrialEnglishReportEmailViewTotal(emailId int) (err error) {
 
 	sql := `UPDATE english_report_email SET view_total = view_total+1, last_view_time = NOW() WHERE id = ? `

+ 0 - 2
models/english_report_email_pv.go

@@ -5,7 +5,6 @@ import (
 	"time"
 )
 
-// EnglishReportEmailPV 英文研报-邮箱pv
 type EnglishReportEmailPV struct {
 	Id         int       `gorm:"primaryKey;autoIncrement;column:id"`
 	ReportId   int       `gorm:"column:report_id" description:"英文报告ID"`
@@ -13,7 +12,6 @@ type EnglishReportEmailPV struct {
 	CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
 }
 
-// InsertTrialEnglishReportEmailPV ETA试用平台-新增英文邮箱PV
 func InsertTrialEnglishReportEmailPV(item *EnglishReportEmailPV) (err error) {
 
 	sql := `INSERT INTO english_report_email_pv(report_id, email_id, create_time) VALUES(?, ?, ?)`

+ 0 - 6
models/report.go

@@ -78,12 +78,6 @@ type ReportItem struct {
 	ChapterList []*ReportChapter
 }
 
-// UpdateReportPv
-// @Description: 研报pv自增
-// @author: Roc
-// @datetime 2024-07-19 15:46:58
-// @param reportId int
-// @return err error
 func UpdateReportPv(reportId int) (err error) {
 
 	sql := `UPDATE report SET pv = pv + 1 WHERE id = ?`

+ 0 - 2
models/report_chapter.go

@@ -5,7 +5,6 @@ import (
 	"time"
 )
 
-// ReportChapter 报告章节
 type ReportChapter struct {
 	ReportChapterId   int       `gorm:"primaryKey;autoIncrement;column:reportChapterId"`
 	ReportId          int       `gorm:"column:report_id" description:"报告ID"`
@@ -36,7 +35,6 @@ type ReportChapter struct {
 	OriginalVideoUrl  string    `gorm:"column:original_video_url" description:"原始音频文件URL"`
 }
 
-// GetPublishedChapterListByReportId 根据ReportId获取已发布章节列表
 func GetPublishedChapterListByReportId(reportId int) (list []*ReportChapter, err error) {
 
 	sql := ` SELECT * FROM report_chapter WHERE report_id = ? AND publish_state = 2 ORDER BY sort ASC`

+ 0 - 1
models/report_chapter_type.go

@@ -31,7 +31,6 @@ type ReportChapterType struct {
 	YbBottomIcon           string    `gorm:"column:yb_bottom_icon" description:"研报小程序详情底部icon"`
 }
 
-// GetAllReportChapterTypeListByResearchType 通过报告类型获取章节类型列表
 func GetAllReportChapterTypeListByResearchType(researchType string) (list []*ReportChapterType, err error) {
 	if utils.BusinessCode != utils.BusinessCodeRelease {
 		return

+ 0 - 5
models/response/excel_info.go

@@ -4,9 +4,7 @@ import (
 	"eta_gn/eta_report/services/excel"
 )
 
-// ExcelTableDetailResp  excel表格详情
 type ExcelTableDetailResp struct {
-	//ChartInfo   *ChartInfo
 	UniqueCode string `description:"表格唯一code"`
 	Source     int    `description:"表格来源,1:excel插件的表格,2:自定义表格,默认:1"`
 	ExcelType  int    `description:"表格类型,1:指标列,2:日期列,默认:1"`
@@ -16,13 +14,10 @@ type ExcelTableDetailResp struct {
 	Config     ExcelTableDetailConfigResp
 }
 
-// ExcelTableDetailConfigResp
-// @Description: Excel表格的配置信息
 type ExcelTableDetailConfigResp struct {
 	FontSize int
 }
 
-// TableCellResp 单元格
 type TableCellResp struct {
 	DataType  int    `description:"数据类型,1:普通的,2:插值法,3:手动输入,4:公式计算"`
 	DataTime  string `description:"所属日期"`

+ 0 - 6
models/smart_report.go

@@ -9,7 +9,6 @@ import (
 	"time"
 )
 
-// SmartReport 智能研报
 type SmartReport struct {
 	SmartReportId       int       `gorm:"primaryKey;autoIncrement;column:smart_report_id" description:"智能研报ID"`
 	ReportCode          string    `gorm:"column:banner_url" description:"报告唯一编码"`
@@ -67,7 +66,6 @@ func (m *SmartReport) PrimaryId() string {
 
 func (m *SmartReport) Create() (err error) {
 
-	// 使用 GORM 插入记录
 	err = global.DEFAULT_DmSQL.Create(m).Error
 	if err != nil {
 		log.Printf("插入失败: %v", err)
@@ -100,7 +98,6 @@ func (m *SmartReport) GetItemByCondition(condition string, pars []interface{}) (
 	return
 }
 
-// SmartReportItem 智能研报信息
 type SmartReportItem struct {
 	SmartReportId      int     `description:"智能研报ID"`
 	ReportCode         string  `description:"报告唯一编码"`
@@ -145,7 +142,6 @@ type SmartReportItem struct {
 	EndStyle           string  `description:"版尾样式"`
 }
 
-// FormatSmartReport2Item 格式化智能研报数据格式
 func FormatSmartReport2Item(origin *SmartReport) (item *SmartReportItem) {
 	item = new(SmartReportItem)
 	if origin == nil {
@@ -191,7 +187,6 @@ func FormatSmartReport2Item(origin *SmartReport) (item *SmartReportItem) {
 	return
 }
 
-// SmartReportShareDetailResp 智能研报分享详情响应体
 type SmartReportShareDetailResp struct {
 	Report           *SmartReportItem `description:"智能研报"`
 	Disclaimer       string           `description:"免责声明"`
@@ -200,7 +195,6 @@ type SmartReportShareDetailResp struct {
 	Hz               int
 }
 
-// UpdateSmartReportPv 研报pv自增
 func UpdateSmartReportPv(reportId int) (err error) {
 
 	sql := `UPDATE smart_report SET pv = pv + 1 WHERE smart_report_id = ?`

+ 0 - 7
routers/router.go

@@ -1,10 +1,3 @@
-// @APIVersion 1.0.0
-// @Title beego Test API
-// @Description beego has a very cool tools to autogenerate documents for your API
-// @Contact astaxie@gmail.com
-// @TermsOfServiceUrl http://beego.me/
-// @License Apache 2.0
-// @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
 package routers
 
 import (

+ 0 - 5
services/alarm_msg/alarm_msg.go

@@ -6,11 +6,6 @@ import (
 	"github.com/rdlucklib/rdluck_tools/http"
 )
 
-// SendAlarmMsg
-// projectName-项目名称
-// runMode-运行模式
-// msgBody-消息内容
-// level:消息基本,1:提示消息,2:警告消息,3:严重错误信息,默认为1 提示消息
 func SendAlarmMsg(msgBody string, level int) {
 	if utils.AlarmMsgUrl == "" {
 		return

+ 0 - 14
services/aws_s3.go

@@ -27,12 +27,10 @@ func NewOssClient() OssClient {
 	case utils.STORAGESOURCE_S3_NAME:
 		return new(S3Oss)
 	default:
-		// 默认使用阿里云OSS
 		return new(AliOss)
 	}
 }
 
-// OssToken 此处为了兼容前端那边所以有重复的
 type OssToken struct {
 	AccessKeyId string
 	SecretKeyId string
@@ -42,13 +40,9 @@ type OssToken struct {
 	ImgHost     string
 	UseSSL      string
 	Port        string
-	//AccessKeyId     string
 	AccessKeySecret string
 	SecurityToken   string
 	ExpiredTime     string
-	//RegionId        string
-	//Bucketname      string
-	//Endpoint        string
 	Imghost      string
 	S3ForceStyle bool
 	S3Protocol   string
@@ -64,8 +58,6 @@ func (m *S3Oss) UploadFile(fileName, localFile, savePath string) (resourceUrl st
 		_ = os.Remove(localFile)
 	}()
 
-	// 默认使用后端这个, 这里有两个配置的原因是
-	// 前端上传跨域问题可能会使用反向代理来解决, 这样的话同一个endpoint就会导致一端正常另一端不正常
 	endpoint := utils.S3Endpoint
 
 	accessKey := utils.S3AccessKeyId
@@ -83,7 +75,6 @@ func (m *S3Oss) UploadFile(fileName, localFile, savePath string) (resourceUrl st
 	if utils.S3DisableSSL == "false" {
 		disableSSL = false
 	}
-	//fmt.Println("disableSSL: ", disableSSL)
 
 	config := &aws.Config{
 		Region:           aws.String(region),
@@ -99,20 +90,15 @@ func (m *S3Oss) UploadFile(fileName, localFile, savePath string) (resourceUrl st
 			},
 		}
 	}
-	//b, _ := json.Marshal(config)
-	//fmt.Println(string(b))
 
-	// 创建AWS会话
 	sess, e := session.NewSession(config)
 	if e != nil {
 		err = fmt.Errorf("new session err: %s", e.Error())
 		return
 	}
 
-	// 创建S3服务客户端
 	client := s3.New(sess)
 
-	// 读取文件内容
 	fileContent, e := ioutil.ReadFile(localFile)
 	if e != nil {
 		err = fmt.Errorf("read file err: %s", e.Error())

+ 0 - 28
services/excel/lucky_sheet.go

@@ -97,12 +97,10 @@ type LuckySheetDataBak struct {
 	ZoomRatio         float64 `json:"zoomRatio" description:"sheet缩放比例"`
 }
 
-// LuckySheetData sheet表格数据
 type LuckySheetData struct {
 	CellData []LuckySheetCellData `json:"celldata" description:"单元格数据"`
 	ChWidth  int64                `json:"ch_width" description:"工作表区域的宽度"`
 	Config   LuckySheetDataConfig `json:"config" description:""`
-	//Index             int                  `json:"index" description:"工作表索引"`
 	RhHeight          float64     `json:"rh_height" description:"工作表区域的高度"`
 	ScrollLeft        float64     `json:"scrollLeft" description:"左右滚动条位置"`
 	ScrollTop         float64     `json:"scrollTop" description:"上下滚动条位置"`
@@ -112,22 +110,14 @@ type LuckySheetData struct {
 	ZoomRatio         float64     `json:"zoomRatio" description:"sheet缩放比例"`
 }
 
-// LuckySheetDataConfig sheet表单的配置
 type LuckySheetDataConfig struct {
 	BorderInfo []LuckySheetDataConfigBorderInfo `json:"borderInfo" description:"边框"`
 	Colhidden  map[string]int64                 `json:"colhidden" description:"隐藏列,示例值:\"colhidden\":{\"30\":0,\"31\":0}"`
 	Columnlen  map[string]float64               `json:"columnlen" description:"每个单元格的列宽"`
-	//CustomHeight struct {
-	//	Zero int64 `json:"0"`
-	//} `json:"customHeight" description:""`
-	//CustomWidth struct {
-	//	Two int64 `json:"2" description:""`
-	//} `json:"customWidth" description:""`
 	Merge  map[string]LuckySheetDataConfigMerge `json:"merge" description:"合并单元格"`
 	Rowlen map[string]float64                   `json:"rowlen" description:"每个单元格的行高"`
 }
 
-// LuckySheetDataConfigMerge 合并单元格设置
 type LuckySheetDataConfigMerge struct {
 	Row    int `json:"r" description:"行数"`
 	Column int `json:"c" description:"列数"`
@@ -135,7 +125,6 @@ type LuckySheetDataConfigMerge struct {
 	Cs     int `json:"cs" description:"合并的列数"`
 }
 
-// LuckySheetDataConfigBorderInfo 单元格边框信息
 type LuckySheetDataConfigBorderInfo struct {
 	BorderType string `json:"borderType" description:"边框类型 border-left | border-right | border-top | border-bottom | border-all | border-outside | border-inside | border-horizontal | border-vertical | border-none"`
 	Color      string `json:"color" description:"边框颜色 color: 16进制颜色值"`
@@ -148,7 +137,6 @@ type LuckySheetDataConfigBorderInfo struct {
 	Value     LuckySheetDataConfigBorderInfoCellValue `json:"value" description:"" description:"范围类型分单个单元格的数据"`
 }
 
-// LuckySheetDataConfigBorderInfoCellValue 单元格边框信息(范围类型为:单个单元格)
 type LuckySheetDataConfigBorderInfoCellValue struct {
 	B        LuckySheetDataConfigBorderInfoCell `json:"b" description:"下边框"`
 	L        LuckySheetDataConfigBorderInfoCell `json:"l" description:"左边框"`
@@ -158,21 +146,18 @@ type LuckySheetDataConfigBorderInfoCellValue struct {
 	RowIndex int64                              `json:"row_index" description:"第几列"`
 }
 
-// LuckySheetDataConfigBorderInfoCell 单元格边框信息(cell类型)
 type LuckySheetDataConfigBorderInfoCell struct {
 	Color string      `json:"color" description:"边框颜色 color: 16进制颜色值"`
 	Style int         `description:"边框粗细 style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick ,和aspose.cells的getLineStyle()的值对应的话,需要自己做个转换,参考 aspose.cells"`
 	Sl    interface{} `json:"style" description:"边框粗细 style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick ,和aspose.cells的getLineStyle()的值对应的话,需要自己做个转换,参考 aspose.cells"`
 }
 
-// LuckySheetCellData 单个单元格数据
 type LuckySheetCellData struct {
 	Col   int64               `json:"c" description:"列"`
 	Row   int64               `json:"r" description:"行"`
 	Value LuckySheetDataValue `json:"v" description:"单元格内值的数据"`
 }
 
-// LuckySheetDataValue 单元格内值的数据
 type LuckySheetDataValue struct {
 	CellType       LuckySheetDataCellType `json:"ct" description:"单元格值格式:文本、时间等	"`
 	Value          interface{}            `json:"v" description:"原始值"`
@@ -191,8 +176,6 @@ type LuckySheetDataValue struct {
 	Cl             interface{}            `json:"cl" description:"删除线,	0 常规 、 1 删除线"`
 	Ht             interface{}            `json:"ht" description:"水平对齐,	0 居中、1 左、2右"`
 	Vt             interface{}            `json:"vt" description:"垂直对齐,	0 中间、1 上、2下"`
-	//TextRotate     string                    `json:"tr" description:"竖排文字,	3"`
-	//RotateText     string                    `json:"rt" description:"文字旋转角度,	介于0~180之间的整数,包含0和180"`
 	TextBeak  int                       `description:"文本换行,	0 截断、1溢出、2 自动换行"`
 	Tb        interface{}               `json:"tb" description:"文本换行,	0 截断、1溢出、2 自动换行"`
 	Ps        LuckySheetDataCellComment `json:"ps" description:"批注"`
@@ -200,7 +183,6 @@ type LuckySheetDataValue struct {
 	MergeCell LuckySheetDataConfigMerge `json:"mc" description:"合并单元格信息"`
 }
 
-// LuckySheetDataCellType 单元格值格式:文本、时间等
 type LuckySheetDataCellType struct {
 	Fa string `json:"fa" description:"格式名称,例如:“General”为自动格式"`
 	T  string `json:"t" description:"格式类型,例如:“n”为数字类型"`
@@ -223,7 +205,6 @@ type LuckySheetDataCellType struct {
 	} `json:"s"`
 }
 
-// LuckySheetDataCellComment 批注
 type LuckySheetDataCellComment struct {
 	Left   int    `json:"left" description:"批注框距离左边工作表边缘位置"`
 	Top    int    `json:"top" description:"批注框距离上边工作表边缘位置"`
@@ -233,7 +214,6 @@ type LuckySheetDataCellComment struct {
 	IsShow bool   `json:"isshow" description:"是否显示批注"`
 }
 
-// GetLuckySheetData 获取LuckySheetData的结构体
 func GetLuckySheetData(jsonStr string) (item *LuckySheetData, err error) {
 	err = json.Unmarshal([]byte(jsonStr), &item)
 	for k, v := range item.CellData {
@@ -259,7 +239,6 @@ func GetLuckySheetData(jsonStr string) (item *LuckySheetData, err error) {
 		item.CellData[k].Value = value
 	}
 
-	//边框
 	if len(item.Config.BorderInfo) > 0 {
 		for k, v := range item.Config.BorderInfo {
 			v.Value.T.Style = getIntValueByInterface(v.Value.T.Style)
@@ -272,7 +251,6 @@ func GetLuckySheetData(jsonStr string) (item *LuckySheetData, err error) {
 	return
 }
 
-// 兼容前端js传递的数据类型
 func getIntValueByInterface(valInterface interface{}) (val int) {
 	if valInterface == nil {
 		return
@@ -293,7 +271,6 @@ func getIntValueByInterface(valInterface interface{}) (val int) {
 	return
 }
 
-// TableData 表格数据
 type TableData struct {
 	TableDataList     [][]LuckySheetDataValue
 	RowWidthList      []float64
@@ -305,7 +282,6 @@ type TableData struct {
 	MergeList         []TableDataMerge `description:"合并数据列"`
 }
 
-// TableDataMerge 表格数据合并单元格配置
 type TableDataMerge struct {
 	StartRowIndex    int `json:"start_row_index" description:"开始的行下标"`
 	StartColumnIndex int `json:"start_column" description:"开始的列下标"`
@@ -313,7 +289,6 @@ type TableDataMerge struct {
 	MergeColumnNum   int `json:"merge_column_num" description:"合并的列数"`
 }
 
-// TableRemoveNum 上下左右移除的空行空列数量
 type TableRemoveNum struct {
 	RemoveTopRow      int `description:"移除表格上方的行数"`
 	RemoveBottomRow   int `description:"移除表格下方的行数"`
@@ -321,13 +296,10 @@ type TableRemoveNum struct {
 	RemoveRightColumn int `description:"移除表格右侧的列数"`
 }
 
-// handleCellVal 处理单元格数据
 func handleCellVal(tmpTableColData LuckySheetDataValue) (valueStr string) {
 	valueStr = tmpTableColData.Monitor
 	if valueStr == `` {
-		//valueStr = fmt.Sprint(cellInfo.Value)
 		if valueStr == `` && tmpTableColData.CellType.S != nil {
-			//不是设置在单元格上面,而是设置在文本上
 			for _, cellS := range tmpTableColData.CellType.S {
 				valueStr += fmt.Sprint(cellS.Value)
 			}

+ 0 - 47
services/minio.go

@@ -11,56 +11,9 @@ import (
 	"time"
 )
 
-// UploadMinIoToDir 上传至hzchart
-//func UploadMinIoToDir(filename, filePath, uploadDir, fileDir string) (string, error) {
-//	if utils.MinIoAccessKeyId == `` || utils.MinIoAccessKeySecret == `` {
-//		return "0", errors.New("MinIo信息未配置")
-//	}
-//	ctx := context.Background()
-//	endpoint := utils.MinIoEndpoint
-//	accessKeyID := utils.MinIoAccessKeyId
-//	secretAccessKey := utils.MinIoAccessKeySecret
-//	useSSL := false
-//	if utils.MinIoUseSSL == "true" {
-//		useSSL = true
-//	}
-//	minioClient, err := minio.New(endpoint, &minio.Options{
-//		Creds:  credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
-//		Secure: useSSL,
-//	})
-//	if err != nil {
-//		log.Fatalln(err)
-//		return "1", err
-//	}
-//	bucketName := utils.MinIoBucketname
-//	// Check to see if we already own this bucket (which happens if you run this twice)
-//	exists, errBucketExists := minioClient.BucketExists(ctx, bucketName)
-//	if errBucketExists == nil && exists {
-//		log.Printf("We already own %s\n", bucketName)
-//	} else {
-//		log.Fatalln(err)
-//		return "2", err
-//	}
-//	if uploadDir == "" {
-//		uploadDir = utils.MinIoUploadDir
-//	}
-//	if fileDir == "" {
-//		fileDir = time.Now().Format("200601/20060102/")
-//	}
-//	path := uploadDir + fileDir
-//	path += filename
-//	_, err = minioClient.FPutObject(ctx, bucketName, path, filePath, minio.PutObjectOptions{})
-//	if err != nil {
-//		log.Fatalln(err)
-//		return "3", err
-//	}
-//	path = utils.MinIoImghost + path
-//	return path, err
-//}
 
 type MinioOss struct{}
 
-// UploadFile 上传文件
 func (m *MinioOss) UploadFile(fileName, filePath, savePath string) (string, error) {
 	defer func() {
 		_ = os.Remove(filePath)

+ 0 - 42
services/oss.go

@@ -9,38 +9,9 @@ import (
 	"eta_gn/eta_report/utils"
 )
 
-// UploadAliyunToDir 上传至hzchart
-//func UploadAliyunToDir(filename, filepath, uploadDir, fileDir string) (string, error) {
-//	if utils.AccessKeyId == `` {
-//		return "0", errors.New("阿里云信息未配置")
-//	}
-//	client, err := oss.New(utils.Endpoint, utils.AccessKeyId, utils.AccessKeySecret)
-//	if err != nil {
-//		return "1", err
-//	}
-//	bucket, err := client.Bucket(utils.Bucketname)
-//	if err != nil {
-//		return "2", err
-//	}
-//	if uploadDir == "" {
-//		uploadDir = utils.UploadDir
-//	}
-//	if fileDir == "" {
-//		fileDir = time.Now().Format("200601/20060102/")
-//	}
-//	path := uploadDir + fileDir
-//	path += filename
-//	err = bucket.PutObjectFromFile(path, filepath)
-//	if err != nil {
-//		return "3", err
-//	}
-//	path = utils.Imghost + path
-//	return path, err
-//}
 
 type AliOss struct{}
 
-// UploadFile 上传文件
 func (m *AliOss) UploadFile(fileName, filePath, savePath string) (string, error) {
 	defer func() {
 		_ = os.Remove(filePath)
@@ -70,18 +41,5 @@ func (m *AliOss) UploadFile(fileName, filePath, savePath string) (string, error)
 }
 
 func (m *AliOss) GetUploadToken() (token OssToken, err error) {
-	//stsToken, e := GetOssSTSToken()
-	//if e != nil {
-	//	err = fmt.Errorf("GetOssSTSToken err: %s", e.Error())
-	//	return
-	//}
-	//token.AccessKeyId = stsToken.AccessKeyId
-	//token.AccessKeySecret = stsToken.AccessKeySecret
-	//token.SecurityToken = stsToken.SecurityToken
-	//token.ExpiredTime = stsToken.ExpiredTime
-	//token.RegionId = stsToken.RegionId
-	//token.Bucketname = stsToken.Bucketname
-	//token.Endpoint = stsToken.Endpoint
-	//token.Imghost = stsToken.Imghost
 	return
 }

+ 0 - 55
services/report2img.go

@@ -18,9 +18,7 @@ const (
 	PythonReportHtml2ImgClearLocalApi = "/api/report/clear_local_file" // 清除本地图片文件接口
 )
 
-// CreateReportImgAndPdf 报告详情生成长图及PDF
 func CreateReportImgAndPdf(req Report2ImgQueueReq) {
-	// 研报以后大概率也需要, 暂只处理智能研报的
 	if req.ReportType != 2 {
 		return
 	}
@@ -37,7 +35,6 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 		}
 	}()
 
-	// 先取报告转长图的host配置, 如果没有再取原有的报告分享配置(兼容只配了其中一个的客户)
 	conf, e := models.GetBusinessConf()
 	if e != nil {
 		err = fmt.Errorf("获取商家配置失败, Err: %s", e.Error())
@@ -52,7 +49,6 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 		return
 	}
 
-	// 校验报告是否被删
 	reportOb := new(models.SmartReport)
 	cond := ` AND report_code = ?`
 	pars := make([]interface{}, 0)
@@ -66,7 +62,6 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 		return
 	}
 
-	// 报告平均生成时间基本在3min以下, 设定一个6min的超时以免后续阻塞
 	apiDone := make(chan bool, 1)
 	apiError := make(chan error, 1)
 
@@ -75,18 +70,12 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 	go func() {
 		var apiReq ReportHtml2ImgApiReq
 		apiReq.ReportUrl = fmt.Sprintf("%s/%s?code=%s", reportViewHost, "smart_report_getImg", req.ReportCode)
-		//if utils.RunMode == "debug" {
-		//	apiReq.ReportUrl = "https://ficc.hzinsights.com/reportshare_crm_report?code=4e38d30e656da5ae9d3a425109ce9e04"
-		//}
-		//fmt.Println(apiReq.ReportUrl)
 		apiReq.FileName = fileName
-		//fmt.Println("curl start")
 		res, e := CurlReportHtml2ImgApi(apiReq)
 		if e != nil {
 			apiError <- fmt.Errorf("CurlReportHtml2ImgApi err: %s", e.Error())
 			return
 		}
-		//fmt.Println("curl end")
 		apiResult = res
 		apiDone <- true
 	}()
@@ -106,11 +95,8 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 		return
 	}
 
-	// 上传IMG, PDF
 	var imgUrl, pdfUrl string
 	var errImg, errPdf error
-	//uploadDir := "static/report_images/"
-	//fileDir := ""
 
 	wg := sync.WaitGroup{}
 	wg.Add(2)
@@ -133,21 +119,6 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 			return
 		}
 		fmt.Println("end UploadFile:" + imgFileName)
-		//if utils.ObjectStorageClient == "minio" {
-		//	si, e := UploadMinIoToDir(imgFileName, apiResult[0], uploadDir, fileDir)
-		//	if e != nil {
-		//		errImg = e
-		//		return
-		//	}
-		//	imgUrl = si
-		//	return
-		//}
-		//// 默认OSS
-		//si, e := UploadAliyunToDir(imgFileName, apiResult[0], uploadDir, fileDir)
-		//if e != nil {
-		//	errImg = e
-		//	return
-		//}
 		imgUrl = si
 
 		var clearReq ReportHtml2ImgApiClearLocalReq
@@ -176,20 +147,6 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 			return
 		}
 
-		//if utils.ObjectStorageClient == "minio" {
-		//	sp, e := UploadMinIoToDir(pdfFileName, apiResult[1], uploadDir, fileDir)
-		//	if e != nil {
-		//		errPdf = e
-		//		return
-		//	}
-		//	pdfUrl = sp
-		//	return
-		//}
-		//sp, e := UploadAliyunToDir(pdfFileName, apiResult[1], uploadDir, fileDir)
-		//if e != nil {
-		//	errPdf = e
-		//	return
-		//}
 		pdfUrl = sp
 
 		var clearReq ReportHtml2ImgApiClearLocalReq
@@ -213,7 +170,6 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 
 	fmt.Println("imgUrl:" + imgUrl + ";pdfUrl:" + pdfUrl)
 
-	// 更新报告链接
 	item.DetailImgUrl = imgUrl
 	item.DetailPdfUrl = pdfUrl
 	item.ModifyTime = time.Now().Local()
@@ -225,43 +181,36 @@ func CreateReportImgAndPdf(req Report2ImgQueueReq) {
 	return
 }
 
-// ReportHtml2ImgApiReq 报告生成图片接口请求体
 type ReportHtml2ImgApiReq struct {
 	ReportUrl  string `json:"report_url" description:"报告详情分享地址"`
 	FileName   string `json:"file_name" description:"生成的文件名"`
 	OutputType string `json:"output_type" description:"生成类型: img/pdf, 为空则两种均生成"`
 }
 
-// ReportHtml2ImgApiResp 报告生成图片接口响应体
 type ReportHtml2ImgApiResp struct {
 	Code int      `json:"code" description:"状态码"`
 	Msg  string   `json:"error" description:"提示信息"`
 	Data []string `json:"data" description:"返回数据"`
 }
 
-// CurlReportHtml2ImgApi 请求报告生成图片接口
 func CurlReportHtml2ImgApi(params ReportHtml2ImgApiReq) (apiResp []string, err error) {
 	if utils.Report2ImgServerUrl == "" {
 		err = fmt.Errorf("服务地址为空")
 		return
 	}
 	url := fmt.Sprint(utils.Report2ImgServerUrl, PythonReportHtml2ImgApi)
-	//fmt.Println("url: ", url)
 
 	jsonData, e := json.Marshal(params)
 	if e != nil {
 		err = fmt.Errorf("data json marshal err: %s", e.Error())
 		return
 	}
-	//fmt.Println(string(jsonData))
-	//fmt.Println("http post start")
 	resp, e := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
 	if e != nil {
 		err = fmt.Errorf("http post err: %s", e.Error())
 		return
 	}
 	defer resp.Body.Close()
-	//fmt.Println("http post end")
 
 	b, e := ioutil.ReadAll(resp.Body)
 	if e != nil {
@@ -286,19 +235,16 @@ func CurlReportHtml2ImgApi(params ReportHtml2ImgApiReq) (apiResp []string, err e
 	return
 }
 
-// ReportHtml2ImgApiClearLocalReq 清除本地文件接口请求体
 type ReportHtml2ImgApiClearLocalReq struct {
 	FileName string `json:"file_name" description:"生成的文件名"`
 }
 
-// ReportHtml2ImgApiClearLocalResp 清除本地文件接口响应体
 type ReportHtml2ImgApiClearLocalResp struct {
 	Code int    `json:"code" description:"状态码"`
 	Msg  string `json:"error" description:"提示信息"`
 	Data string `json:"data" description:"返回数据"`
 }
 
-// CurlReportHtml2ImgApiClearLocal 请求清除本地文件
 func CurlReportHtml2ImgApiClearLocal(params ReportHtml2ImgApiClearLocalReq) (err error) {
 	if utils.Report2ImgServerUrl == "" {
 		err = fmt.Errorf("服务地址为空")
@@ -311,7 +257,6 @@ func CurlReportHtml2ImgApiClearLocal(params ReportHtml2ImgApiClearLocalReq) (err
 		err = fmt.Errorf("data json marshal err: %s", e.Error())
 		return
 	}
-	//fmt.Println(string(jsonData))
 	resp, e := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
 	if e != nil {
 		err = fmt.Errorf("http post err: %s", e.Error())

+ 0 - 4
services/task.go

@@ -7,17 +7,13 @@ import (
 )
 
 func InitTask() {
-	// 监听生成报告长图及pdf
-	//go ListenReport2ImgQueue()
 }
 
-// Report2ImgQueueReq 报告生成长图请求体
 type Report2ImgQueueReq struct {
 	ReportType int    `description:"报告类型: 1-研报; 2-智能研报"`
 	ReportCode string `description:"报告唯一编码"`
 }
 
-// ListenReport2ImgQueue 监听生成报告长图及pdf
 func ListenReport2ImgQueue() {
 	defer func() {
 		if err := recover(); err != nil {

+ 0 - 1
services/verify.go

@@ -4,7 +4,6 @@ import (
 	"eta_gn/eta_report/utils"
 )
 
-// CheckEncryption 校验需要是否加密
 func CheckEncryption() (ok bool) {
 	if utils.RunMode == "release" {
 		ok = true

+ 0 - 2
services/wechat.go

@@ -41,9 +41,7 @@ func GetWxSignature(ticket, url, noncestr string) (string, string, int64) {
 	return signature, noncestr, timestamp
 }
 
-// GetDefaultWxAccessToken 获取微信token
 func GetDefaultWxAccessToken() (accessToken string, err error, errMsg string) {
-	// 微信配置信息
 	conf, e := models.GetBusinessConf()
 	if e != nil {
 		errMsg = "获取配置信息失败, Err: " + e.Error()

+ 1 - 36
services/wechat/token.go

@@ -32,10 +32,8 @@ type WxTokenData struct {
 	AccessToken string `description:"微信token"`
 }
 
-// GetAccessToken 获取微信token
 func GetAccessToken(tokenReq WxTokenReq) (accessToken string, err error, errMsg string) {
 	if utils.EtaPubUrl == `` {
-		// 找不到推送服务
 		return
 	}
 	url := fmt.Sprintf("%s%s", utils.EtaPubUrl, "v1/wechat/access_token")
@@ -90,7 +88,6 @@ func GetAccessToken(tokenReq WxTokenReq) (accessToken string, err error, errMsg
 	return
 }
 
-// GetWxAccessToken 获取微信token
 func GetWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err error, errMsg string) {
 	accessToken, err, errMsg = getWxAccessToken(wxAppId, wxAppSecret)
 	if err != nil {
@@ -100,7 +97,6 @@ func GetWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err erro
 	return
 }
 
-// getWxAccessToken 获取微信token
 func getWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err error, errMsg string) {
 	redisKey := getRedisKeyByAppid(wxAppId)
 	if redisKey == `` {
@@ -110,23 +106,13 @@ func getWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err erro
 	}
 
 	accessToken, err = utils.Rc.RedisString(redisKey)
-	//fmt.Println(err)
-	//fmt.Println(accessToken)
-	//if err != nil {
-	//	errMsg = "GetWxAccessToken Err:" + err.Error()
-	//	utils.FileLog.Info("获取Token失败,msg:" + errMsg)
-	//	return
-	//}
-	//取到数据后就直接返回了,没有后续了
 	if accessToken != "" {
 		return
 	}
 
-	//缓存中没有取到数据,那么需要去强制刷新新的accessToken
 	return refreshWxAccessToken(wxAppId, wxAppSecret)
 }
 
-// refreshWxAccessToken 强制刷新微信token
 func refreshWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err error, errMsg string) {
 	fmt.Println("强制刷新" + wxAppId + "微信token")
 	defer func() {
@@ -148,7 +134,6 @@ func refreshWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err
 		return
 	}
 
-	//调用微信官方接口获取新的accessToken
 	wxAccessToken, tmpErr := models.GetWxToken(wxAppId, wxAppSecret)
 	if tmpErr != nil {
 		err = tmpErr
@@ -156,7 +141,6 @@ func refreshWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err
 		return
 	}
 
-	//如果没有token数据
 	if wxAccessToken.AccessToken == "" {
 		errMsg = "微信返回的accessToken异常: Err:" + wxAccessToken.Errmsg
 		err = errors.New(errMsg)
@@ -164,17 +148,7 @@ func refreshWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err
 	}
 
 	accessToken = wxAccessToken.AccessToken
-	////如果是弘则研究的appid,那么需要更新mysql的accessToken
-	//if wxAppId == utils.WxAppId {
-	//	expiresIn := time.Now().Add(time.Duration(wxAccessToken.ExpiresIn) * time.Second).Unix()
-	//	err = models.ModifyAccessToken(wxAccessToken.AccessToken, expiresIn)
-	//	if err != nil {
-	//		errMsg = "更新mysql中的accessToken失败 Err:" + err.Error()
-	//		return
-	//	}
-	//}
-
-	//更新redis的accessToken(过期时间提前十分钟)
+
 	redisTimeExpire := time.Duration(wxAccessToken.ExpiresIn-600) * time.Second
 	err = utils.Rc.Put(redisKey, accessToken, redisTimeExpire)
 	if err != nil {
@@ -185,16 +159,7 @@ func refreshWxAccessToken(wxAppId, wxAppSecret string) (accessToken string, err
 	return
 }
 
-// 根据微信appid获取对应的缓存key
 func getRedisKeyByAppid(wxAppId string) (redisKey string) {
 	redisKey = utils.ETA_WX_ACCESS_TOEKN + wxAppId
-	//switch wxAppId {
-	//case utils.WxAppId:
-	//	redisKey = utils.CACHE_WX_ACCESS_TOKEN_HZ
-	//case utils.AdminWxAppId:
-	//	redisKey = utils.HZ_ADMIN_WX_ACCESS_TOEKN + wxAppId
-	//default:
-	//	redisKey = utils.HZ_ADMIN_WX_ACCESS_TOEKN + wxAppId
-	//}
 	return redisKey
 }

+ 0 - 43
utils/common.go

@@ -20,7 +20,6 @@ import (
 	"time"
 )
 
-// 随机数种子
 var rnd = rand.New(rand.NewSource(time.Now().UnixNano()))
 
 func GetRandString(size int) string {
@@ -57,24 +56,20 @@ func StringsToJSON(str string) string {
 	return jsons
 }
 
-// 序列化
 func ToString(v interface{}) string {
 	data, _ := json.Marshal(v)
 	return string(data)
 }
 
-// md5加密
 func MD5(data string) string {
 	m := md5.Sum([]byte(data))
 	return hex.EncodeToString(m[:])
 }
 
-// 获取数字随机字符
 func GetRandDigit(n int) string {
 	return fmt.Sprintf("%0"+strconv.Itoa(n)+"d", rnd.Intn(int(math.Pow10(n))))
 }
 
-// 获取随机数
 func GetRandNumber(n int) int {
 	return rnd.Intn(n)
 }
@@ -91,14 +86,12 @@ func GetToday(format string) string {
 	return today
 }
 
-// 获取今天剩余秒数
 func GetTodayLastSecond() time.Duration {
 	today := GetToday(FormatDate) + " 23:59:59"
 	end, _ := time.ParseInLocation(FormatDateTime, today, time.Local)
 	return time.Duration(end.Unix()-time.Now().Local().Unix()) * time.Second
 }
 
-// 处理出生日期函数
 func GetBrithDate(idcard string) string {
 	l := len(idcard)
 	var s string
@@ -113,7 +106,6 @@ func GetBrithDate(idcard string) string {
 	return GetToday(FormatDate)
 }
 
-// 处理性别
 func WhichSexByIdcard(idcard string) string {
 	var sexs = [2]string{"女", "男"}
 	length := len(idcard)
@@ -127,7 +119,6 @@ func WhichSexByIdcard(idcard string) string {
 	return "男"
 }
 
-// 截取小数点后几位
 func SubFloatToString(f float64, m int) string {
 	n := strconv.FormatFloat(f, 'f', -1, 64)
 	if n == "" {
@@ -146,14 +137,12 @@ func SubFloatToString(f float64, m int) string {
 	return newn[0] + "." + newn[1][:m]
 }
 
-// 截取小数点后几位
 func SubFloatToFloat(f float64, m int) float64 {
 	newn := SubFloatToString(f, m)
 	newf, _ := strconv.ParseFloat(newn, 64)
 	return newf
 }
 
-// 获取相差时间-年
 func GetYearDiffer(start_time, end_time string) int {
 	t1, _ := time.ParseInLocation("2006-01-02", start_time, time.Local)
 	t2, _ := time.ParseInLocation("2006-01-02", end_time, time.Local)
@@ -164,7 +153,6 @@ func GetYearDiffer(start_time, end_time string) int {
 	return age
 }
 
-// 获取相差时间-秒
 func GetSecondDifferByTime(start_time, end_time time.Time) int64 {
 	diff := end_time.Unix() - start_time.Unix()
 	return diff
@@ -176,7 +164,6 @@ func FixFloat(f float64, m int) float64 {
 	return newf
 }
 
-// 将字符串数组转化为逗号分割的字符串形式  ["str1","str2","str3"] >>> "str1,str2,str3"
 func StrListToString(strList []string) (str string) {
 	if len(strList) > 0 {
 		for k, v := range strList {
@@ -191,38 +178,26 @@ func StrListToString(strList []string) (str string) {
 	return ""
 }
 
-// Token
-//func GetToken() string {
-//	randStr := GetRandString(64)
-//	token := MD5(randStr + Md5Key)
-//	tokenLen := 64 - len(token)
-//	return strings.ToUpper(token + GetRandString(tokenLen))
-//}
 
-// 数据没有记录
 func ErrNoRow() string {
 	return "<QuerySeter> no row found"
 }
 
-// 校验邮箱格式
 func ValidateEmailFormatat(email string) bool {
 	reg := regexp.MustCompile(RegularEmail)
 	return reg.MatchString(email)
 }
 
-// 验证是否是手机号
 func ValidateMobileFormatat(mobileNum string) bool {
 	reg := regexp.MustCompile(RegularMobile)
 	return reg.MatchString(mobileNum)
 }
 
-// 判断文件是否存在
 func FileIsExist(filePath string) bool {
 	_, err := os.Stat(filePath)
 	return err == nil || os.IsExist(err)
 }
 
-// 获取图片扩展名
 func GetImgExt(file string) (ext string, err error) {
 	var headerByte []byte
 	headerByte = make([]byte, 8)
@@ -265,17 +240,13 @@ func GetImgExt(file string) (ext string, err error) {
 	return ext, nil
 }
 
-// 保存图片
 func SaveImage(path string, img image.Image) (err error) {
-	//需要保持的文件
 	imgfile, err := os.Create(path)
 	defer imgfile.Close()
-	// 以PNG格式保存文件
 	err = png.Encode(imgfile, img)
 	return err
 }
 
-// 保存base64数据为文件
 func SaveBase64ToFile(content, path string) error {
 	data, err := base64.StdEncoding.DecodeString(content)
 	if err != nil {
@@ -302,7 +273,6 @@ func SaveBase64ToFileBySeek(content, path string) (err error) {
 			return err
 		}
 		n, _ := f.Seek(0, 2)
-		// 从末尾的偏移量开始写入内容
 		_, err = f.WriteAt([]byte(data), n)
 		defer f.Close()
 	} else {
@@ -311,7 +281,6 @@ func SaveBase64ToFileBySeek(content, path string) (err error) {
 			return err
 		}
 		n, _ := f.Seek(0, 2)
-		// 从末尾的偏移量开始写入内容
 		_, err = f.WriteAt([]byte(data), n)
 		defer f.Close()
 	}
@@ -345,7 +314,6 @@ func PageCount(count, pagesize int) int {
 }
 
 func TrimHtml(src string) string {
-	//将HTML标签全转换成小写
 	re, _ := regexp.Compile("\\<[\\S\\s]+?\\>")
 	src = re.ReplaceAllStringFunc(src, strings.ToLower)
 
@@ -359,8 +327,6 @@ func TrimHtml(src string) string {
 	return strings.TrimSpace(src)
 }
 
-//1556164246  ->  2019-04-25 03:50:46 +0000
-//timestamp
 
 func TimeToTimestamp() {
 	fmt.Println(time.Unix(1556164246, 0).Format("2006-01-02 15:04:05"))
@@ -396,7 +362,6 @@ func toFixed(num float64, precision int) float64 {
 	return float64(round(num*output)) / output
 }
 
-// GetWilsonScore returns Wilson Score
 func GetWilsonScore(p, n float64) float64 {
 	if p == 0 && n == 0 {
 		return 0
@@ -405,7 +370,6 @@ func GetWilsonScore(p, n float64) float64 {
 	return toFixed(((p+1.9208)/(p+n)-1.96*math.Sqrt(p*n/(p+n)+0.9604)/(p+n))/(1+3.8416/(p+n)), 2)
 }
 
-// 将中文数字转化成数字,比如 第三百四十五章,返回第345章 不支持一亿及以上
 func ChangeWordsToNum(str string) (numStr string) {
 	words := ([]rune)(str)
 	num := 0
@@ -534,19 +498,12 @@ func GetMaxTradeCode(tradeCode string) (maxTradeCode string, err error) {
 	return
 }
 
-// excel日期字段格式化 yyyy-mm-dd
 func ConvertToFormatDay(excelDaysString string) string {
-	// 2006-01-02 距离 1900-01-01的天数
 	baseDiffDay := 38719 //在网上工具计算的天数需要加2天,什么原因没弄清楚
 	curDiffDay := excelDaysString
 	b, _ := strconv.Atoi(curDiffDay)
-	// 获取excel的日期距离2006-01-02的天数
 	realDiffDay := b - baseDiffDay
-	//fmt.Println("realDiffDay:",realDiffDay)
-	// 距离2006-01-02 秒数
 	realDiffSecond := realDiffDay * 24 * 3600
-	//fmt.Println("realDiffSecond:",realDiffSecond)
-	// 2006-01-02 15:04:05距离1970-01-01 08:00:00的秒数 网上工具可查出
 	baseOriginSecond := 1136185445
 	resultTime := time.Unix(int64(baseOriginSecond+realDiffSecond), 0).Format("2006-01-02")
 	return resultTime

+ 0 - 34
utils/config.go

@@ -13,12 +13,10 @@ var (
 	MYSQL_WEEKLY_URL string //CRM主库
 
 	REDIS_CACHE string //缓存地址
-	//Rc          *cache.Cache //redis缓存
 	Re error       //redis错误
 	Rc RedisClient //redis缓存
 )
 
-// 日志配置
 var (
 	LogPath    string //调用过程中的日志存放地址
 	LogFile    string
@@ -29,37 +27,29 @@ var (
 	LogMaxDays int //日志最大保留天数
 )
 
-// 系统配置
 var (
 	DesKey           string // 加密key
 	EmailSendToUsers string // 邮件提醒人员
 	BusinessCode     string // 商户号
 )
 
-// 公共api内部服务调用
 var (
-	// EtaPubUrl 模板消息推送
 	EtaPubUrl string
 
-	// EtaPubAuthorization 模板推送秘钥
 	EtaPubAuthorization string
 
-	// AlarmMsgUrl 报警服务地址
 	AlarmMsgUrl string
 
 	Report2ImgServerUrl string // 报告详情转图片服务地址
 
-	// ChartLibUrl 图库项目url
 	ChartLibUrl string
 )
 
-// 对象存储客户端
 var (
 	ObjectStorageClient string // 目前有oss minio,默认oss
 	ResourceProxyUrl    string // 代理资源地址
 )
 
-// 阿里云配置
 var (
 	Bucketname       string
 	Endpoint         string
@@ -70,7 +60,6 @@ var (
 	AccessKeySecret  string
 )
 
-// MinIo配置
 var (
 	MinIoBucketname       string
 	MinIoEndpoint         string
@@ -84,7 +73,6 @@ var (
 	MinIoRegion           string
 )
 
-// S3配置
 var (
 	S3Endpoint        string
 	S3BucketName      string
@@ -136,12 +124,6 @@ func init() {
 	if len(REDIS_CACHE) <= 0 {
 		panic(any("redis链接参数没有配置"))
 	}
-	//Rc, Re = cache.NewCache(REDIS_CACHE) //初始化缓存
-	//if Re != nil {
-	//	fmt.Println(Re)
-	//	panic(any(Re))
-	//}
-	// 初始化缓存
 	redisClient, err := initRedis(config["redis_type"], config["beego_cache"])
 	if err != nil {
 		fmt.Println("redis链接异常:", err)
@@ -149,7 +131,6 @@ func init() {
 	}
 	Rc = redisClient
 
-	//日志配置
 	{
 		LogPath = config["log_path"]
 		LogFile = config["log_file"]
@@ -161,42 +142,29 @@ func init() {
 		LogMaxDays, _ = strconv.Atoi(logMaxDaysStr)
 	}
 
-	// 系统配置
 	{
-		// 接口返回加密KEY
 		DesKey = config["des_key"]
 
-		// 邮件提醒人员
 		EmailSendToUsers = config["email_send_to_users"]
 
-		// 商户号
 		BusinessCode = config["business_code"]
 	}
 
-	// 系统内部服务地址
 	{
-		// 发送微信模板消息地址
 		EtaPubUrl = config["eta_pub_url"]
 
-		// 发送微信模板消息地址
 		EtaPubAuthorization = config["eta_pub_authorization"]
 
-		// 报警服务地址
 		AlarmMsgUrl = config["alarm_msg_url"]
 
-		// 报告详情转图片服务地址
 		Report2ImgServerUrl = config["report2img_server_url"]
 
-		// 图表项目域名
 		ChartLibUrl = config["chart_lib_url"]
 
 	}
 
-	// 对象存储客户端
 	ObjectStorageClient = config["object_storage_client"]
-	// 代理资源地址
 	ResourceProxyUrl = config["resource_proxy_url"]
-	// OSS相关
 	{
 		Endpoint = config["endpoint"]
 		Bucketname = config["bucket_name"]
@@ -207,7 +175,6 @@ func init() {
 		AccessKeySecret = config["access_key_secret"]
 	}
 
-	// MinIo相关
 	{
 		MinIoEndpoint = config["minio_endpoint"]
 		MinIoBucketname = config["minio_bucket_name"]
@@ -221,7 +188,6 @@ func init() {
 		MinIoRegion = config["minio_region"]
 	}
 
-	// S3-OSS相关
 	{
 		S3Endpoint = config["s3_endpoint"]
 		S3BucketName = config["s3_bucket_name"]

+ 0 - 9
utils/constants.go

@@ -4,7 +4,6 @@ const (
 	Md5Key = "Ks@h64WJ#tcVgG8$&WlNfqvLAtMgpxWN"
 )
 
-// 常量定义
 const (
 	FormatTime            = "15:04:05"                //时间格式
 	FormatDate            = "2006-01-02"              //日期格式
@@ -25,19 +24,16 @@ const (
 	APPNAME = "ETA报告服务"
 )
 
-// 手机号,电子邮箱正则
 const (
 	RegularMobile = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0-9])|(17[0-9])|(16[0-9])|(19[0-9]))\\d{8}$" //手机号码
 	RegularEmail  = `\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*`                                             //匹配电子邮箱
 )
 
-// 验证码code
 const (
 	REGISTER_CODE = iota + 1 //注册
 	LOGIN_CODE               //登录
 )
 
-// 聚合短信
 var (
 	JhGnTplId = "65692" //聚合国内模板编码
 	JhGjTplId = "10054" //聚合国内模板编码
@@ -46,7 +42,6 @@ var (
 	JhGjAppKey = "3326ad2c1047a4cd92ace153e6044ca3"
 )
 
-// 科大讯飞--语音合成
 const (
 	XfSTATUS_FIRST_FRAME    = 0 //第一帧标识
 	XfSTATUS_CONTINUE_FRAME = 1 //中间帧标识
@@ -59,7 +54,6 @@ const (
 	XfHost                  = "tts-api.xfyun.cn"
 )
 
-// 客户状态
 const (
 	COMPANY_STATUS_TRY_OUT   = "试用"
 	COMPANY_STATUS_FOREVER   = "永续"
@@ -69,7 +63,6 @@ const (
 	COMPANY_STATUS_POTENTIAL = "潜在"
 )
 
-// 缓存key
 const (
 	CACHE_KEY_USER_VIEW = "user_view_record" //用户阅读数据
 )
@@ -82,7 +75,6 @@ const (
 	CACHE_CREATE_REPORT_IMGPDF_QUEUE = "eta_report:report_img_pdf_queue" // 生成报告长图PDF队列
 )
 
-// 缓存key
 const (
 	CACHE_WX_ACCESS_TOKEN_HZ   = "wx:accesstoken:hzyj" //弘则研究公众号 微信accessToken
 	HZ_ADMIN_WX_ACCESS_TOEKN   = "hz_admin:wx:access_token:"
@@ -90,7 +82,6 @@ const (
 	ETA_WX_ACCESS_TOEKN        = "eta:wx:access_token:"
 )
 
-// 商户号
 const (
 	BusinessCodeSandbox = "E2023080700" // 试用平台
 	BusinessCodeRelease = "E2023080900" // 生产环境

+ 0 - 11
utils/des3.go

@@ -1,4 +1,3 @@
-// 加密工具类,用了3des和base64
 package utils
 
 import (
@@ -11,7 +10,6 @@ import (
 	"strings"
 )
 
-// des3 + base64 encrypt
 func DesBase64Encrypt(origData []byte, desKey string) []byte {
 	result, err := TripleDesEncrypt(origData, []byte(desKey))
 	if err != nil {
@@ -36,21 +34,18 @@ func DesBase64Decrypt(crypted []byte, desKey string) []byte {
 	return origData
 }
 
-// 3DES加密
 func TripleDesEncrypt(origData, key []byte) ([]byte, error) {
 	block, err := des.NewTripleDESCipher(key)
 	if err != nil {
 		return nil, err
 	}
 	origData = PKCS5Padding(origData, block.BlockSize())
-	// origData = ZeroPadding(origData, block.BlockSize())
 	blockMode := cipher.NewCBCEncrypter(block, key[:8])
 	crypted := make([]byte, len(origData))
 	blockMode.CryptBlocks(crypted, origData)
 	return crypted, nil
 }
 
-// 3DES解密
 func TripleDesDecrypt(crypted, key []byte) ([]byte, error) {
 	block, err := des.NewTripleDESCipher(key)
 	if err != nil {
@@ -58,10 +53,8 @@ func TripleDesDecrypt(crypted, key []byte) ([]byte, error) {
 	}
 	blockMode := cipher.NewCBCDecrypter(block, key[:8])
 	origData := make([]byte, len(crypted))
-	// origData := crypted
 	blockMode.CryptBlocks(origData, crypted)
 	origData = PKCS5UnPadding(origData)
-	// origData = ZeroUnPadding(origData)
 	return origData, nil
 }
 
@@ -85,12 +78,10 @@ func PKCS5Padding(ciphertext []byte, blockSize int) []byte {
 
 func PKCS5UnPadding(origData []byte) []byte {
 	length := len(origData)
-	// 去掉最后一个字节 unpadding 次
 	unpadding := int(origData[length-1])
 	return origData[:(length - unpadding)]
 }
 
-// DES加密
 func DesEncrypt(content string, key string) string {
 	contents := []byte(content)
 	keys := []byte(key)
@@ -117,7 +108,6 @@ func byteToHexString(bytes []byte) string {
 	return str
 }
 
-// DES解密
 func DesDecrypt(content string, key string) string {
 	contentBytes, err := hex.DecodeString(content)
 	if err != nil {
@@ -135,7 +125,6 @@ func DesDecrypt(content string, key string) string {
 	return string(origData)
 }
 
-// DES ECB PKCK5Padding
 func EntryptDesECB(data, key []byte) (string, error) {
 	if len(key) > 8 {
 		key = key[:8]

+ 0 - 2
utils/email.go

@@ -5,7 +5,6 @@ import (
 	"strings"
 )
 
-//发送邮件
 func SendEmail(title, content string, touser string) bool {
 	var arr []string
 	sub := strings.Index(touser, ";")
@@ -29,7 +28,6 @@ func SendEmail(title, content string, touser string) bool {
 	return true
 }
 
-//发送邮件
 func SendEmailByHz(title, content string, touser string) (result bool, err error) {
 	var arr []string
 	sub := strings.Index(touser, ";")

+ 0 - 2
utils/jwt.go

@@ -12,7 +12,6 @@ var (
 	KEY = []byte("5Mb5Gdmb5x")
 )
 
-// 发放token
 func GenToken(account string) string {
 	token := jwt.New(jwt.SigningMethodHS256)
 	token.Claims = &jwt.StandardClaims{
@@ -29,7 +28,6 @@ func GenToken(account string) string {
 	return ss
 }
 
-// 校验token
 func CheckToken(account, token string) bool {
 	t, err := jwt.Parse(token, func(*jwt.Token) (interface{}, error) {
 		return KEY, nil

+ 0 - 8
utils/logs.go

@@ -31,7 +31,6 @@ func init() {
 	}
 	os.MkdirAll(logPath, os.ModePerm)
 
-	// 打开文件
 	logFileName := path.Join(logPath, logFile)
 	FileLog = logs.NewLogger(1000000)
 	logConf := getDefaultLogConfig()
@@ -54,12 +53,9 @@ type logConfig struct {
 	Rotate   bool   `json:"rotate" description:"是否开启 logrotate,默认是 true"`
 	Level    int    `json:"level" description:"日志保存的时候的级别,默认是 Trace 级别"`
 	Color    bool   `json:"color" description:"日志是否输出颜色"`
-	//Perm     string `json:"perm" description:"日志文件权限"`
 }
 
 func initBinlog() {
-	//binlog日志
-	//binlog日志
 	binlogPath := BinLogPath
 	if binlogPath == "" {
 		binlogPath = DefaultBinlogPath
@@ -74,8 +70,6 @@ func initBinlog() {
 	logConf := getDefaultLogConfig()
 
 	logConf.FileName = logFileName
-	//logConf.MaxLines = 10000000
-	//logConf.Rotate = true
 	b, _ := json.Marshal(logConf)
 	Binlog.SetLogger(logs.AdapterFile, string(b))
 	Binlog.EnableFuncCallDepth(true)
@@ -92,7 +86,6 @@ func initApiLog() {
 	}
 	os.MkdirAll(logPath, os.ModePerm)
 
-	// 打开文件
 	logFileName := path.Join(logPath, logFile)
 	ApiLog = logs.NewLogger(1000000)
 	logConf := getDefaultLogConfig()
@@ -112,6 +105,5 @@ func getDefaultLogConfig() logConfig {
 		MaxDays:  LogMaxDays, //我就是喜欢31天,咋滴,不喜欢你就自己改-_-!
 		Rotate:   true,
 		Level:    logs.LevelTrace,
-		//Perm:     "",
 	}
 }

+ 0 - 92
utils/redis/cluster_redis.go

@@ -10,30 +10,19 @@ import (
 	"time"
 )
 
-// ClusterRedisClient
-// @Description: 集群的redis客户端
 type ClusterRedisClient struct {
 	redisClient *redis.ClusterClient
 }
 
 var DefaultKey = "zcmRedis"
 
-// InitClusterRedis
-// @Description: 初始化集群redis客户端
-// @param config
-// @return clusterRedisClient
-// @return err
 func InitClusterRedis(config string) (clusterRedisClient *ClusterRedisClient, err error) {
 	var cf map[string]string
 	err = json.Unmarshal([]byte(config), &cf)
 	if err != nil {
 		return
 	}
-	//if _, ok := cf["key"]; !ok {
-	//	cf["key"] = DefaultKey
-	//}
 
-	// 集群地址
 	connList := make([]string, 0)
 	if _, ok := cf["conn"]; !ok {
 		err = errors.New("config has no conn key")
@@ -46,21 +35,17 @@ func InitClusterRedis(config string) (clusterRedisClient *ClusterRedisClient, er
 		}
 	}
 
-	// 密码
 	if _, ok := cf["password"]; !ok {
 		cf["password"] = ""
 	}
 
-	// 创建 Redis 客户端配置对象
 	clusterOptions := &redis.ClusterOptions{
 		Addrs:    connList, // 设置 Redis 节点的 IP 地址和端口号
 		Password: cf["password"],
 	}
 
-	// 创建 Redis 集群客户端
 	client := redis.NewClusterClient(clusterOptions)
 
-	// 测试连接并获取信息
 	_, err = client.Ping(context.TODO()).Result()
 	if err != nil {
 		err = errors.New("redis 链接失败:" + err.Error())
@@ -72,11 +57,6 @@ func InitClusterRedis(config string) (clusterRedisClient *ClusterRedisClient, er
 	return
 }
 
-// Get
-// @Description: 根据key获取数据(其实是返回的字节编码)
-// @receiver rc
-// @param key
-// @return interface{}
 func (rc *ClusterRedisClient) Get(key string) interface{} {
 	data, err := rc.redisClient.Get(context.TODO(), key).Bytes()
 	if err != nil {
@@ -86,49 +66,24 @@ func (rc *ClusterRedisClient) Get(key string) interface{} {
 	return data
 }
 
-// RedisBytes
-// @Description: 根据key获取字节编码数据
-// @receiver rc
-// @param key
-// @return data
-// @return err
 func (rc *ClusterRedisClient) RedisBytes(key string) (data []byte, err error) {
 	data, err = rc.redisClient.Get(context.TODO(), key).Bytes()
 
 	return
 }
 
-// RedisString
-// @Description: 根据key获取字符串数据
-// @receiver rc
-// @param key
-// @return data
-// @return err
 func (rc *ClusterRedisClient) RedisString(key string) (data string, err error) {
 	data, err = rc.redisClient.Get(context.TODO(), key).Result()
 
 	return
 }
 
-// RedisInt
-// @Description: 根据key获取int数据
-// @receiver rc
-// @param key
-// @return data
-// @return err
 func (rc *ClusterRedisClient) RedisInt(key string) (data int, err error) {
 	data, err = rc.redisClient.Get(context.TODO(), key).Int()
 
 	return
 }
 
-// Put
-// @Description: put一个数据到redis
-// @receiver rc
-// @param key
-// @param val
-// @param timeout
-// @return error
 func (rc *ClusterRedisClient) Put(key string, val interface{}, timeout time.Duration) error {
 	var err error
 	err = rc.redisClient.SetEX(context.TODO(), key, val, timeout).Err()
@@ -141,13 +96,6 @@ func (rc *ClusterRedisClient) Put(key string, val interface{}, timeout time.Dura
 	return err
 }
 
-// SetNX
-// @Description: 设置一个会过期时间的值
-// @receiver rc
-// @param key
-// @param val
-// @param timeout
-// @return bool
 func (rc *ClusterRedisClient) SetNX(key string, val interface{}, timeout time.Duration) bool {
 	result, err := rc.redisClient.SetNX(context.TODO(), key, val, timeout).Result()
 	if err != nil {
@@ -157,11 +105,6 @@ func (rc *ClusterRedisClient) SetNX(key string, val interface{}, timeout time.Du
 	return result
 }
 
-// Delete
-// @Description: 删除redis中的键值对
-// @receiver rc
-// @param key
-// @return error
 func (rc *ClusterRedisClient) Delete(key string) error {
 	var err error
 
@@ -175,11 +118,6 @@ func (rc *ClusterRedisClient) Delete(key string) error {
 	return err
 }
 
-// IsExist
-// @Description: 根据key判断是否写入缓存中
-// @receiver rc
-// @param key
-// @return bool
 func (rc *ClusterRedisClient) IsExist(key string) bool {
 	result, err := rc.redisClient.Exists(context.TODO(), key).Result()
 	if err != nil {
@@ -193,12 +131,6 @@ func (rc *ClusterRedisClient) IsExist(key string) bool {
 	return true
 }
 
-// LPush
-// @Description: 写入list
-// @receiver rc
-// @param key
-// @param val
-// @return error
 func (rc *ClusterRedisClient) LPush(key string, val interface{}) error {
 	data, _ := json.Marshal(val)
 	err := rc.redisClient.LPush(context.TODO(), key, data).Err()
@@ -206,11 +138,6 @@ func (rc *ClusterRedisClient) LPush(key string, val interface{}) error {
 	return err
 }
 
-// Brpop
-// @Description: 从list中读取
-// @receiver rc
-// @param key
-// @param callback
 func (rc *ClusterRedisClient) Brpop(key string, callback func([]byte)) {
 	values, err := rc.redisClient.BRPop(context.TODO(), 1*time.Second, key).Result()
 	if err != nil {
@@ -225,11 +152,6 @@ func (rc *ClusterRedisClient) Brpop(key string, callback func([]byte)) {
 
 }
 
-// GetRedisTTL
-// @Description: 获取key的过期时间
-// @receiver rc
-// @param key
-// @return time.Duration
 func (rc *ClusterRedisClient) GetRedisTTL(key string) time.Duration {
 	value, err := rc.redisClient.TTL(context.TODO(), key).Result()
 	if err != nil {
@@ -240,24 +162,10 @@ func (rc *ClusterRedisClient) GetRedisTTL(key string) time.Duration {
 
 }
 
-// Incrby
-// @Description: 设置自增值
-// @receiver rc
-// @param key
-// @param num
-// @return interface{}
-// @return error
 func (rc *ClusterRedisClient) Incrby(key string, num int) (interface{}, error) {
 	return rc.redisClient.IncrBy(context.TODO(), key, int64(num)).Result()
 }
 
-// Do
-// @Description: cmd执行redis命令
-// @receiver rc
-// @param commandName
-// @param args
-// @return reply
-// @return err
 func (rc *ClusterRedisClient) Do(commandName string, args ...interface{}) (reply interface{}, err error) {
 	newArgs := []interface{}{commandName}
 	newArgs = append(newArgs, args...)

+ 0 - 86
utils/redis/standalone_redis.go

@@ -10,8 +10,6 @@ import (
 	"time"
 )
 
-// StandaloneRedisClient
-// @Description: 单机redis客户端
 type StandaloneRedisClient struct {
 	redisClient *redis.Client
 }
@@ -22,18 +20,13 @@ func InitStandaloneRedis(config string) (standaloneRedis *StandaloneRedisClient,
 	if err != nil {
 		return
 	}
-	//if _, ok := cf["key"]; !ok {
-	//	cf["key"] = DefaultKey
-	//}
 
 	if _, ok := cf["conn"]; !ok {
 		err = errors.New("config has no conn key")
 		return
 	}
 
-	// db库
 	dbNum := 0
-	// 如果指定了db库
 	if _, ok := cf["dbNum"]; ok {
 		dbNum, err = strconv.Atoi(cf["dbNum"])
 		if err != nil {
@@ -41,7 +34,6 @@ func InitStandaloneRedis(config string) (standaloneRedis *StandaloneRedisClient,
 		}
 	}
 
-	// 密码
 	if _, ok := cf["password"]; !ok {
 		cf["password"] = ""
 	}
@@ -50,7 +42,6 @@ func InitStandaloneRedis(config string) (standaloneRedis *StandaloneRedisClient,
 		Addr:     cf["conn"],
 		Password: cf["password"],
 		DB:       dbNum,
-		//PoolSize: 10, //连接池最大socket连接数,默认为10倍CPU数, 10 * runtime.NumCPU(暂不配置)
 	})
 
 	_, err = client.Ping(context.TODO()).Result()
@@ -64,11 +55,6 @@ func InitStandaloneRedis(config string) (standaloneRedis *StandaloneRedisClient,
 	return
 }
 
-// Get
-// @Description: 根据key获取数据(其实是返回的字节编码)
-// @receiver rc
-// @param key
-// @return interface{}
 func (rc *StandaloneRedisClient) Get(key string) interface{} {
 	data, err := rc.redisClient.Get(context.TODO(), key).Bytes()
 	if err != nil {
@@ -78,49 +64,24 @@ func (rc *StandaloneRedisClient) Get(key string) interface{} {
 	return data
 }
 
-// RedisBytes
-// @Description: 根据key获取字节编码数据
-// @receiver rc
-// @param key
-// @return data
-// @return err
 func (rc *StandaloneRedisClient) RedisBytes(key string) (data []byte, err error) {
 	data, err = rc.redisClient.Get(context.TODO(), key).Bytes()
 
 	return
 }
 
-// RedisString
-// @Description: 根据key获取字符串数据
-// @receiver rc
-// @param key
-// @return data
-// @return err
 func (rc *StandaloneRedisClient) RedisString(key string) (data string, err error) {
 	data, err = rc.redisClient.Get(context.TODO(), key).Result()
 
 	return
 }
 
-// RedisInt
-// @Description: 根据key获取int数据
-// @receiver rc
-// @param key
-// @return data
-// @return err
 func (rc *StandaloneRedisClient) RedisInt(key string) (data int, err error) {
 	data, err = rc.redisClient.Get(context.TODO(), key).Int()
 
 	return
 }
 
-// Put
-// @Description: put一个数据到redis
-// @receiver rc
-// @param key
-// @param val
-// @param timeout
-// @return error
 func (rc *StandaloneRedisClient) Put(key string, val interface{}, timeout time.Duration) error {
 	var err error
 	err = rc.redisClient.SetEX(context.TODO(), key, val, timeout).Err()
@@ -133,13 +94,6 @@ func (rc *StandaloneRedisClient) Put(key string, val interface{}, timeout time.D
 	return err
 }
 
-// SetNX
-// @Description: 设置一个会过期时间的值
-// @receiver rc
-// @param key
-// @param val
-// @param timeout
-// @return bool
 func (rc *StandaloneRedisClient) SetNX(key string, val interface{}, timeout time.Duration) bool {
 	result, err := rc.redisClient.SetNX(context.TODO(), key, val, timeout).Result()
 	if err != nil {
@@ -149,11 +103,6 @@ func (rc *StandaloneRedisClient) SetNX(key string, val interface{}, timeout time
 	return result
 }
 
-// Delete
-// @Description: 删除redis中的键值对
-// @receiver rc
-// @param key
-// @return error
 func (rc *StandaloneRedisClient) Delete(key string) error {
 	var err error
 
@@ -167,11 +116,6 @@ func (rc *StandaloneRedisClient) Delete(key string) error {
 	return err
 }
 
-// IsExist
-// @Description: 根据key判断是否写入缓存中
-// @receiver rc
-// @param key
-// @return bool
 func (rc *StandaloneRedisClient) IsExist(key string) bool {
 	result, err := rc.redisClient.Exists(context.TODO(), key).Result()
 	if err != nil {
@@ -185,12 +129,6 @@ func (rc *StandaloneRedisClient) IsExist(key string) bool {
 	return true
 }
 
-// LPush
-// @Description: 写入list
-// @receiver rc
-// @param key
-// @param val
-// @return error
 func (rc *StandaloneRedisClient) LPush(key string, val interface{}) error {
 	data, _ := json.Marshal(val)
 	err := rc.redisClient.LPush(context.TODO(), key, data).Err()
@@ -198,11 +136,6 @@ func (rc *StandaloneRedisClient) LPush(key string, val interface{}) error {
 	return err
 }
 
-// Brpop
-// @Description: 从list中读取
-// @receiver rc
-// @param key
-// @param callback
 func (rc *StandaloneRedisClient) Brpop(key string, callback func([]byte)) {
 	values, err := rc.redisClient.BRPop(context.TODO(), 1*time.Second, key).Result()
 	if err != nil {
@@ -217,11 +150,6 @@ func (rc *StandaloneRedisClient) Brpop(key string, callback func([]byte)) {
 
 }
 
-// GetRedisTTL
-// @Description: 获取key的过期时间
-// @receiver rc
-// @param key
-// @return time.Duration
 func (rc *StandaloneRedisClient) GetRedisTTL(key string) time.Duration {
 	value, err := rc.redisClient.TTL(context.TODO(), key).Result()
 	if err != nil {
@@ -232,24 +160,10 @@ func (rc *StandaloneRedisClient) GetRedisTTL(key string) time.Duration {
 
 }
 
-// Incrby
-// @Description: 设置自增值
-// @receiver rc
-// @param key
-// @param num
-// @return interface{}
-// @return error
 func (rc *StandaloneRedisClient) Incrby(key string, num int) (interface{}, error) {
 	return rc.redisClient.IncrBy(context.TODO(), key, int64(num)).Result()
 }
 
-// Do
-// @Description: cmd执行redis命令
-// @receiver rc
-// @param commandName
-// @param args
-// @return reply
-// @return err
 func (rc *StandaloneRedisClient) Do(commandName string, args ...interface{}) (reply interface{}, err error) {
 	newArgs := []interface{}{commandName}
 	newArgs = append(newArgs, args...)