|
@@ -352,7 +352,6 @@ func GetTelAreaList(c *gin.Context) {
|
|
|
response.OkData("获取成功", respList, c)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// BannerMark banner图埋点
|
|
|
// @Tags 公共模块
|
|
|
// @Summary banner图埋点
|
|
@@ -391,7 +390,6 @@ func BannerMark(c *gin.Context) {
|
|
|
response.FailMsg("参数有误", "Id错误", c)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
item, err := banner.GetBannerById(req.Id)
|
|
|
if err != nil {
|
|
|
fmt.Println("GetByUserId:", err.Error())
|
|
@@ -440,7 +438,6 @@ func BannerMark(c *gin.Context) {
|
|
|
response.Ok("成功", c)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// BannerList banner图列表
|
|
|
// @Tags 公共模块
|
|
|
// @Summary banner图列表
|
|
@@ -454,11 +451,21 @@ func BannerMark(c *gin.Context) {
|
|
|
// @Router /banner/list [get]
|
|
|
func BannerList(c *gin.Context) {
|
|
|
isHomepage, _ := strconv.Atoi(c.Query("is_homepage"))
|
|
|
- cond := " enable=1 "
|
|
|
+ page, _ := strconv.Atoi(c.Query("page"))
|
|
|
+ limit, _ := strconv.Atoi(c.Query("limit"))
|
|
|
+ enable, _ := strconv.Atoi(c.Query("enable"))
|
|
|
+ cond := " "
|
|
|
+ if enable == 0 {
|
|
|
+ cond = " enable = 0 "
|
|
|
+ } else {
|
|
|
+ cond = " enable = 1 "
|
|
|
+ }
|
|
|
+
|
|
|
if isHomepage != 1 {
|
|
|
cond = " AND id <> 9999"
|
|
|
}
|
|
|
- list, err := banner.GetBannerList(cond)
|
|
|
+
|
|
|
+ list, err := banner.GetBannerList(cond, page, limit)
|
|
|
if err != nil {
|
|
|
response.FailMsg("获取失败", "获取banner失败, Err: "+err.Error(), c)
|
|
|
return
|
|
@@ -466,39 +473,3 @@ func BannerList(c *gin.Context) {
|
|
|
|
|
|
response.OkData("获取成功", list, 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_collection/list [get]
|
|
|
-func BannerCollectionList(c *gin.Context) {
|
|
|
- cond := " id <> 9999"
|
|
|
- list, err := banner.GetBannerList(cond)
|
|
|
- if err != nil {
|
|
|
- response.FailMsg("获取失败", "获取banner失败, Err: "+err.Error(), c)
|
|
|
- return
|
|
|
- }
|
|
|
- resp := make([]*respond.BannerRespItem,0)
|
|
|
- nowitem := respond.BannerRespItem{
|
|
|
- Enable: 1,
|
|
|
- }
|
|
|
- historyitem := respond.BannerRespItem{
|
|
|
- Enable: 0,
|
|
|
- }
|
|
|
- for _, v := range list {
|
|
|
- if v.Enable == 1 {
|
|
|
- nowitem.List = append(nowitem.List, v)
|
|
|
- } else {
|
|
|
- historyitem.List = append(historyitem.List, v)
|
|
|
- }
|
|
|
- }
|
|
|
- resp = append(resp, &nowitem, &historyitem)
|
|
|
- response.OkData("获取成功", resp, c)
|
|
|
-}
|