|
@@ -453,11 +453,52 @@ func BannerMark(c *gin.Context) {
|
|
// @Failure 400 {string} string 请输入邮箱地址
|
|
// @Failure 400 {string} string 请输入邮箱地址
|
|
// @Router /banner/list [get]
|
|
// @Router /banner/list [get]
|
|
func BannerList(c *gin.Context) {
|
|
func BannerList(c *gin.Context) {
|
|
- list, err := banner.GetBannerList()
|
|
|
|
|
|
+ isHomepage, _ := strconv.Atoi(c.Query("is_homepage"))
|
|
|
|
+ cond := " enable=1 "
|
|
|
|
+ if isHomepage != 1 {
|
|
|
|
+ cond = " AND id <> 9999"
|
|
|
|
+ }
|
|
|
|
+ list, err := banner.GetBannerList(cond)
|
|
if err != nil {
|
|
if err != nil {
|
|
response.FailMsg("获取失败", "获取banner失败, Err: "+err.Error(), c)
|
|
response.FailMsg("获取失败", "获取banner失败, Err: "+err.Error(), c)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
response.OkData("获取成功", list, c)
|
|
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)
|
|
}
|
|
}
|