|
@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
4
|
4
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.njyunzhi.servsummary.common.BaseController;
|
|
7
|
+import com.njyunzhi.servsummary.common.Constants;
|
7
|
8
|
import com.njyunzhi.servsummary.common.ResponseBean;
|
|
9
|
+
|
8
|
10
|
import java.util.List;
|
|
11
|
+
|
|
12
|
+import com.njyunzhi.servsummary.common.StringUtils;
|
9
|
13
|
import io.swagger.annotations.Api;
|
10
|
14
|
import io.swagger.annotations.ApiOperation;
|
11
|
15
|
import io.swagger.annotations.ApiParam;
|
|
@@ -14,8 +18,9 @@ import org.springframework.web.bind.annotation.*;
|
14
|
18
|
import com.njyunzhi.servsummary.entity.TaPlatform;
|
15
|
19
|
import com.njyunzhi.servsummary.service.TaPlatformService;
|
16
|
20
|
|
17
|
|
- /**
|
|
21
|
+/**
|
18
|
22
|
* 云平台;(ta_platform)表控制层
|
|
23
|
+ *
|
19
|
24
|
* @author : http://njyunzhi.com
|
20
|
25
|
* @date : 2022-11-22
|
21
|
26
|
*/
|
|
@@ -23,12 +28,12 @@ import com.njyunzhi.servsummary.service.TaPlatformService;
|
23
|
28
|
@RestController
|
24
|
29
|
@RequestMapping("/")
|
25
|
30
|
public class TaPlatformController extends BaseController {
|
26
|
|
-
|
|
31
|
+
|
27
|
32
|
@Autowired
|
28
|
33
|
private TaPlatformService taPlatformService;
|
29
|
|
-
|
30
|
|
- /**
|
31
|
|
- * 通过ID查询单条数据
|
|
34
|
+
|
|
35
|
+ /**
|
|
36
|
+ * 通过ID查询单条数据
|
32
|
37
|
*
|
33
|
38
|
* @param cloudId 主键
|
34
|
39
|
* @return 实例对象
|
|
@@ -38,28 +43,31 @@ public class TaPlatformController extends BaseController {
|
38
|
43
|
public ResponseBean queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
|
39
|
44
|
return ResponseBean.success(taPlatformService.getById(id));
|
40
|
45
|
}
|
41
|
|
-
|
42
|
|
- /**
|
|
46
|
+
|
|
47
|
+ /**
|
43
|
48
|
* 分页查询
|
44
|
49
|
*
|
45
|
|
- * @param pageNum 当前页码
|
|
50
|
+ * @param pageNum 当前页码
|
46
|
51
|
* @param pageSize 每页条数
|
47
|
52
|
* @return 查询结果
|
48
|
53
|
*/
|
49
|
54
|
@ApiOperation("分页查询")
|
50
|
55
|
@GetMapping("/taPlatform")
|
51
|
|
- public ResponseBean list(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
52
|
|
- @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception {
|
53
|
|
-
|
|
56
|
+ public ResponseBean list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
57
|
+ @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
|
|
58
|
+
|
54
|
59
|
IPage<TaPlatform> pg = new Page<>(pageNum, pageSize);
|
55
|
|
- // QueryWrapper<TaPlatform> queryWrapper = new QueryWrapper<>();
|
56
|
|
- // queryWrapper.orderByDesc("create_date");
|
|
60
|
+// QueryWrapper<TaPlatform> queryWrapper = new QueryWrapper<>();
|
|
61
|
+// queryWrapper.gt("status", Constants.STATUS_DELETE);
|
|
62
|
+// queryWrapper.eq(null != status, "status", status);
|
|
63
|
+// queryWrapper.like(!StringUtils.isEmpty(url), "url", url);
|
|
64
|
+// queryWrapper.orderByAsc("expire_date");
|
57
|
65
|
IPage<TaPlatform> result = taPlatformService.page(pg);
|
58
|
|
-
|
|
66
|
+
|
59
|
67
|
return ResponseBean.success(result);
|
60
|
68
|
}
|
61
|
|
-
|
62
|
|
- /**
|
|
69
|
+
|
|
70
|
+ /**
|
63
|
71
|
* 新增数据
|
64
|
72
|
*
|
65
|
73
|
* @param taPlatform 实例对象
|
|
@@ -71,8 +79,8 @@ public class TaPlatformController extends BaseController {
|
71
|
79
|
taPlatformService.save(taPlatform);
|
72
|
80
|
return ResponseBean.success(taPlatform);
|
73
|
81
|
}
|
74
|
|
-
|
75
|
|
- /**
|
|
82
|
+
|
|
83
|
+ /**
|
76
|
84
|
* 更新数据
|
77
|
85
|
*
|
78
|
86
|
* @param taPlatform 实例对象
|
|
@@ -81,12 +89,12 @@ public class TaPlatformController extends BaseController {
|
81
|
89
|
@ApiOperation("更新数据")
|
82
|
90
|
@PutMapping("/taPlatform/{id}")
|
83
|
91
|
public ResponseBean edit(@ApiParam("对象实体") @RequestBody TaPlatform taPlatform,
|
84
|
|
- @ApiParam("对象ID") @PathVariable String id ) throws Exception {
|
|
92
|
+ @ApiParam("对象ID") @PathVariable String id) throws Exception {
|
85
|
93
|
taPlatformService.updateById(taPlatform);
|
86
|
94
|
return ResponseBean.success(taPlatform);
|
87
|
95
|
}
|
88
|
|
-
|
89
|
|
- /**
|
|
96
|
+
|
|
97
|
+ /**
|
90
|
98
|
* 通过主键删除数据
|
91
|
99
|
*
|
92
|
100
|
* @param cloudId 主键
|
|
@@ -94,7 +102,7 @@ public class TaPlatformController extends BaseController {
|
94
|
102
|
*/
|
95
|
103
|
@ApiOperation("通过主键删除数据")
|
96
|
104
|
@DeleteMapping("/taPlatform/{id}")
|
97
|
|
- public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id){
|
|
105
|
+ public ResponseBean deleteById(@ApiParam("对象ID") @PathVariable String id) {
|
98
|
106
|
taPlatformService.removeLogicById(id);
|
99
|
107
|
return ResponseBean.success("success");
|
100
|
108
|
}
|