Selaa lähdekoodia

首屏 / 广告

魏熙美 5 vuotta sitten
vanhempi
commit
eb9076e8d3

+ 18
- 4
src/main/java/com/huiju/estateagents/common/CommConstant.java Näytä tiedosto

@@ -109,29 +109,43 @@ public class CommConstant {
109 109
      */
110 110
     public static final Integer ACTIVITY_CONDITION_ONE_THREE = 3;
111 111
 
112
+    //=================  首屏广告 / 轮播图 start =======================
113
+
112 114
     /**
113 115
      * 首页轮播图类型_活动
114 116
      */
115 117
     public static final String CAROUSEL_ACTIVITY = "activity";
116 118
 
117 119
     /**
118
-     * 首页轮播图类型_项目
120
+     * 首页 轮播图/广告 类型_项目
119 121
      */
120 122
     public static final String CAROUSEL_PROJECT = "project";
121 123
 
122 124
     /**
123 125
      * 首页轮播图类型_资讯
124 126
      */
125
-    public static final String CAROUSEL_INFORMATION = "information";
127
+    public static final String CAROUSEL_NEWS = "news";
126 128
 
127 129
     /**
128
-     * 开屏
130
+     * 打开放式_开屏
129 131
      */
130 132
     public static final String OPEN_SCREEN = "screen";
131 133
 
132 134
     /**
133
-     * 首页轮播图
135
+     * 打开放式_首页轮播图
134 136
      */
135 137
     public static final String CAROUSEL = "banner";
136 138
 
139
+    /**
140
+     * 首屏广告_发布位置——商城
141
+     */
142
+    public static final String MALL = "mall";
143
+
144
+    /**
145
+     * 首屏广告_发布位置——首页
146
+     */
147
+    public static final String BANNER_INDEX = "index";
148
+
149
+    //=================  首屏广告 / 轮播图 end =======================
150
+
137 151
 }

+ 9
- 14
src/main/java/com/huiju/estateagents/controller/ExtendContentController.java Näytä tiedosto

@@ -53,21 +53,16 @@ public class ExtendContentController extends BaseController {
53 53
     }
54 54
 
55 55
     /**
56
-     * 根据状态查当前的轮播图
57
-     * @return
58
-     */
59
-    @RequestMapping(value="/wx/selectExtendContent",method= RequestMethod.GET)
60
-    public ResponseBean extendContentList(@RequestBody ExtendContent extendContent ){
61
-        ResponseBean responseBean= iExtendContentService.selectExtendContentList(extendContent);
62
-        return responseBean;
63
-    }
64
-
65
-    /**
66
-     * 根据状态查当前的开屏
56
+     * 微信 开屏 / 轮播图
67 57
      */
68
-    @RequestMapping(value="/wx/selectExtendContentShowType",method= RequestMethod.GET)
69
-    public ResponseBean extendContentListShowType(@RequestBody ExtendContent extendContent ){
70
-        ResponseBean responseBean= iExtendContentService.selectExtendContentListShowType(extendContent);
58
+    @RequestMapping(value="/wx/extendContent/{showType}",method= RequestMethod.GET)
59
+    public ResponseBean extendContentListShowType(@PathVariable(value = "showType", required = false) String showType,
60
+                                                  @RequestParam(value = "showPosition", required = false) String showPosition,
61
+                                                  @RequestParam(value = "targetId", required = false) String targetId,
62
+                                                  @RequestParam(value = "contentType", required = false) String contentType,
63
+                                                  @RequestParam(value = "buildingId", required = false) String buildingId,
64
+                                                  @RequestParam(value = "contentId", required = false) String contentId){
65
+        ResponseBean responseBean= iExtendContentService.selectExtendContentListShowType(showType, showPosition, targetId,contentType, buildingId, contentId);
71 66
         return responseBean;
72 67
     }
73 68
 

+ 7
- 4
src/main/java/com/huiju/estateagents/service/IExtendContentService.java Näytä tiedosto

@@ -23,15 +23,18 @@ public interface IExtendContentService extends IService<ExtendContent> {
23 23
 
24 24
     /**
25 25
      * 根据状态查当前的轮播图
26
-     * @param extendContent
26
+     * @param contentType
27
+     * @param buildingId
27 28
      * @return
28 29
      */
29
-    ResponseBean selectExtendContentList(ExtendContent extendContent);
30
+    @Deprecated
31
+    ResponseBean selectExtendContentList(String contentType, String buildingId);
30 32
 
31 33
     /**
32 34
      * 开屏
33
-     * @param extendContent
35
+     * @param contentType
36
+     * @param buildingId
34 37
      * @return
35 38
      */
36
-    ResponseBean selectExtendContentListShowType(ExtendContent extendContent);
39
+    ResponseBean selectExtendContentListShowType(String showType, String showPosition, String targetId, String contentType, String buildingId, String contentId);
37 40
 }

+ 17
- 8
src/main/java/com/huiju/estateagents/service/impl/ExtendContentServiceImpl.java Näytä tiedosto

@@ -7,6 +7,7 @@ import com.huiju.estateagents.common.CommConstant;
7 7
 import com.huiju.estateagents.entity.ExtendContent;
8 8
 import com.huiju.estateagents.mapper.ExtendContentMapper;
9 9
 import com.huiju.estateagents.service.IExtendContentService;
10
+import org.apache.commons.lang3.StringUtils;
10 11
 import org.springframework.beans.factory.annotation.Autowired;
11 12
 import org.springframework.stereotype.Service;
12 13
 
@@ -33,7 +34,7 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
33 34
         }else if("2".equals(extendContent.getContentType())){
34 35
             extendContent.setContentType(CommConstant.CAROUSEL_PROJECT);
35 36
         }else if ("3".equals(extendContent.getContentType())){
36
-            extendContent.setContentType(CommConstant.CAROUSEL_INFORMATION);
37
+            extendContent.setContentType(CommConstant.CAROUSEL_NEWS);
37 38
         }
38 39
         extendContentMapper.insert(extendContent);
39 40
         responseBean.addSuccess("成功");
@@ -41,13 +42,16 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
41 42
     }
42 43
 
43 44
     @Override
44
-    public ResponseBean selectExtendContentList(ExtendContent extendContent) {
45
+    @Deprecated
46
+    public ResponseBean selectExtendContentList(String contentType, String buildingId) {
45 47
         ResponseBean responseBean = new ResponseBean<>();
46 48
         // 查询轮播图
47 49
         QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
50
+        // banner 或 screen(首屏广告) ,这里是 banner
48 51
         extendContentQuery.eq("show_position",CommConstant.CAROUSEL);
49
-        extendContentQuery.eq("content_type",extendContent.getContentType());
50
-        extendContentQuery.eq("building_id",extendContent.getBuildingId());
52
+        // activity(活动) 或 project(项目) 或 news(咨迅)
53
+        extendContentQuery.eq("content_type",contentType);
54
+        extendContentQuery.eq("building_id",buildingId);
51 55
         extendContentQuery.eq("status","1");
52 56
         List<ExtendContent> taExtendContent = extendContentMapper.selectList(extendContentQuery);
53 57
         responseBean.addSuccess(taExtendContent);
@@ -55,13 +59,18 @@ public class ExtendContentServiceImpl extends ServiceImpl<ExtendContentMapper, E
55 59
     }
56 60
 
57 61
     @Override
58
-    public ResponseBean selectExtendContentListShowType(ExtendContent extendContent) {
62
+    public ResponseBean selectExtendContentListShowType(String showType, String showPosition, String targetId, String contentType, String buildingId, String contentId) {
59 63
         ResponseBean responseBean= new ResponseBean<>();
60 64
         // 开屏
61 65
         QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
62
-        extendContentQuery.eq("show_type",CommConstant.OPEN_SCREEN);
63
-        extendContentQuery.eq("content_type",extendContent.getContentType());
64
-        extendContentQuery.eq("building_id",extendContent.getBuildingId());
66
+        // banner 或 screen(首屏广告) ,这里是 screen
67
+        extendContentQuery.eq("show_type",showType);
68
+        extendContentQuery.eq(StringUtils.isNotBlank(showPosition), "show_position",showPosition);
69
+        extendContentQuery.eq(StringUtils.isNotBlank(targetId), "target_id",targetId);
70
+        extendContentQuery.eq(StringUtils.isNotBlank(contentId), "content_id",contentId);
71
+        // activity(活动) 或 project(项目) 或 news(咨迅)
72
+        extendContentQuery.eq(StringUtils.isNotBlank(contentType), "content_type",contentType);
73
+        extendContentQuery.eq(StringUtils.isNotBlank(buildingId), "building_id",buildingId);
65 74
         extendContentQuery.eq("status","1");
66 75
         ExtendContent taExtendContent = extendContentMapper.selectOne(extendContentQuery);
67 76
         responseBean.addSuccess(taExtendContent);