|
@@ -5,6 +5,7 @@ import (
|
|
|
"hongze/hongze_yb/controller/response"
|
|
|
"hongze/hongze_yb/models/request"
|
|
|
"hongze/hongze_yb/services/price_driven"
|
|
|
+ "hongze/hongze_yb/services/user"
|
|
|
)
|
|
|
|
|
|
// PriceDrivenDetail 价格驱动详情
|
|
@@ -31,3 +32,30 @@ func PriceDrivenDetail(c *gin.Context) {
|
|
|
}
|
|
|
response.OkData("获取成功", item, c)
|
|
|
}
|
|
|
+
|
|
|
+// PriceDrivenVisitLog 价格驱动访问记录
|
|
|
+// @Tags 价格驱动模块
|
|
|
+// @Description 价格驱动访问记录
|
|
|
+// @Param price_driven_id query int true "价格驱动ID"
|
|
|
+// @Param source_agent query int true "来源"
|
|
|
+// @Success 200 {string} string "操作成功"
|
|
|
+// @failure 400 {string} string "操作失败"
|
|
|
+// @Router /price_driven/visit_log [post]
|
|
|
+func PriceDrivenVisitLog(c *gin.Context) {
|
|
|
+ var req request.PriceDrivenVisitReq
|
|
|
+ if err := c.Bind(&req); err != nil {
|
|
|
+ response.Fail("参数有误", c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if req.PriceDrivenId <= 0 {
|
|
|
+ response.Fail("参数有误", c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ userInfo := user.GetInfoByClaims(c)
|
|
|
+ errMsg, err := price_driven.SavePriceDrivenVisitLog(req.PriceDrivenId, req.SourceAgent, int(userInfo.UserID))
|
|
|
+ if err != nil {
|
|
|
+ response.FailMsg(errMsg, "PriceDrivenVisitLog ErrMsg:"+err.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.Ok("操作成功", c)
|
|
|
+}
|