|
@@ -16,18 +16,33 @@ public class TestController {
|
|
@Autowired
|
|
@Autowired
|
|
private TestService testService;
|
|
private TestService testService;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 列表查询
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@GetMapping()
|
|
@GetMapping()
|
|
public Object list() {
|
|
public Object list() {
|
|
List list = testService.list();
|
|
List list = testService.list();
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 创建数据
|
|
|
|
+ * @param test
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@PostMapping()
|
|
@PostMapping()
|
|
public Object save(@RequestBody Test test) {
|
|
public Object save(@RequestBody Test test) {
|
|
boolean result = testService.save(test);
|
|
boolean result = testService.save(test);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 修改数据
|
|
|
|
+ * @param id
|
|
|
|
+ * @param test
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@PostMapping("/{id}")
|
|
@PostMapping("/{id}")
|
|
public Object update(@PathVariable long id, @RequestBody Test test) {
|
|
public Object update(@PathVariable long id, @RequestBody Test test) {
|
|
QueryWrapper<Test> qw = new QueryWrapper<Test>();
|
|
QueryWrapper<Test> qw = new QueryWrapper<Test>();
|