浏览代码

首屏 / 广告

魏熙美 5 年前
父节点
当前提交
eb9076e8d3

+ 18
- 4
src/main/java/com/huiju/estateagents/common/CommConstant.java 查看文件

109
      */
109
      */
110
     public static final Integer ACTIVITY_CONDITION_ONE_THREE = 3;
110
     public static final Integer ACTIVITY_CONDITION_ONE_THREE = 3;
111
 
111
 
112
+    //=================  首屏广告 / 轮播图 start =======================
113
+
112
     /**
114
     /**
113
      * 首页轮播图类型_活动
115
      * 首页轮播图类型_活动
114
      */
116
      */
115
     public static final String CAROUSEL_ACTIVITY = "activity";
117
     public static final String CAROUSEL_ACTIVITY = "activity";
116
 
118
 
117
     /**
119
     /**
118
-     * 首页轮播图类型_项目
120
+     * 首页 轮播图/广告 类型_项目
119
      */
121
      */
120
     public static final String CAROUSEL_PROJECT = "project";
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
     public static final String OPEN_SCREEN = "screen";
132
     public static final String OPEN_SCREEN = "screen";
131
 
133
 
132
     /**
134
     /**
133
-     * 首页轮播图
135
+     * 打开放式_首页轮播图
134
      */
136
      */
135
     public static final String CAROUSEL = "banner";
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 查看文件

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
         return responseBean;
66
         return responseBean;
72
     }
67
     }
73
 
68
 

+ 7
- 4
src/main/java/com/huiju/estateagents/service/IExtendContentService.java 查看文件

23
 
23
 
24
     /**
24
     /**
25
      * 根据状态查当前的轮播图
25
      * 根据状态查当前的轮播图
26
-     * @param extendContent
26
+     * @param contentType
27
+     * @param buildingId
27
      * @return
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
      * @return
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 查看文件

7
 import com.huiju.estateagents.entity.ExtendContent;
7
 import com.huiju.estateagents.entity.ExtendContent;
8
 import com.huiju.estateagents.mapper.ExtendContentMapper;
8
 import com.huiju.estateagents.mapper.ExtendContentMapper;
9
 import com.huiju.estateagents.service.IExtendContentService;
9
 import com.huiju.estateagents.service.IExtendContentService;
10
+import org.apache.commons.lang3.StringUtils;
10
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.stereotype.Service;
12
 import org.springframework.stereotype.Service;
12
 
13
 
33
         }else if("2".equals(extendContent.getContentType())){
34
         }else if("2".equals(extendContent.getContentType())){
34
             extendContent.setContentType(CommConstant.CAROUSEL_PROJECT);
35
             extendContent.setContentType(CommConstant.CAROUSEL_PROJECT);
35
         }else if ("3".equals(extendContent.getContentType())){
36
         }else if ("3".equals(extendContent.getContentType())){
36
-            extendContent.setContentType(CommConstant.CAROUSEL_INFORMATION);
37
+            extendContent.setContentType(CommConstant.CAROUSEL_NEWS);
37
         }
38
         }
38
         extendContentMapper.insert(extendContent);
39
         extendContentMapper.insert(extendContent);
39
         responseBean.addSuccess("成功");
40
         responseBean.addSuccess("成功");
41
     }
42
     }
42
 
43
 
43
     @Override
44
     @Override
44
-    public ResponseBean selectExtendContentList(ExtendContent extendContent) {
45
+    @Deprecated
46
+    public ResponseBean selectExtendContentList(String contentType, String buildingId) {
45
         ResponseBean responseBean = new ResponseBean<>();
47
         ResponseBean responseBean = new ResponseBean<>();
46
         // 查询轮播图
48
         // 查询轮播图
47
         QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
49
         QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
50
+        // banner 或 screen(首屏广告) ,这里是 banner
48
         extendContentQuery.eq("show_position",CommConstant.CAROUSEL);
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
         extendContentQuery.eq("status","1");
55
         extendContentQuery.eq("status","1");
52
         List<ExtendContent> taExtendContent = extendContentMapper.selectList(extendContentQuery);
56
         List<ExtendContent> taExtendContent = extendContentMapper.selectList(extendContentQuery);
53
         responseBean.addSuccess(taExtendContent);
57
         responseBean.addSuccess(taExtendContent);
55
     }
59
     }
56
 
60
 
57
     @Override
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
         ResponseBean responseBean= new ResponseBean<>();
63
         ResponseBean responseBean= new ResponseBean<>();
60
         // 开屏
64
         // 开屏
61
         QueryWrapper<ExtendContent> extendContentQuery= new QueryWrapper<>();
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
         extendContentQuery.eq("status","1");
74
         extendContentQuery.eq("status","1");
66
         ExtendContent taExtendContent = extendContentMapper.selectOne(extendContentQuery);
75
         ExtendContent taExtendContent = extendContentMapper.selectOne(extendContentQuery);
67
         responseBean.addSuccess(taExtendContent);
76
         responseBean.addSuccess(taExtendContent);