|
@@ -1,6 +1,7 @@
|
1
|
1
|
package com.example.wholeestate.controller;
|
2
|
2
|
|
3
|
3
|
|
|
4
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
4
|
5
|
import com.example.wholeestate.common.base.BaseController;
|
5
|
6
|
import com.example.wholeestate.common.resp.ResponseBean;
|
6
|
7
|
import com.example.wholeestate.model.PageImg;
|
|
@@ -9,9 +10,14 @@ import io.swagger.annotations.Api;
|
9
|
10
|
import io.swagger.annotations.ApiImplicitParam;
|
10
|
11
|
import io.swagger.annotations.ApiImplicitParams;
|
11
|
12
|
import io.swagger.annotations.ApiOperation;
|
12
|
|
-import org.checkerframework.checker.units.qual.A;
|
13
|
13
|
import org.springframework.beans.factory.annotation.Autowired;
|
14
|
|
-import org.springframework.web.bind.annotation.*;
|
|
14
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
15
|
+
|
|
16
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
17
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
18
|
+import org.springframework.web.bind.annotation.RestController;
|
|
19
|
+
|
|
20
|
+import java.util.List;
|
15
|
21
|
|
16
|
22
|
/**
|
17
|
23
|
* <p>
|
|
@@ -34,10 +40,29 @@ public class PageImgController extends BaseController {
|
34
|
40
|
@ApiImplicitParam(paramType = "Query",dataType = "String",name = "id",value = "图片id" ),
|
35
|
41
|
})
|
36
|
42
|
@RequestMapping(value = "/pageIm", method = RequestMethod.GET)
|
37
|
|
- public ResponseBean apageImgSelect(@RequestParam(value = "id",required = false)String id)
|
38
|
|
- {
|
|
43
|
+ public ResponseBean apageImgSelect(@RequestParam(value = "id",required = false)String id) {
|
|
44
|
+
|
|
45
|
+ ResponseBean responseBean = iPageImgService.apageImgSelect(id);
|
|
46
|
+ return responseBean;
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ @RequestMapping(value = "/wx/banner", method = RequestMethod.GET)
|
|
50
|
+ @ApiOperation(value = "微信小程序 首页Banner")
|
|
51
|
+ @ApiImplicitParams({
|
|
52
|
+ @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "imgType", value = "图片类型"),
|
|
53
|
+ @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "imgLocation", value = "图片位置")
|
|
54
|
+ })
|
|
55
|
+ public ResponseBean getWxBanner(@RequestParam("imgType") String imgType,
|
|
56
|
+ @RequestParam("imgLocation") String imgLocation) {
|
|
57
|
+ ResponseBean responseBean = new ResponseBean();
|
|
58
|
+
|
|
59
|
+ QueryWrapper<PageImg> pageImgQueryWrapper = new QueryWrapper<>();
|
|
60
|
+ pageImgQueryWrapper.eq("img_type", imgType);
|
|
61
|
+ pageImgQueryWrapper.eq("img_location", imgLocation);
|
|
62
|
+ pageImgQueryWrapper.eq("status", 1);
|
|
63
|
+ List<PageImg> list = iPageImgService.list(pageImgQueryWrapper);
|
39
|
64
|
|
40
|
|
- ResponseBean responseBean = iPageImgService.apageImgSelect(id);
|
|
65
|
+ responseBean.addSuccess(list);
|
41
|
66
|
return responseBean;
|
42
|
67
|
}
|
43
|
68
|
|