|
@@ -10,6 +10,7 @@ import (
|
|
|
"hongze/hongze_yb/logic"
|
|
|
"hongze/hongze_yb/models/request"
|
|
|
respond "hongze/hongze_yb/models/response"
|
|
|
+ "hongze/hongze_yb/models/tables/banner"
|
|
|
"hongze/hongze_yb/models/tables/banner_view_history"
|
|
|
"hongze/hongze_yb/models/tables/company"
|
|
|
"hongze/hongze_yb/models/tables/wx_user"
|
|
@@ -372,10 +373,10 @@ func BannerMark(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if req.BannerUrl == "" {
|
|
|
- response.FailMsg("参数有误", "BannerUrl不能为空", c)
|
|
|
- return
|
|
|
- }
|
|
|
+ //if req.BannerUrl == "" {
|
|
|
+ // response.FailMsg("参数有误", "BannerUrl不能为空", c)
|
|
|
+ // return
|
|
|
+ //}
|
|
|
|
|
|
if req.FirstSource <= 0 {
|
|
|
response.FailMsg("参数有误", "FirstSource不能为空", c)
|
|
@@ -386,6 +387,16 @@ func BannerMark(c *gin.Context) {
|
|
|
response.FailMsg("参数有误", "SecondSource", c)
|
|
|
}
|
|
|
|
|
|
+ if req.Id <= 0 {
|
|
|
+ response.FailMsg("参数有误", "Id错误", c)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ item, err := banner.GetBannerById(req.Id)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("GetByUserId:", err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
// 联系人信息
|
|
|
strInt64 := strconv.FormatUint(userInfo.UserID, 10)
|
|
@@ -416,7 +427,7 @@ func BannerMark(c *gin.Context) {
|
|
|
LastUpdatedTime: time.Now(),
|
|
|
FirstSource: req.FirstSource,
|
|
|
SecondSource: req.SecondSource,
|
|
|
- BannerUrl: "https://hzstatic.hzinsights.com/yb_xcx/banner.png",
|
|
|
+ BannerUrl: item.ImageUrlPc,
|
|
|
}
|
|
|
err = banner_view_history.AddBannerViewHistory()
|
|
|
if err != nil {
|
|
@@ -425,3 +436,25 @@ func BannerMark(c *gin.Context) {
|
|
|
|
|
|
response.Ok("成功", c)
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+// BannerList banner图列表
|
|
|
+// @Tags 公共模块
|
|
|
+// @Summary banner图列表
|
|
|
+// @Description banner图列表
|
|
|
+// @Security ApiKeyAuth
|
|
|
+// @securityDefinitions.basic BasicAuth
|
|
|
+// @Accept json
|
|
|
+// @Product json
|
|
|
+// @Success 200 {string} string 获取验证码成功
|
|
|
+// @Failure 400 {string} string 请输入邮箱地址
|
|
|
+// @Router /banner/list [get]
|
|
|
+func BannerList(c *gin.Context) {
|
|
|
+ list, err := banner.GetBannerList()
|
|
|
+ if err != nil {
|
|
|
+ response.FailMsg("获取失败", "获取banner失败, Err: "+err.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ response.OkData("获取成功", list, c)
|
|
|
+}
|