张延森 4 лет назад
Родитель
Сommit
346d5224d1

+ 25
- 0
src/main/java/com/yunzhi/niucai/config/SwaggerUiWebMvcConfigurer.java Просмотреть файл

1
+package com.yunzhi.niucai.config;
2
+
3
+import org.springframework.context.annotation.Configuration;
4
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
5
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
6
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
7
+
8
+@Configuration
9
+public class SwaggerUiWebMvcConfigurer implements WebMvcConfigurer {
10
+    @Override
11
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
12
+        String baseUrl = "";
13
+        registry.
14
+                addResourceHandler(baseUrl + "/swagger-ui/**")
15
+                .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
16
+                .resourceChain(false);
17
+    }
18
+
19
+    @Override
20
+    public void addViewControllers(ViewControllerRegistry registry) {
21
+        String baseUrl = "";
22
+        registry.addViewController(baseUrl + "/swagger-ui/")
23
+                .setViewName("forward:" + baseUrl + "/swagger-ui/index.html");
24
+    }
25
+}

+ 117
- 117
src/main/java/com/yunzhi/niucai/controller/SysAdController.java Просмотреть файл

1
-package com.yunzhi.niucai.controller;
2
-
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.baomidou.mybatisplus.core.metadata.IPage;
5
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
-import com.yunzhi.niucai.common.BaseController;
7
-import com.yunzhi.niucai.common.ResponseBean;
8
-import com.yunzhi.niucai.enums.StatusEnum;
9
-import io.swagger.annotations.Api;
10
-import io.swagger.annotations.ApiOperation;
11
-import io.swagger.annotations.ApiParam;
12
-import org.slf4j.Logger;
13
-import org.slf4j.LoggerFactory;
14
-import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.web.bind.annotation.PathVariable;
16
-import org.springframework.web.bind.annotation.RequestMapping;
17
-import org.springframework.web.bind.annotation.RequestMethod;
18
-import org.springframework.web.bind.annotation.RequestParam;
19
-import com.yunzhi.niucai.service.ISysAdService;
20
-import com.yunzhi.niucai.entity.SysAd;
21
-import org.springframework.web.bind.annotation.RestController;
22
-
23
-/**
24
- * <p>
25
-    * 系统广告 前端控制器
26
-    * </p>
27
- *
28
- * @author yansen
29
- * @since 2020-08-27
30
- */
31
-
32
-@Api(tags = "广告、通知、Banner")
33
-@RestController
34
-@RequestMapping("/")
35
-public class SysAdController extends BaseController {
36
-
37
-    private final Logger logger = LoggerFactory.getLogger(SysAdController.class);
38
-
39
-    @Autowired
40
-    public ISysAdService iSysAdService;
41
-
42
-
43
-    /**
44
-     * 分页查询列表
45
-     * @param pageNum
46
-     * @param pageSize
47
-     * @return
48
-     */
49
-    @RequestMapping(value="/{client}/ad",method= RequestMethod.GET)
50
-    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
-    public ResponseBean sysAdList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-                                  @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
53
-                                  @ApiParam(value = "广告类型: 可用类型查询 AdTypeEnum") @RequestParam(value ="adType", required = false) String adType,
54
-                                  @ApiParam(value = "发布状态: 1 已发布, 0 未发布", allowableValues = "1,0") @RequestParam(value ="status", required = false) Integer status,
55
-                                  @ApiParam(value = "客户端", allowableValues = "app, shop") @PathVariable(value ="client") String client) throws Exception{
56
-
57
-		    IPage<SysAd> pg = new Page<>(pageNum, pageSize);
58
-            QueryWrapper<SysAd> queryWrapper = new QueryWrapper<>();
59
-            queryWrapper.eq(null != adType, "ad_type", adType);
60
-            queryWrapper.eq(null != status, "status", status);
61
-            queryWrapper.gt("status", StatusEnum.DELETED.getCode());
62
-            queryWrapper.orderByDesc("weight");
63
-            queryWrapper.orderByDesc("create_date");
64
-
65
-            IPage<SysAd> result = iSysAdService.page(pg, queryWrapper);
66
-            return ResponseBean.success(result);
67
-    }
68
-
69
-//    /**
70
-//     * 保存对象
71
-//     * @param sysAd 实体对象
72
-//     * @return
73
-//     */
74
-//    @RequestMapping(value="/sysAd",method= RequestMethod.POST)
75
-//    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
76
-//    public ResponseBean sysAdAdd(@ApiParam("保存内容") @RequestBody SysAd sysAd) throws Exception{
1
+//package com.yunzhi.niucai.controller;
77
 //
2
 //
78
-//        if (iSysAdService.save(sysAd)){
79
-//            return ResponseBean.success(sysAd);
80
-//        }else {
81
-//            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
82
-//        }
83
-//    }
3
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+//import com.baomidou.mybatisplus.core.metadata.IPage;
5
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+//import com.yunzhi.niucai.common.BaseController;
7
+//import com.yunzhi.niucai.common.ResponseBean;
8
+//import com.yunzhi.niucai.enums.StatusEnum;
9
+//import io.swagger.annotations.Api;
10
+//import io.swagger.annotations.ApiOperation;
11
+//import io.swagger.annotations.ApiParam;
12
+//import org.slf4j.Logger;
13
+//import org.slf4j.LoggerFactory;
14
+//import org.springframework.beans.factory.annotation.Autowired;
15
+//import org.springframework.web.bind.annotation.PathVariable;
16
+//import org.springframework.web.bind.annotation.RequestMapping;
17
+//import org.springframework.web.bind.annotation.RequestMethod;
18
+//import org.springframework.web.bind.annotation.RequestParam;
19
+//import com.yunzhi.niucai.service.ISysAdService;
20
+//import com.yunzhi.niucai.entity.SysAd;
21
+//import org.springframework.web.bind.annotation.RestController;
22
+//
23
+///**
24
+// * <p>
25
+//    * 系统广告 前端控制器
26
+//    * </p>
27
+// *
28
+// * @author yansen
29
+// * @since 2020-08-27
30
+// */
31
+//
32
+//@Api(tags = "广告、通知、Banner")
33
+//@RestController
34
+//@RequestMapping("/")
35
+//public class SysAdController extends BaseController {
36
+//
37
+//    private final Logger logger = LoggerFactory.getLogger(SysAdController.class);
38
+//
39
+//    @Autowired
40
+//    public ISysAdService iSysAdService;
84
 //
41
 //
85
-//    /**
86
-//     * 根据id删除对象
87
-//     * @param id  实体ID
88
-//     */
89
-//    @RequestMapping(value="/sysAd/{id}", method= RequestMethod.DELETE)
90
-//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
91
-//    public ResponseBean sysAdDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
92
-//        if(iSysAdService.removeById(id)){
93
-//            return ResponseBean.success("success");
94
-//        }else {
95
-//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
96
-//        }
97
-//    }
98
 //
42
 //
99
 //    /**
43
 //    /**
100
-//     * 修改对象
101
-//     * @param id  实体ID
102
-//     * @param sysAd 实体对象
44
+//     * 分页查询列表
45
+//     * @param pageNum
46
+//     * @param pageSize
103
 //     * @return
47
 //     * @return
104
 //     */
48
 //     */
105
-//    @RequestMapping(value="/sysAd/{id}",method= RequestMethod.PUT)
106
-//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
107
-//    public ResponseBean sysAdUpdate(@ApiParam("对象ID") @PathVariable Integer id,
108
-//                                        @ApiParam("更新内容") @RequestBody SysAd sysAd) throws Exception{
49
+//    @RequestMapping(value="/{client}/ad",method= RequestMethod.GET)
50
+//    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+//    public ResponseBean sysAdList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+//                                  @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
53
+//                                  @ApiParam(value = "广告类型: 可用类型查询 AdTypeEnum") @RequestParam(value ="adType", required = false) String adType,
54
+//                                  @ApiParam(value = "发布状态: 1 已发布, 0 未发布", allowableValues = "1,0") @RequestParam(value ="status", required = false) Integer status,
55
+//                                  @ApiParam(value = "客户端", allowableValues = "app, shop") @PathVariable(value ="client") String client) throws Exception{
109
 //
56
 //
110
-//        if (iSysAdService.updateById(sysAd)){
111
-//            return ResponseBean.success(iSysAdService.getById(id));
112
-//        }else {
113
-//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
114
-//        }
115
-//    }
57
+//		    IPage<SysAd> pg = new Page<>(pageNum, pageSize);
58
+//            QueryWrapper<SysAd> queryWrapper = new QueryWrapper<>();
59
+//            queryWrapper.eq(null != adType, "ad_type", adType);
60
+//            queryWrapper.eq(null != status, "status", status);
61
+//            queryWrapper.gt("status", StatusEnum.DELETED.getCode());
62
+//            queryWrapper.orderByDesc("weight");
63
+//            queryWrapper.orderByDesc("create_date");
116
 //
64
 //
117
-//    /**
118
-//     * 根据id查询对象
119
-//     * @param id  实体ID
120
-//     */
121
-//    @RequestMapping(value="/sysAd/{id}",method= RequestMethod.GET)
122
-//    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
123
-//    public ResponseBean sysAdGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
124
-//        return ResponseBean.success(iSysAdService.getById(id));
65
+//            IPage<SysAd> result = iSysAdService.page(pg, queryWrapper);
66
+//            return ResponseBean.success(result);
125
 //    }
67
 //    }
126
-}
68
+//
69
+////    /**
70
+////     * 保存对象
71
+////     * @param sysAd 实体对象
72
+////     * @return
73
+////     */
74
+////    @RequestMapping(value="/sysAd",method= RequestMethod.POST)
75
+////    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
76
+////    public ResponseBean sysAdAdd(@ApiParam("保存内容") @RequestBody SysAd sysAd) throws Exception{
77
+////
78
+////        if (iSysAdService.save(sysAd)){
79
+////            return ResponseBean.success(sysAd);
80
+////        }else {
81
+////            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
82
+////        }
83
+////    }
84
+////
85
+////    /**
86
+////     * 根据id删除对象
87
+////     * @param id  实体ID
88
+////     */
89
+////    @RequestMapping(value="/sysAd/{id}", method= RequestMethod.DELETE)
90
+////    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
91
+////    public ResponseBean sysAdDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
92
+////        if(iSysAdService.removeById(id)){
93
+////            return ResponseBean.success("success");
94
+////        }else {
95
+////            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
96
+////        }
97
+////    }
98
+////
99
+////    /**
100
+////     * 修改对象
101
+////     * @param id  实体ID
102
+////     * @param sysAd 实体对象
103
+////     * @return
104
+////     */
105
+////    @RequestMapping(value="/sysAd/{id}",method= RequestMethod.PUT)
106
+////    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
107
+////    public ResponseBean sysAdUpdate(@ApiParam("对象ID") @PathVariable Integer id,
108
+////                                        @ApiParam("更新内容") @RequestBody SysAd sysAd) throws Exception{
109
+////
110
+////        if (iSysAdService.updateById(sysAd)){
111
+////            return ResponseBean.success(iSysAdService.getById(id));
112
+////        }else {
113
+////            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
114
+////        }
115
+////    }
116
+////
117
+////    /**
118
+////     * 根据id查询对象
119
+////     * @param id  实体ID
120
+////     */
121
+////    @RequestMapping(value="/sysAd/{id}",method= RequestMethod.GET)
122
+////    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
123
+////    public ResponseBean sysAdGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
124
+////        return ResponseBean.success(iSysAdService.getById(id));
125
+////    }
126
+//}

+ 119
- 119
src/main/java/com/yunzhi/niucai/controller/SysRecommendShopController.java Просмотреть файл

1
-package com.yunzhi.niucai.controller;
2
-//
3
-//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-//import com.baomidou.mybatisplus.core.metadata.IPage;
5
-//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
-//import com.yunzhi.niucai.common.BaseController;
7
-//import com.yunzhi.niucai.common.ResponseBean;
8
-//import io.swagger.annotations.Api;
9
-//import io.swagger.annotations.ApiOperation;
10
-//import io.swagger.annotations.ApiParam;
11
-//import org.slf4j.Logger;
12
-//import org.slf4j.LoggerFactory;
13
-//import org.springframework.beans.factory.annotation.Autowired;
14
-//import org.springframework.web.bind.annotation.PathVariable;
15
-//import org.springframework.web.bind.annotation.RequestBody;
16
-//import org.springframework.web.bind.annotation.RequestMapping;
17
-//import org.springframework.web.bind.annotation.RequestMethod;
18
-//import org.springframework.web.bind.annotation.RequestParam;
19
-//import com.yunzhi.niucai.service.ISysRecommendShopService;
20
-//import com.yunzhi.niucai.entity.SysRecommendShop;
21
-//import org.springframework.web.bind.annotation.RestController;
22
-//
23
-///**
24
-// * <p>
25
-//    * 系统推荐店铺  前端控制器
26
-//    * </p>
27
-// *
28
-// * @author yansen
29
-// * @since 2020-08-28
30
-// */
31
-//
32
-//@Api(tags = "系统推荐店铺 ")
33
-//@RestController
34
-//@RequestMapping("/")
35
-//public class SysRecommendShopController extends BaseController {
36
-//
37
-//    private final Logger logger = LoggerFactory.getLogger(SysRecommendShopController.class);
38
-//
39
-//    @Autowired
40
-//    public ISysRecommendShopService iSysRecommendShopService;
41
-//
42
-//
43
-//    /**
44
-//     * 分页查询列表
45
-//     * @param pageNum
46
-//     * @param pageSize
47
-//     * @return
48
-//     */
49
-//    @RequestMapping(value="/sysRecommendShop",method= RequestMethod.GET)
50
-//    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
-//    public ResponseBean sysRecommendShopList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
-//									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
-//
54
-//		    IPage<SysRecommendShop> pg = new Page<>(pageNum, pageSize);
55
-//            QueryWrapper<SysRecommendShop> queryWrapper = new QueryWrapper<>();
56
-//            queryWrapper.orderByDesc("create_date");
57
-//
58
-//            IPage<SysRecommendShop> result = iSysRecommendShopService.page(pg, queryWrapper);
59
-//            return ResponseBean.success(result);
60
-//    }
61
-//
62
-//    /**
63
-//     * 保存对象
64
-//     * @param sysRecommendShop 实体对象
65
-//     * @return
66
-//     */
67
-//    @RequestMapping(value="/sysRecommendShop",method= RequestMethod.POST)
68
-//    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
-//    public ResponseBean sysRecommendShopAdd(@ApiParam("保存内容") @RequestBody SysRecommendShop sysRecommendShop) throws Exception{
70
-//
71
-//        if (iSysRecommendShopService.save(sysRecommendShop)){
72
-//            return ResponseBean.success(sysRecommendShop);
73
-//        }else {
74
-//            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
-//        }
76
-//    }
77
-//
78
-//    /**
79
-//     * 根据id删除对象
80
-//     * @param id  实体ID
81
-//     */
82
-//    @RequestMapping(value="/sysRecommendShop/{id}", method= RequestMethod.DELETE)
83
-//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
-//    public ResponseBean sysRecommendShopDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
-//        if(iSysRecommendShopService.removeById(id)){
86
-//            return ResponseBean.success("success");
87
-//        }else {
88
-//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
-//        }
90
-//    }
91
-//
92
-//    /**
93
-//     * 修改对象
94
-//     * @param id  实体ID
95
-//     * @param sysRecommendShop 实体对象
96
-//     * @return
97
-//     */
98
-//    @RequestMapping(value="/sysRecommendShop/{id}",method= RequestMethod.PUT)
99
-//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
-//    public ResponseBean sysRecommendShopUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
-//                                        @ApiParam("更新内容") @RequestBody SysRecommendShop sysRecommendShop) throws Exception{
102
-//
103
-//        if (iSysRecommendShopService.updateById(sysRecommendShop)){
104
-//            return ResponseBean.success(iSysRecommendShopService.getById(id));
105
-//        }else {
106
-//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
-//        }
108
-//    }
109
-//
110
-//    /**
111
-//     * 根据id查询对象
112
-//     * @param id  实体ID
113
-//     */
114
-//    @RequestMapping(value="/sysRecommendShop/{id}",method= RequestMethod.GET)
115
-//    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
-//    public ResponseBean sysRecommendShopGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
-//        return ResponseBean.success(iSysRecommendShopService.getById(id));
118
-//    }
119
-//}
1
+//package com.yunzhi.niucai.controller;
2
+////
3
+////import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+////import com.baomidou.mybatisplus.core.metadata.IPage;
5
+////import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+////import com.yunzhi.niucai.common.BaseController;
7
+////import com.yunzhi.niucai.common.ResponseBean;
8
+////import io.swagger.annotations.Api;
9
+////import io.swagger.annotations.ApiOperation;
10
+////import io.swagger.annotations.ApiParam;
11
+////import org.slf4j.Logger;
12
+////import org.slf4j.LoggerFactory;
13
+////import org.springframework.beans.factory.annotation.Autowired;
14
+////import org.springframework.web.bind.annotation.PathVariable;
15
+////import org.springframework.web.bind.annotation.RequestBody;
16
+////import org.springframework.web.bind.annotation.RequestMapping;
17
+////import org.springframework.web.bind.annotation.RequestMethod;
18
+////import org.springframework.web.bind.annotation.RequestParam;
19
+////import com.yunzhi.niucai.service.ISysRecommendShopService;
20
+////import com.yunzhi.niucai.entity.SysRecommendShop;
21
+////import org.springframework.web.bind.annotation.RestController;
22
+////
23
+/////**
24
+//// * <p>
25
+////    * 系统推荐店铺  前端控制器
26
+////    * </p>
27
+//// *
28
+//// * @author yansen
29
+//// * @since 2020-08-28
30
+//// */
31
+////
32
+////@Api(tags = "系统推荐店铺 ")
33
+////@RestController
34
+////@RequestMapping("/")
35
+////public class SysRecommendShopController extends BaseController {
36
+////
37
+////    private final Logger logger = LoggerFactory.getLogger(SysRecommendShopController.class);
38
+////
39
+////    @Autowired
40
+////    public ISysRecommendShopService iSysRecommendShopService;
41
+////
42
+////
43
+////    /**
44
+////     * 分页查询列表
45
+////     * @param pageNum
46
+////     * @param pageSize
47
+////     * @return
48
+////     */
49
+////    @RequestMapping(value="/sysRecommendShop",method= RequestMethod.GET)
50
+////    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
51
+////    public ResponseBean sysRecommendShopList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
52
+////									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
53
+////
54
+////		    IPage<SysRecommendShop> pg = new Page<>(pageNum, pageSize);
55
+////            QueryWrapper<SysRecommendShop> queryWrapper = new QueryWrapper<>();
56
+////            queryWrapper.orderByDesc("create_date");
57
+////
58
+////            IPage<SysRecommendShop> result = iSysRecommendShopService.page(pg, queryWrapper);
59
+////            return ResponseBean.success(result);
60
+////    }
61
+////
62
+////    /**
63
+////     * 保存对象
64
+////     * @param sysRecommendShop 实体对象
65
+////     * @return
66
+////     */
67
+////    @RequestMapping(value="/sysRecommendShop",method= RequestMethod.POST)
68
+////    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
69
+////    public ResponseBean sysRecommendShopAdd(@ApiParam("保存内容") @RequestBody SysRecommendShop sysRecommendShop) throws Exception{
70
+////
71
+////        if (iSysRecommendShopService.save(sysRecommendShop)){
72
+////            return ResponseBean.success(sysRecommendShop);
73
+////        }else {
74
+////            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
75
+////        }
76
+////    }
77
+////
78
+////    /**
79
+////     * 根据id删除对象
80
+////     * @param id  实体ID
81
+////     */
82
+////    @RequestMapping(value="/sysRecommendShop/{id}", method= RequestMethod.DELETE)
83
+////    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
84
+////    public ResponseBean sysRecommendShopDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
85
+////        if(iSysRecommendShopService.removeById(id)){
86
+////            return ResponseBean.success("success");
87
+////        }else {
88
+////            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+////        }
90
+////    }
91
+////
92
+////    /**
93
+////     * 修改对象
94
+////     * @param id  实体ID
95
+////     * @param sysRecommendShop 实体对象
96
+////     * @return
97
+////     */
98
+////    @RequestMapping(value="/sysRecommendShop/{id}",method= RequestMethod.PUT)
99
+////    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
100
+////    public ResponseBean sysRecommendShopUpdate(@ApiParam("对象ID") @PathVariable Integer id,
101
+////                                        @ApiParam("更新内容") @RequestBody SysRecommendShop sysRecommendShop) throws Exception{
102
+////
103
+////        if (iSysRecommendShopService.updateById(sysRecommendShop)){
104
+////            return ResponseBean.success(iSysRecommendShopService.getById(id));
105
+////        }else {
106
+////            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
107
+////        }
108
+////    }
109
+////
110
+////    /**
111
+////     * 根据id查询对象
112
+////     * @param id  实体ID
113
+////     */
114
+////    @RequestMapping(value="/sysRecommendShop/{id}",method= RequestMethod.GET)
115
+////    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
116
+////    public ResponseBean sysRecommendShopGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
117
+////        return ResponseBean.success(iSysRecommendShopService.getById(id));
118
+////    }
119
+////}

+ 123
- 123
src/main/java/com/yunzhi/niucai/controller/TaCustomerController.java Просмотреть файл

1
-package com.yunzhi.niucai.controller;
2
-
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.baomidou.mybatisplus.core.metadata.IPage;
5
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
-import com.yunzhi.niucai.common.BaseController;
7
-import com.yunzhi.niucai.common.ResponseBean;
8
-import com.yunzhi.niucai.enums.StatusEnum;
9
-import io.swagger.annotations.Api;
10
-import io.swagger.annotations.ApiOperation;
11
-import io.swagger.annotations.ApiParam;
12
-import org.slf4j.Logger;
13
-import org.slf4j.LoggerFactory;
14
-import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.web.bind.annotation.PathVariable;
16
-import org.springframework.web.bind.annotation.RequestBody;
17
-import org.springframework.web.bind.annotation.RequestMapping;
18
-import org.springframework.web.bind.annotation.RequestMethod;
19
-import org.springframework.web.bind.annotation.RequestParam;
20
-import com.yunzhi.niucai.service.ITaCustomerService;
21
-import com.yunzhi.niucai.entity.TaCustomer;
22
-import org.springframework.web.bind.annotation.RestController;
23
-
24
-import javax.servlet.http.HttpServletRequest;
25
-
26
-/**
27
- * <p>
28
-    * 客户 前端控制器
29
-    * </p>
30
- *
31
- * @author yansen
32
- * @since 2020-08-28
33
- */
34
-
35
-@Api(tags = "用户管理")
36
-@RestController
37
-@RequestMapping("/")
38
-public class TaCustomerController extends BaseController {
39
-
40
-    private final Logger logger = LoggerFactory.getLogger(TaCustomerController.class);
41
-
42
-    @Autowired
43
-    public ITaCustomerService iTaCustomerService;
44
-
1
+//package com.yunzhi.niucai.controller;
45
 //
2
 //
46
-//    /**
47
-//     * 分页查询列表
48
-//     * @param pageNum
49
-//     * @param pageSize
50
-//     * @return
51
-//     */
52
-//    @RequestMapping(value="/taCustomer",method= RequestMethod.GET)
53
-//    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
54
-//    public ResponseBean taCustomerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55
-//									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
3
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+//import com.baomidou.mybatisplus.core.metadata.IPage;
5
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+//import com.yunzhi.niucai.common.BaseController;
7
+//import com.yunzhi.niucai.common.ResponseBean;
8
+//import com.yunzhi.niucai.enums.StatusEnum;
9
+//import io.swagger.annotations.Api;
10
+//import io.swagger.annotations.ApiOperation;
11
+//import io.swagger.annotations.ApiParam;
12
+//import org.slf4j.Logger;
13
+//import org.slf4j.LoggerFactory;
14
+//import org.springframework.beans.factory.annotation.Autowired;
15
+//import org.springframework.web.bind.annotation.PathVariable;
16
+//import org.springframework.web.bind.annotation.RequestBody;
17
+//import org.springframework.web.bind.annotation.RequestMapping;
18
+//import org.springframework.web.bind.annotation.RequestMethod;
19
+//import org.springframework.web.bind.annotation.RequestParam;
20
+//import com.yunzhi.niucai.service.ITaCustomerService;
21
+//import com.yunzhi.niucai.entity.TaCustomer;
22
+//import org.springframework.web.bind.annotation.RestController;
56
 //
23
 //
57
-//		    IPage<TaCustomer> pg = new Page<>(pageNum, pageSize);
58
-//            QueryWrapper<TaCustomer> queryWrapper = new QueryWrapper<>();
59
-//            queryWrapper.orderByDesc("create_date");
24
+//import javax.servlet.http.HttpServletRequest;
60
 //
25
 //
61
-//            IPage<TaCustomer> result = iTaCustomerService.page(pg, queryWrapper);
62
-//            return ResponseBean.success(result);
63
-//    }
26
+///**
27
+// * <p>
28
+//    * 客户 前端控制器
29
+//    * </p>
30
+// *
31
+// * @author yansen
32
+// * @since 2020-08-28
33
+// */
64
 //
34
 //
65
-//    /**
66
-//     * 保存对象
67
-//     * @param taCustomer 实体对象
68
-//     * @return
69
-//     */
70
-//    @RequestMapping(value="/taCustomer",method= RequestMethod.POST)
71
-//    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
72
-//    public ResponseBean taCustomerAdd(@ApiParam("保存内容") @RequestBody TaCustomer taCustomer) throws Exception{
35
+//@Api(tags = "用户管理")
36
+//@RestController
37
+//@RequestMapping("/")
38
+//public class TaCustomerController extends BaseController {
73
 //
39
 //
74
-//        if (iTaCustomerService.save(taCustomer)){
75
-//            return ResponseBean.success(taCustomer);
76
-//        }else {
77
-//            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
78
-//        }
79
-//    }
40
+//    private final Logger logger = LoggerFactory.getLogger(TaCustomerController.class);
80
 //
41
 //
81
-//    /**
82
-//     * 根据id删除对象
83
-//     * @param id  实体ID
84
-//     */
85
-//    @RequestMapping(value="/taCustomer/{id}", method= RequestMethod.DELETE)
86
-//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
87
-//    public ResponseBean taCustomerDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
88
-//        if(iTaCustomerService.removeById(id)){
89
-//            return ResponseBean.success("success");
90
-//        }else {
91
-//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
92
-//        }
93
-//    }
42
+//    @Autowired
43
+//    public ITaCustomerService iTaCustomerService;
44
+//
45
+////
46
+////    /**
47
+////     * 分页查询列表
48
+////     * @param pageNum
49
+////     * @param pageSize
50
+////     * @return
51
+////     */
52
+////    @RequestMapping(value="/taCustomer",method= RequestMethod.GET)
53
+////    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
54
+////    public ResponseBean taCustomerList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
55
+////									 @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
56
+////
57
+////		    IPage<TaCustomer> pg = new Page<>(pageNum, pageSize);
58
+////            QueryWrapper<TaCustomer> queryWrapper = new QueryWrapper<>();
59
+////            queryWrapper.orderByDesc("create_date");
60
+////
61
+////            IPage<TaCustomer> result = iTaCustomerService.page(pg, queryWrapper);
62
+////            return ResponseBean.success(result);
63
+////    }
64
+////
65
+////    /**
66
+////     * 保存对象
67
+////     * @param taCustomer 实体对象
68
+////     * @return
69
+////     */
70
+////    @RequestMapping(value="/taCustomer",method= RequestMethod.POST)
71
+////    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
72
+////    public ResponseBean taCustomerAdd(@ApiParam("保存内容") @RequestBody TaCustomer taCustomer) throws Exception{
73
+////
74
+////        if (iTaCustomerService.save(taCustomer)){
75
+////            return ResponseBean.success(taCustomer);
76
+////        }else {
77
+////            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
78
+////        }
79
+////    }
80
+////
81
+////    /**
82
+////     * 根据id删除对象
83
+////     * @param id  实体ID
84
+////     */
85
+////    @RequestMapping(value="/taCustomer/{id}", method= RequestMethod.DELETE)
86
+////    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
87
+////    public ResponseBean taCustomerDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
88
+////        if(iTaCustomerService.removeById(id)){
89
+////            return ResponseBean.success("success");
90
+////        }else {
91
+////            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
92
+////        }
93
+////    }
94
+////
95
+////    /**
96
+////     * 修改对象
97
+////     * @param id  实体ID
98
+////     * @param taCustomer 实体对象
99
+////     * @return
100
+////     */
101
+////    @RequestMapping(value="/taCustomer/{id}",method= RequestMethod.PUT)
102
+////    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
103
+////    public ResponseBean taCustomerUpdate(@ApiParam("对象ID") @PathVariable Integer id,
104
+////                                        @ApiParam("更新内容") @RequestBody TaCustomer taCustomer) throws Exception{
105
+////
106
+////        if (iTaCustomerService.updateById(taCustomer)){
107
+////            return ResponseBean.success(iTaCustomerService.getById(id));
108
+////        }else {
109
+////            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
110
+////        }
111
+////    }
94
 //
112
 //
95
 //    /**
113
 //    /**
96
-//     * 修改对象
114
+//     * 根据id查询对象
97
 //     * @param id  实体ID
115
 //     * @param id  实体ID
98
-//     * @param taCustomer 实体对象
99
-//     * @return
100
 //     */
116
 //     */
101
-//    @RequestMapping(value="/taCustomer/{id}",method= RequestMethod.PUT)
102
-//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
103
-//    public ResponseBean taCustomerUpdate(@ApiParam("对象ID") @PathVariable Integer id,
104
-//                                        @ApiParam("更新内容") @RequestBody TaCustomer taCustomer) throws Exception{
117
+//    @RequestMapping(value="/app/customer/{id}",method= RequestMethod.GET)
118
+//    @ApiOperation(value="根据id查询用户", notes = "用户信息: 如果 id 设置为 current , 则代表查询当前用户", httpMethod = "GET", response = ResponseBean.class)
119
+//    public ResponseBean taCustomerGet(@ApiParam("用户 ID") @PathVariable String id,
120
+//                                      HttpServletRequest request) throws Exception{
121
+//        TaCustomer customer = null;
122
+//        if ("current".equals(id)) {
123
+//            customer = getCustomer(request);
124
+//        } else {
125
+//            customer = iTaCustomerService.getById(id);
126
+//        }
105
 //
127
 //
106
-//        if (iTaCustomerService.updateById(taCustomer)){
107
-//            return ResponseBean.success(iTaCustomerService.getById(id));
108
-//        }else {
109
-//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
128
+//        if (null == customer || StatusEnum.DELETED.getCode().equals(customer.getStatus())) {
129
+//            return ResponseBean.error("未查询到人员信息", ResponseBean.ERROR_UNAVAILABLE);
110
 //        }
130
 //        }
131
+//
132
+//        customer.setCashPass(null);
133
+//        customer.setLoginPass(null);
134
+//        return ResponseBean.success(customer);
111
 //    }
135
 //    }
112
-
113
-    /**
114
-     * 根据id查询对象
115
-     * @param id  实体ID
116
-     */
117
-    @RequestMapping(value="/app/customer/{id}",method= RequestMethod.GET)
118
-    @ApiOperation(value="根据id查询用户", notes = "用户信息: 如果 id 设置为 current , 则代表查询当前用户", httpMethod = "GET", response = ResponseBean.class)
119
-    public ResponseBean taCustomerGet(@ApiParam("用户 ID") @PathVariable String id,
120
-                                      HttpServletRequest request) throws Exception{
121
-        TaCustomer customer = null;
122
-        if ("current".equals(id)) {
123
-            customer = getCustomer(request);
124
-        } else {
125
-            customer = iTaCustomerService.getById(id);
126
-        }
127
-
128
-        if (null == customer || StatusEnum.DELETED.getCode().equals(customer.getStatus())) {
129
-            return ResponseBean.error("未查询到人员信息", ResponseBean.ERROR_UNAVAILABLE);
130
-        }
131
-
132
-        customer.setCashPass(null);
133
-        customer.setLoginPass(null);
134
-        return ResponseBean.success(customer);
135
-    }
136
-}
136
+//}

+ 116
- 116
src/main/java/com/yunzhi/niucai/controller/TaLotteryResultController.java Просмотреть файл

1
-package com.yunzhi.niucai.controller;
2
-
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.baomidou.mybatisplus.core.metadata.IPage;
5
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
-import com.yunzhi.niucai.common.BaseController;
7
-import com.yunzhi.niucai.common.ResponseBean;
8
-import com.yunzhi.niucai.enums.StatusEnum;
9
-import io.swagger.annotations.Api;
10
-import io.swagger.annotations.ApiOperation;
11
-import io.swagger.annotations.ApiParam;
12
-import org.slf4j.Logger;
13
-import org.slf4j.LoggerFactory;
14
-import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.web.bind.annotation.*;
16
-import com.yunzhi.niucai.service.ITaLotteryResultService;
17
-import com.yunzhi.niucai.entity.TaLotteryResult;
18
-
19
-import java.util.List;
20
-
21
-/**
22
- * <p>
23
-    * 数字彩开奖结果  前端控制器
24
-    * </p>
25
- *
26
- * @author yansen
27
- * @since 2020-08-27
28
- */
29
-
30
-@Api(tags = "数字彩开奖结果")
31
-@RestController
32
-@RequestMapping("/")
33
-public class TaLotteryResultController extends BaseController {
34
-
35
-    private final Logger logger = LoggerFactory.getLogger(TaLotteryResultController.class);
36
-
37
-    @Autowired
38
-    public ITaLotteryResultService iTaLotteryResultService;
39
-
40
-    @GetMapping("/app/lottery/result/last")
41
-    @ApiOperation(value = "最新数字彩开奖结果", notes = "不区分数字彩彩种", httpMethod = "GET")
42
-    public ResponseBean last() throws Exception {
43
-        List<TaLotteryResult> result = iTaLotteryResultService.getLastResult();
44
-        return ResponseBean.success(result);
45
-    }
46
-
47
-    /**
48
-     * 分页查询列表
49
-     * @param pageNum
50
-     * @param pageSize
51
-     * @return
52
-     */
53
-    @RequestMapping(value="/app/lottery/result",method= RequestMethod.GET)
54
-    @ApiOperation(value="数字彩开奖结果列表", notes = "数字彩开奖结果列表", httpMethod = "GET", response = ResponseBean.class)
55
-    public ResponseBean taLotteryResultList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
-									        @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
-                                            @ApiParam("彩种类型: 可用类型, 请查阅彩种字典") @RequestParam(value ="lotteryId", required = false) String lotteryId) throws Exception{
58
-
59
-		    IPage<TaLotteryResult> pg = new Page<>(pageNum, pageSize);
60
-            QueryWrapper<TaLotteryResult> queryWrapper = new QueryWrapper<>();
61
-            queryWrapper.eq(null != lotteryId, "lottery_id", lotteryId);
62
-            queryWrapper.eq("status", StatusEnum.NORMAL.getCode());
63
-            queryWrapper.orderByDesc("issue_no");
64
-            queryWrapper.orderByDesc("create_date");
65
-
66
-            IPage<TaLotteryResult> result = iTaLotteryResultService.page(pg, queryWrapper);
67
-            return ResponseBean.success(result);
68
-    }
1
+//package com.yunzhi.niucai.controller;
69
 //
2
 //
70
-//    /**
71
-//     * 保存对象
72
-//     * @param taLotteryResult 实体对象
73
-//     * @return
74
-//     */
75
-//    @RequestMapping(value="/taLotteryResult",method= RequestMethod.POST)
76
-//    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
77
-//    public ResponseBean taLotteryResultAdd(@ApiParam("保存内容") @RequestBody TaLotteryResult taLotteryResult) throws Exception{
3
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+//import com.baomidou.mybatisplus.core.metadata.IPage;
5
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+//import com.yunzhi.niucai.common.BaseController;
7
+//import com.yunzhi.niucai.common.ResponseBean;
8
+//import com.yunzhi.niucai.enums.StatusEnum;
9
+//import io.swagger.annotations.Api;
10
+//import io.swagger.annotations.ApiOperation;
11
+//import io.swagger.annotations.ApiParam;
12
+//import org.slf4j.Logger;
13
+//import org.slf4j.LoggerFactory;
14
+//import org.springframework.beans.factory.annotation.Autowired;
15
+//import org.springframework.web.bind.annotation.*;
16
+//import com.yunzhi.niucai.service.ITaLotteryResultService;
17
+//import com.yunzhi.niucai.entity.TaLotteryResult;
78
 //
18
 //
79
-//        if (iTaLotteryResultService.save(taLotteryResult)){
80
-//            return ResponseBean.success(taLotteryResult);
81
-//        }else {
82
-//            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
83
-//        }
84
-//    }
19
+//import java.util.List;
85
 //
20
 //
86
-//    /**
87
-//     * 根据id删除对象
88
-//     * @param id  实体ID
89
-//     */
90
-//    @RequestMapping(value="/taLotteryResult/{id}", method= RequestMethod.DELETE)
91
-//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
92
-//    public ResponseBean taLotteryResultDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
93
-//        if(iTaLotteryResultService.removeById(id)){
94
-//            return ResponseBean.success("success");
95
-//        }else {
96
-//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
97
-//        }
21
+///**
22
+// * <p>
23
+//    * 数字彩开奖结果  前端控制器
24
+//    * </p>
25
+// *
26
+// * @author yansen
27
+// * @since 2020-08-27
28
+// */
29
+//
30
+//@Api(tags = "数字彩开奖结果")
31
+//@RestController
32
+//@RequestMapping("/")
33
+//public class TaLotteryResultController extends BaseController {
34
+//
35
+//    private final Logger logger = LoggerFactory.getLogger(TaLotteryResultController.class);
36
+//
37
+//    @Autowired
38
+//    public ITaLotteryResultService iTaLotteryResultService;
39
+//
40
+//    @GetMapping("/app/lottery/result/last")
41
+//    @ApiOperation(value = "最新数字彩开奖结果", notes = "不区分数字彩彩种", httpMethod = "GET")
42
+//    public ResponseBean last() throws Exception {
43
+//        List<TaLotteryResult> result = iTaLotteryResultService.getLastResult();
44
+//        return ResponseBean.success(result);
98
 //    }
45
 //    }
99
 //
46
 //
100
 //    /**
47
 //    /**
101
-//     * 修改对象
102
-//     * @param id  实体ID
103
-//     * @param taLotteryResult 实体对象
48
+//     * 分页查询列表
49
+//     * @param pageNum
50
+//     * @param pageSize
104
 //     * @return
51
 //     * @return
105
 //     */
52
 //     */
106
-//    @RequestMapping(value="/taLotteryResult/{id}",method= RequestMethod.PUT)
107
-//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
108
-//    public ResponseBean taLotteryResultUpdate(@ApiParam("对象ID") @PathVariable Integer id,
109
-//                                        @ApiParam("更新内容") @RequestBody TaLotteryResult taLotteryResult) throws Exception{
53
+//    @RequestMapping(value="/app/lottery/result",method= RequestMethod.GET)
54
+//    @ApiOperation(value="数字彩开奖结果列表", notes = "数字彩开奖结果列表", httpMethod = "GET", response = ResponseBean.class)
55
+//    public ResponseBean taLotteryResultList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
56
+//									        @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
57
+//                                            @ApiParam("彩种类型: 可用类型, 请查阅彩种字典") @RequestParam(value ="lotteryId", required = false) String lotteryId) throws Exception{
110
 //
58
 //
111
-//        if (iTaLotteryResultService.updateById(taLotteryResult)){
112
-//            return ResponseBean.success(iTaLotteryResultService.getById(id));
113
-//        }else {
114
-//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
115
-//        }
116
-//    }
59
+//		    IPage<TaLotteryResult> pg = new Page<>(pageNum, pageSize);
60
+//            QueryWrapper<TaLotteryResult> queryWrapper = new QueryWrapper<>();
61
+//            queryWrapper.eq(null != lotteryId, "lottery_id", lotteryId);
62
+//            queryWrapper.eq("status", StatusEnum.NORMAL.getCode());
63
+//            queryWrapper.orderByDesc("issue_no");
64
+//            queryWrapper.orderByDesc("create_date");
117
 //
65
 //
118
-//    /**
119
-//     * 根据id查询对象
120
-//     * @param id  实体ID
121
-//     */
122
-//    @RequestMapping(value="/taLotteryResult/{id}",method= RequestMethod.GET)
123
-//    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
124
-//    public ResponseBean taLotteryResultGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
125
-//        return ResponseBean.success(iTaLotteryResultService.getById(id));
66
+//            IPage<TaLotteryResult> result = iTaLotteryResultService.page(pg, queryWrapper);
67
+//            return ResponseBean.success(result);
126
 //    }
68
 //    }
127
-}
69
+////
70
+////    /**
71
+////     * 保存对象
72
+////     * @param taLotteryResult 实体对象
73
+////     * @return
74
+////     */
75
+////    @RequestMapping(value="/taLotteryResult",method= RequestMethod.POST)
76
+////    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
77
+////    public ResponseBean taLotteryResultAdd(@ApiParam("保存内容") @RequestBody TaLotteryResult taLotteryResult) throws Exception{
78
+////
79
+////        if (iTaLotteryResultService.save(taLotteryResult)){
80
+////            return ResponseBean.success(taLotteryResult);
81
+////        }else {
82
+////            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
83
+////        }
84
+////    }
85
+////
86
+////    /**
87
+////     * 根据id删除对象
88
+////     * @param id  实体ID
89
+////     */
90
+////    @RequestMapping(value="/taLotteryResult/{id}", method= RequestMethod.DELETE)
91
+////    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
92
+////    public ResponseBean taLotteryResultDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
93
+////        if(iTaLotteryResultService.removeById(id)){
94
+////            return ResponseBean.success("success");
95
+////        }else {
96
+////            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
97
+////        }
98
+////    }
99
+////
100
+////    /**
101
+////     * 修改对象
102
+////     * @param id  实体ID
103
+////     * @param taLotteryResult 实体对象
104
+////     * @return
105
+////     */
106
+////    @RequestMapping(value="/taLotteryResult/{id}",method= RequestMethod.PUT)
107
+////    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
108
+////    public ResponseBean taLotteryResultUpdate(@ApiParam("对象ID") @PathVariable Integer id,
109
+////                                        @ApiParam("更新内容") @RequestBody TaLotteryResult taLotteryResult) throws Exception{
110
+////
111
+////        if (iTaLotteryResultService.updateById(taLotteryResult)){
112
+////            return ResponseBean.success(iTaLotteryResultService.getById(id));
113
+////        }else {
114
+////            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
115
+////        }
116
+////    }
117
+////
118
+////    /**
119
+////     * 根据id查询对象
120
+////     * @param id  实体ID
121
+////     */
122
+////    @RequestMapping(value="/taLotteryResult/{id}",method= RequestMethod.GET)
123
+////    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
124
+////    public ResponseBean taLotteryResultGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
125
+////        return ResponseBean.success(iTaLotteryResultService.getById(id));
126
+////    }
127
+//}

+ 122
- 122
src/main/java/com/yunzhi/niucai/controller/TaShopController.java Просмотреть файл

1
 package com.yunzhi.niucai.controller;
1
 package com.yunzhi.niucai.controller;
2
-
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.baomidou.mybatisplus.core.metadata.IPage;
5
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
-import com.yunzhi.niucai.common.BaseController;
7
-import com.yunzhi.niucai.common.ResponseBean;
8
-import com.yunzhi.niucai.entity.TaCustomer;
9
-import com.yunzhi.niucai.enums.StatusEnum;
10
-import io.swagger.annotations.Api;
11
-import io.swagger.annotations.ApiOperation;
12
-import io.swagger.annotations.ApiParam;
13
-import org.slf4j.Logger;
14
-import org.slf4j.LoggerFactory;
15
-import org.springframework.beans.factory.annotation.Autowired;
16
-import org.springframework.web.bind.annotation.*;
17
-import com.yunzhi.niucai.service.ITaShopService;
18
-import com.yunzhi.niucai.entity.TaShop;
19
-
20
-import javax.servlet.http.HttpServletRequest;
21
-import java.util.Map;
22
-
23
-/**
24
- * <p>
25
-    * 店铺 前端控制器
26
-    * </p>
27
- *
28
- * @author yansen
29
- * @since 2020-08-28
30
- */
31
-
32
-@Api(tags = "店铺")
33
-@RestController
34
-@RequestMapping("/")
35
-public class TaShopController extends BaseController {
36
-
37
-    private final Logger logger = LoggerFactory.getLogger(TaShopController.class);
38
-
39
-    @Autowired
40
-    public ITaShopService iTaShopService;
41
-
42
-
43
-    @GetMapping("/app/shop/available")
44
-    @ApiOperation(value = "查询用用店铺", notes = "查询用用店铺", httpMethod = "GET", response = ResponseBean.class)
45
-    public ResponseBean getAvailableList(@ApiParam("彩种类型: 可用值请查阅 彩种字典") @RequestParam String lotteryId,
46
-                                         @ApiParam("当前地点: 经度(lng),纬度(lat) 半角逗号连接") @RequestParam String location,
47
-                                         HttpServletRequest request) throws Exception{
48
-        if (location.indexOf(",") < 0) {
49
-            return ResponseBean.error("地点参数格式不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
50
-        }
51
-
52
-        TaCustomer customer = getCustomer(request);
53
-        Map<String, Object> result = iTaShopService.getAvailableList(customer, lotteryId, location);
54
-        return ResponseBean.success(result);
55
-    }
56
-
57
-//    /**
58
-//     * 分页查询列表
59
-//     * @param pageNum
60
-//     * @param pageSize
61
-//     * @return
62
-//     */
63
-//    @RequestMapping(value="/app/shop",method= RequestMethod.GET)
64
-//    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
65
-//    public ResponseBean taShopList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
66
-//                                   @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
67
 //
2
 //
68
-//		    IPage<TaShop> pg = new Page<>(pageNum, pageSize);
69
-//            QueryWrapper<TaShop> queryWrapper = new QueryWrapper<>();
70
-//            queryWrapper.orderByDesc("create_date");
3
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+//import com.baomidou.mybatisplus.core.metadata.IPage;
5
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+//import com.yunzhi.niucai.common.BaseController;
7
+//import com.yunzhi.niucai.common.ResponseBean;
8
+//import com.yunzhi.niucai.entity.TaCustomer;
9
+//import com.yunzhi.niucai.enums.StatusEnum;
10
+//import io.swagger.annotations.Api;
11
+//import io.swagger.annotations.ApiOperation;
12
+//import io.swagger.annotations.ApiParam;
13
+//import org.slf4j.Logger;
14
+//import org.slf4j.LoggerFactory;
15
+//import org.springframework.beans.factory.annotation.Autowired;
16
+//import org.springframework.web.bind.annotation.*;
17
+//import com.yunzhi.niucai.service.ITaShopService;
18
+//import com.yunzhi.niucai.entity.TaShop;
71
 //
19
 //
72
-//            IPage<TaShop> result = iTaShopService.page(pg, queryWrapper);
73
-//            return ResponseBean.success(result);
74
-//    }
20
+//import javax.servlet.http.HttpServletRequest;
21
+//import java.util.Map;
75
 //
22
 //
76
-//    /**
77
-//     * 保存对象
78
-//     * @param taShop 实体对象
79
-//     * @return
80
-//     */
81
-//    @RequestMapping(value="/taShop",method= RequestMethod.POST)
82
-//    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
83
-//    public ResponseBean taShopAdd(@ApiParam("保存内容") @RequestBody TaShop taShop) throws Exception{
23
+///**
24
+// * <p>
25
+//    * 店铺 前端控制器
26
+//    * </p>
27
+// *
28
+// * @author yansen
29
+// * @since 2020-08-28
30
+// */
84
 //
31
 //
85
-//        if (iTaShopService.save(taShop)){
86
-//            return ResponseBean.success(taShop);
87
-//        }else {
88
-//            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
-//        }
90
-//    }
32
+//@Api(tags = "店铺")
33
+//@RestController
34
+//@RequestMapping("/")
35
+//public class TaShopController extends BaseController {
91
 //
36
 //
92
-//    /**
93
-//     * 根据id删除对象
94
-//     * @param id  实体ID
95
-//     */
96
-//    @RequestMapping(value="/taShop/{id}", method= RequestMethod.DELETE)
97
-//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
98
-//    public ResponseBean taShopDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
99
-//        if(iTaShopService.removeById(id)){
100
-//            return ResponseBean.success("success");
101
-//        }else {
102
-//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
103
-//        }
104
-//    }
37
+//    private final Logger logger = LoggerFactory.getLogger(TaShopController.class);
38
+//
39
+//    @Autowired
40
+//    public ITaShopService iTaShopService;
105
 //
41
 //
106
-//    /**
107
-//     * 修改对象
108
-//     * @param id  实体ID
109
-//     * @param taShop 实体对象
110
-//     * @return
111
-//     */
112
-//    @RequestMapping(value="/taShop/{id}",method= RequestMethod.PUT)
113
-//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
114
-//    public ResponseBean taShopUpdate(@ApiParam("对象ID") @PathVariable Integer id,
115
-//                                        @ApiParam("更新内容") @RequestBody TaShop taShop) throws Exception{
116
 //
42
 //
117
-//        if (iTaShopService.updateById(taShop)){
118
-//            return ResponseBean.success(iTaShopService.getById(id));
119
-//        }else {
120
-//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
43
+//    @GetMapping("/app/shop/available")
44
+//    @ApiOperation(value = "查询用用店铺", notes = "查询用用店铺", httpMethod = "GET", response = ResponseBean.class)
45
+//    public ResponseBean getAvailableList(@ApiParam("彩种类型: 可用值请查阅 彩种字典") @RequestParam String lotteryId,
46
+//                                         @ApiParam("当前地点: 经度(lng),纬度(lat) 半角逗号连接") @RequestParam String location,
47
+//                                         HttpServletRequest request) throws Exception{
48
+//        if (location.indexOf(",") < 0) {
49
+//            return ResponseBean.error("地点参数格式不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
121
 //        }
50
 //        }
122
-//    }
123
 //
51
 //
124
-//    /**
125
-//     * 根据id查询对象
126
-//     * @param id  实体ID
127
-//     */
128
-//    @RequestMapping(value="/taShop/{id}",method= RequestMethod.GET)
129
-//    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
130
-//    public ResponseBean taShopGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
131
-//        return ResponseBean.success(iTaShopService.getById(id));
52
+//        TaCustomer customer = getCustomer(request);
53
+//        Map<String, Object> result = iTaShopService.getAvailableList(customer, lotteryId, location);
54
+//        return ResponseBean.success(result);
132
 //    }
55
 //    }
133
-}
56
+//
57
+////    /**
58
+////     * 分页查询列表
59
+////     * @param pageNum
60
+////     * @param pageSize
61
+////     * @return
62
+////     */
63
+////    @RequestMapping(value="/app/shop",method= RequestMethod.GET)
64
+////    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
65
+////    public ResponseBean taShopList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
66
+////                                   @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
67
+////
68
+////		    IPage<TaShop> pg = new Page<>(pageNum, pageSize);
69
+////            QueryWrapper<TaShop> queryWrapper = new QueryWrapper<>();
70
+////            queryWrapper.orderByDesc("create_date");
71
+////
72
+////            IPage<TaShop> result = iTaShopService.page(pg, queryWrapper);
73
+////            return ResponseBean.success(result);
74
+////    }
75
+////
76
+////    /**
77
+////     * 保存对象
78
+////     * @param taShop 实体对象
79
+////     * @return
80
+////     */
81
+////    @RequestMapping(value="/taShop",method= RequestMethod.POST)
82
+////    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
83
+////    public ResponseBean taShopAdd(@ApiParam("保存内容") @RequestBody TaShop taShop) throws Exception{
84
+////
85
+////        if (iTaShopService.save(taShop)){
86
+////            return ResponseBean.success(taShop);
87
+////        }else {
88
+////            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
89
+////        }
90
+////    }
91
+////
92
+////    /**
93
+////     * 根据id删除对象
94
+////     * @param id  实体ID
95
+////     */
96
+////    @RequestMapping(value="/taShop/{id}", method= RequestMethod.DELETE)
97
+////    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
98
+////    public ResponseBean taShopDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
99
+////        if(iTaShopService.removeById(id)){
100
+////            return ResponseBean.success("success");
101
+////        }else {
102
+////            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
103
+////        }
104
+////    }
105
+////
106
+////    /**
107
+////     * 修改对象
108
+////     * @param id  实体ID
109
+////     * @param taShop 实体对象
110
+////     * @return
111
+////     */
112
+////    @RequestMapping(value="/taShop/{id}",method= RequestMethod.PUT)
113
+////    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
114
+////    public ResponseBean taShopUpdate(@ApiParam("对象ID") @PathVariable Integer id,
115
+////                                        @ApiParam("更新内容") @RequestBody TaShop taShop) throws Exception{
116
+////
117
+////        if (iTaShopService.updateById(taShop)){
118
+////            return ResponseBean.success(iTaShopService.getById(id));
119
+////        }else {
120
+////            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
121
+////        }
122
+////    }
123
+////
124
+////    /**
125
+////     * 根据id查询对象
126
+////     * @param id  实体ID
127
+////     */
128
+////    @RequestMapping(value="/taShop/{id}",method= RequestMethod.GET)
129
+////    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
130
+////    public ResponseBean taShopGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
131
+////        return ResponseBean.success(iTaShopService.getById(id));
132
+////    }
133
+//}

+ 113
- 113
src/main/java/com/yunzhi/niucai/controller/TdLotteryController.java Просмотреть файл

1
 package com.yunzhi.niucai.controller;
1
 package com.yunzhi.niucai.controller;
2
-
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.baomidou.mybatisplus.core.metadata.IPage;
5
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
-import com.yunzhi.niucai.common.BaseController;
7
-import com.yunzhi.niucai.common.ResponseBean;
8
-import com.yunzhi.niucai.enums.StatusEnum;
9
-import io.swagger.annotations.Api;
10
-import io.swagger.annotations.ApiOperation;
11
-import io.swagger.annotations.ApiParam;
12
-import org.slf4j.Logger;
13
-import org.slf4j.LoggerFactory;
14
-import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.web.bind.annotation.PathVariable;
16
-import org.springframework.web.bind.annotation.RequestBody;
17
-import org.springframework.web.bind.annotation.RequestMapping;
18
-import org.springframework.web.bind.annotation.RequestMethod;
19
-import org.springframework.web.bind.annotation.RequestParam;
20
-import com.yunzhi.niucai.service.ITdLotteryService;
21
-import com.yunzhi.niucai.entity.TdLottery;
22
-import org.springframework.web.bind.annotation.RestController;
23
-
24
-/**
25
- * <p>
26
-    * 彩种 前端控制器
27
-    * </p>
28
- *
29
- * @author yansen
30
- * @since 2020-08-27
31
- */
32
-
33
-@Api(tags = "彩种管理")
34
-@RestController
35
-@RequestMapping("/")
36
-public class TdLotteryController extends BaseController {
37
-
38
-    private final Logger logger = LoggerFactory.getLogger(TdLotteryController.class);
39
-
40
-    @Autowired
41
-    public ITdLotteryService iTdLotteryService;
42
-
43
-
44
-    /**
45
-     * 分页查询列表
46
-     * @param pageNum
47
-     * @param pageSize
48
-     * @return
49
-     */
50
-    @RequestMapping(value="/{client}/lottery",method= RequestMethod.GET)
51
-    @ApiOperation(value="获取当前开通彩种", notes = "如果 isDigit = true 则只返回数字彩", httpMethod = "GET", response = ResponseBean.class)
52
-    public ResponseBean tdLotteryList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
53
-									  @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
54
-                                      @ApiParam("是否数字彩") @RequestParam(value ="isDigit", required = false) Boolean isDigit,
55
-                                      @ApiParam(value = "客户端", allowableValues = "app, shop") @PathVariable("client") String client) throws Exception{
56
-
57
-		    IPage<TdLottery> pg = new Page<>(pageNum, pageSize);
58
-            QueryWrapper<TdLottery> queryWrapper = new QueryWrapper<>();
59
-            queryWrapper.eq(null != isDigit, "is_digit", isDigit);
60
-            queryWrapper.eq("status", StatusEnum.NORMAL.getCode());
61
-            queryWrapper.orderByAsc("sort_no");
62
-
63
-            IPage<TdLottery> result = iTdLotteryService.page(pg, queryWrapper);
64
-            return ResponseBean.success(result);
65
-    }
66
 //
2
 //
67
-//    /**
68
-//     * 保存对象
69
-//     * @param tdLottery 实体对象
70
-//     * @return
71
-//     */
72
-//    @RequestMapping(value="/tdLottery",method= RequestMethod.POST)
73
-//    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
74
-//    public ResponseBean tdLotteryAdd(@ApiParam("保存内容") @RequestBody TdLottery tdLottery) throws Exception{
3
+//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+//import com.baomidou.mybatisplus.core.metadata.IPage;
5
+//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+//import com.yunzhi.niucai.common.BaseController;
7
+//import com.yunzhi.niucai.common.ResponseBean;
8
+//import com.yunzhi.niucai.enums.StatusEnum;
9
+//import io.swagger.annotations.Api;
10
+//import io.swagger.annotations.ApiOperation;
11
+//import io.swagger.annotations.ApiParam;
12
+//import org.slf4j.Logger;
13
+//import org.slf4j.LoggerFactory;
14
+//import org.springframework.beans.factory.annotation.Autowired;
15
+//import org.springframework.web.bind.annotation.PathVariable;
16
+//import org.springframework.web.bind.annotation.RequestBody;
17
+//import org.springframework.web.bind.annotation.RequestMapping;
18
+//import org.springframework.web.bind.annotation.RequestMethod;
19
+//import org.springframework.web.bind.annotation.RequestParam;
20
+//import com.yunzhi.niucai.service.ITdLotteryService;
21
+//import com.yunzhi.niucai.entity.TdLottery;
22
+//import org.springframework.web.bind.annotation.RestController;
75
 //
23
 //
76
-//        if (iTdLotteryService.save(tdLottery)){
77
-//            return ResponseBean.success(tdLottery);
78
-//        }else {
79
-//            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
80
-//        }
81
-//    }
24
+///**
25
+// * <p>
26
+//    * 彩种 前端控制器
27
+//    * </p>
28
+// *
29
+// * @author yansen
30
+// * @since 2020-08-27
31
+// */
32
+//
33
+//@Api(tags = "彩种管理")
34
+//@RestController
35
+//@RequestMapping("/")
36
+//public class TdLotteryController extends BaseController {
37
+//
38
+//    private final Logger logger = LoggerFactory.getLogger(TdLotteryController.class);
39
+//
40
+//    @Autowired
41
+//    public ITdLotteryService iTdLotteryService;
82
 //
42
 //
83
-//    /**
84
-//     * 根据id删除对象
85
-//     * @param id  实体ID
86
-//     */
87
-//    @RequestMapping(value="/tdLottery/{id}", method= RequestMethod.DELETE)
88
-//    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
89
-//    public ResponseBean tdLotteryDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
90
-//        if(iTdLotteryService.removeById(id)){
91
-//            return ResponseBean.success("success");
92
-//        }else {
93
-//            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
94
-//        }
95
-//    }
96
 //
43
 //
97
 //    /**
44
 //    /**
98
-//     * 修改对象
99
-//     * @param id  实体ID
100
-//     * @param tdLottery 实体对象
45
+//     * 分页查询列表
46
+//     * @param pageNum
47
+//     * @param pageSize
101
 //     * @return
48
 //     * @return
102
 //     */
49
 //     */
103
-//    @RequestMapping(value="/tdLottery/{id}",method= RequestMethod.PUT)
104
-//    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
105
-//    public ResponseBean tdLotteryUpdate(@ApiParam("对象ID") @PathVariable Integer id,
106
-//                                        @ApiParam("更新内容") @RequestBody TdLottery tdLottery) throws Exception{
50
+//    @RequestMapping(value="/{client}/lottery",method= RequestMethod.GET)
51
+//    @ApiOperation(value="获取当前开通彩种", notes = "如果 isDigit = true 则只返回数字彩", httpMethod = "GET", response = ResponseBean.class)
52
+//    public ResponseBean tdLotteryList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
53
+//									  @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
54
+//                                      @ApiParam("是否数字彩") @RequestParam(value ="isDigit", required = false) Boolean isDigit,
55
+//                                      @ApiParam(value = "客户端", allowableValues = "app, shop") @PathVariable("client") String client) throws Exception{
107
 //
56
 //
108
-//        if (iTdLotteryService.updateById(tdLottery)){
109
-//            return ResponseBean.success(iTdLotteryService.getById(id));
110
-//        }else {
111
-//            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
112
-//        }
113
-//    }
57
+//		    IPage<TdLottery> pg = new Page<>(pageNum, pageSize);
58
+//            QueryWrapper<TdLottery> queryWrapper = new QueryWrapper<>();
59
+//            queryWrapper.eq(null != isDigit, "is_digit", isDigit);
60
+//            queryWrapper.eq("status", StatusEnum.NORMAL.getCode());
61
+//            queryWrapper.orderByAsc("sort_no");
114
 //
62
 //
115
-//    /**
116
-//     * 根据id查询对象
117
-//     * @param id  实体ID
118
-//     */
119
-//    @RequestMapping(value="/tdLottery/{id}",method= RequestMethod.GET)
120
-//    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
121
-//    public ResponseBean tdLotteryGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
122
-//        return ResponseBean.success(iTdLotteryService.getById(id));
63
+//            IPage<TdLottery> result = iTdLotteryService.page(pg, queryWrapper);
64
+//            return ResponseBean.success(result);
123
 //    }
65
 //    }
124
-}
66
+////
67
+////    /**
68
+////     * 保存对象
69
+////     * @param tdLottery 实体对象
70
+////     * @return
71
+////     */
72
+////    @RequestMapping(value="/tdLottery",method= RequestMethod.POST)
73
+////    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
74
+////    public ResponseBean tdLotteryAdd(@ApiParam("保存内容") @RequestBody TdLottery tdLottery) throws Exception{
75
+////
76
+////        if (iTdLotteryService.save(tdLottery)){
77
+////            return ResponseBean.success(tdLottery);
78
+////        }else {
79
+////            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
80
+////        }
81
+////    }
82
+////
83
+////    /**
84
+////     * 根据id删除对象
85
+////     * @param id  实体ID
86
+////     */
87
+////    @RequestMapping(value="/tdLottery/{id}", method= RequestMethod.DELETE)
88
+////    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
89
+////    public ResponseBean tdLotteryDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
90
+////        if(iTdLotteryService.removeById(id)){
91
+////            return ResponseBean.success("success");
92
+////        }else {
93
+////            return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
94
+////        }
95
+////    }
96
+////
97
+////    /**
98
+////     * 修改对象
99
+////     * @param id  实体ID
100
+////     * @param tdLottery 实体对象
101
+////     * @return
102
+////     */
103
+////    @RequestMapping(value="/tdLottery/{id}",method= RequestMethod.PUT)
104
+////    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
105
+////    public ResponseBean tdLotteryUpdate(@ApiParam("对象ID") @PathVariable Integer id,
106
+////                                        @ApiParam("更新内容") @RequestBody TdLottery tdLottery) throws Exception{
107
+////
108
+////        if (iTdLotteryService.updateById(tdLottery)){
109
+////            return ResponseBean.success(iTdLotteryService.getById(id));
110
+////        }else {
111
+////            return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
112
+////        }
113
+////    }
114
+////
115
+////    /**
116
+////     * 根据id查询对象
117
+////     * @param id  实体ID
118
+////     */
119
+////    @RequestMapping(value="/tdLottery/{id}",method= RequestMethod.GET)
120
+////    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
121
+////    public ResponseBean tdLotteryGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
122
+////        return ResponseBean.success(iTdLotteryService.getById(id));
123
+////    }
124
+//}

+ 1
- 1
src/main/resources/application.yml Просмотреть файл

9
   permission:
9
   permission:
10
     enable: true
10
     enable: true
11
     include-paths: /**
11
     include-paths: /**
12
-    exclude-paths: /app/login, /app/logout,/swagger-ui
12
+    exclude-paths: /app/login, /app/logout,/swagger-ui/**,/swagger-resources/**
13
 
13
 
14
 ###
14
 ###
15
 mybatis-plus:
15
 mybatis-plus: