浏览代码

no message

zhangchuanxing 5 天之前
父节点
当前提交
833e6b5d50
共有 1 个文件被更改,包括 29 次插入0 次删除
  1. 29 0
      controllers/jinmencaijing.go

+ 29 - 0
controllers/jinmencaijing.go

@@ -2,13 +2,16 @@ package controllers
 
 import (
 	"encoding/json"
+	"fmt"
 	jinmencaijingReq "hongze/hongze_open_api/models/request/jinmencaijing"
 	"hongze/hongze_open_api/models/response/jinmencaijing"
 	"hongze/hongze_open_api/models/tables/company"
 	"hongze/hongze_open_api/models/tables/company_product"
 	"hongze/hongze_open_api/models/tables/company_report_permission"
 	cygxActivity "hongze/hongze_open_api/models/tables/cygx/cygx_activity"
+	"hongze/hongze_open_api/models/tables/cygx/cygx_three_api_log"
 	"hongze/hongze_open_api/models/tables/wx_user"
+	"hongze/hongze_open_api/services/alarm_msg"
 	servicesWxUser "hongze/hongze_open_api/services/wx_user"
 	"hongze/hongze_open_api/utils"
 	"strconv"
@@ -65,6 +68,19 @@ func (c *JinMenCaiJingController) ActivityDetail() {
 	detail.ReportLink = activityInfo.ReportLink
 	detail.Theme = activityInfo.Theme
 	detail.Remarks = activityInfo.Remarks
+	//添加请求日志记录
+	itemApiLog := new(cygx_three_api_log.CygxThreeApiLog)
+	itemApiLog.CreateTime = time.Now()
+	itemApiLog.Source = 2
+	itemApiLog.Url = c.Ctx.Input.URI()
+
+	jsonstr := strconv.Itoa(activityId)
+	itemApiLog.Body = fmt.Sprint(jsonstr)
+	itemApiLog.Result = fmt.Sprint(detail)
+	_, errlog := cygx_three_api_log.AddCygxThreeApiLog(itemApiLog)
+	if errlog != nil {
+		go alarm_msg.SendAlarmMsg("进门财经活动详情接口 AddCygxThreeApiLog:"+errlog.Error()+fmt.Sprint("activityId=", activityId), 3)
+	}
 	c.OkDetailed(detail, "获取成功")
 }
 
@@ -293,6 +309,19 @@ func (c *JinMenCaiJingController) ActivityWhiteCheck() {
 			}
 		}
 	}
+	//添加请求日志记录
+	itemApiLog := new(cygx_three_api_log.CygxThreeApiLog)
+	itemApiLog.CreateTime = time.Now()
+	itemApiLog.Source = 2
+	itemApiLog.Url = c.Ctx.Input.URI()
+	data, _ := json.Marshal(req)
+	jsonstr := string(data)
+	itemApiLog.Body = fmt.Sprint(jsonstr, "deMobile=", deMobile)
+	itemApiLog.Result = fmt.Sprint(resp)
+	_, errlog := cygx_three_api_log.AddCygxThreeApiLog(itemApiLog)
+	if errlog != nil {
+		go alarm_msg.SendAlarmMsg("进门财经活动白名单接口 AddCygxThreeApiLog:"+errlog.Error()+fmt.Sprint("activityId=", activityId), 3)
+	}
 	c.OkDetailed(resp, "获取成功")
 }