TestController.java
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.order.erp.controller;
import com.canrd.shop.common.annotation.AnonymousAccess;
import com.canrd.shop.common.constant.ServerResult;
import com.canrd.shop.domain.vo.TestQueryVO;
import com.canrd.shop.domain.vo.TestVO;
import com.canrd.shop.service.TestService;
import lombok.extern.slf4j.Slf4j;
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;
/**
* @projectName: canrd-services
* @package: com.canrd.shop.controller
* @className: TestController
* @author: xms
* @description: TODO
* @date: 2023/3/29 18:53
* @version: 1.0
*/
@RestController
@RequestMapping("/admin/shop/test")
@Slf4j
public class TestController {
@Resource
private TestService testService;
/**
* @param queryVO
* @return
*/
@AnonymousAccess
@PostMapping("/demo")
public ServerResult demo(@RequestBody TestQueryVO queryVO) {
log.info("查询用户列表:{}", queryVO);
return ServerResult.success(testService.pageList(queryVO));
}
/**
* @param testVO
* @return
*/
@PostMapping("/add")
public ServerResult add(@RequestBody TestVO testVO) {
log.info("新增用户列表:{}", testVO);
testService.add(testVO);
return ServerResult.success();
}
}