谢茂盛
authored
|
1
2
3
4
5
6
7
8
|
package com.canrd.webmagic.controller;
import com.canrd.webmagic.common.constant.ServerResult;
import com.canrd.webmagic.common.jsr303.OperateGroup;
import com.canrd.webmagic.domain.vo.TestQueryVO;
import com.canrd.webmagic.domain.vo.TestVO;
import com.canrd.webmagic.service.TestService;
|
凌世锦
authored
|
9
10
|
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
|
谢茂盛
authored
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* (Test)表控制层
*
* @author makejava
* @since 2024-01-12 14:36:56
*/
@RestController
@RequestMapping("/lift-hub/test")
|
凌世锦
authored
|
27
|
@Api("lift-hub")
|
谢茂盛
authored
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
public class TestController {
/**
* 服务对象
*/
@Resource
private TestService testService;
/**
* 分页查询
*
* @param testQueryVO 查询条件
* @return 查询结果
*/
@PostMapping("/list")
|
凌世锦
authored
|
42
|
@ApiOperation("list")
|
谢茂盛
authored
|
43
44
45
46
47
48
49
50
51
52
53
|
public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) TestQueryVO testQueryVO) {
return testService.list(testQueryVO);
}
/**
* 通过主键查询单条数据
*
* @param testQueryVO 查询条件
* @return 单条数据
*/
@PostMapping("/query_by_id")
|
凌世锦
authored
|
54
|
@ApiOperation("query_by_id")
|
谢茂盛
authored
|
55
56
57
58
59
60
61
62
63
64
65
|
public ServerResult queryById(@RequestBody TestQueryVO testQueryVO) {
return testService.queryById(testQueryVO);
}
/**
* 新增数据
*
* @param testVO 数据VO
* @return 新增结果
*/
@PostMapping("/add")
|
凌世锦
authored
|
66
|
@ApiOperation("add")
|
谢茂盛
authored
|
67
68
69
70
71
72
73
74
75
76
77
|
public ServerResult add(@RequestBody TestVO testVO) {
return testService.add(testVO);
}
/**
* 编辑数据
*
* @param testVO 数据VO
* @return 编辑结果
*/
@PostMapping("/edit")
|
凌世锦
authored
|
78
|
@ApiOperation("edit")
|
谢茂盛
authored
|
79
80
81
82
83
84
85
86
87
88
89
|
public ServerResult edit(@RequestBody TestVO testVO) {
return testService.edit(testVO);
}
/**
* 删除数据
*
* @param testQueryVO 查询条件
* @return 删除是否成功
*/
@PostMapping("/delete_by_id")
|
凌世锦
authored
|
90
|
@ApiOperation("delete_by_id")
|
谢茂盛
authored
|
91
92
93
94
95
96
|
public ServerResult deleteById(@RequestBody TestQueryVO testQueryVO) {
return testService.deleteById(testQueryVO);
}
}
|