|
@@ -2,7 +2,10 @@ package controllers
|
|
|
|
|
|
import (
|
|
|
"hongze/hongze_cygx/models"
|
|
|
+ "hongze/hongze_cygx/models/ficc_report"
|
|
|
"hongze/hongze_cygx/services"
|
|
|
+ "hongze/hongze_cygx/utils"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
type FiccYbController struct {
|
|
@@ -51,3 +54,41 @@ func (this *FiccYbController) Detail() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = detail
|
|
|
}
|
|
|
+
|
|
|
+// @Title 记录点击信息
|
|
|
+// @Description 记录点击信息
|
|
|
+// @Param request body cygx.CygxBannerIdReq true "type json string"
|
|
|
+// @Success 200 Ret=200 发布成功
|
|
|
+// @router /add/xcx/history [post]
|
|
|
+func (this *FiccYbController) AddXcxHistory() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ user := this.User
|
|
|
+ if user == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,用户信息为空"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ historyRecord := new(ficc_report.FiccYbXcxHistory)
|
|
|
+ historyRecord.UserId = user.UserId
|
|
|
+ historyRecord.RealName = user.RealName
|
|
|
+ historyRecord.CreateTime = time.Now()
|
|
|
+ historyRecord.Mobile = user.Mobile
|
|
|
+ historyRecord.Email = user.Email
|
|
|
+ historyRecord.CompanyId = user.CompanyId
|
|
|
+ historyRecord.CompanyName = user.CompanyName
|
|
|
+ historyRecord.RegisterPlatform = utils.REGISTER_PLATFORM
|
|
|
+ historyRecord.SellerName, _, _ = services.GetSellerName(user)
|
|
|
+ _, err := ficc_report.AddFiccYbXcxHistory(historyRecord)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "记录访问信息失败"
|
|
|
+ br.ErrMsg = "记录访问信息失败" + err.Error()
|
|
|
+ }
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "记录成功"
|
|
|
+}
|