SysCodeController.java
1.63 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
package cn.com.glsx.smart.modules.controller;
import java.util.List;
import cn.com.glsx.smart.modules.entity.SmartSysCode;
import cn.com.glsx.smart.modules.model.ValidateGroups;
import cn.com.glsx.smart.modules.model.request.SysCodeReq;
import cn.com.glsx.smart.modules.service.SmartSysCodeService;
import com.alibaba.fastjson.JSON;
import com.glsx.plat.core.web.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
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;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-15
*/
@Slf4j
@RestController
@RequestMapping("/sysCode")
public class SysCodeController {
@Autowired
private SmartSysCodeService sysCodeService;
@GetMapping("/getList")
public R getList(@Validated(ValidateGroups.Query.class) SysCodeReq req) {
log.info("/sysCode/getList param: {}", JSON.toJSONString(req));
List<SmartSysCode> sysCodeList = sysCodeService.getList(req);
return R.ok().data(sysCodeList);
}
@PostMapping("/getListByCondition")
public R getListByCondition(@RequestBody SysCodeReq req) {
log.info("/sysCode/getListByCondition param: {}", JSON.toJSONString(req));
List<SmartSysCode> sysCodeList = sysCodeService.getList(req);
return R.ok().data(sysCodeList);
}
}