提交 | 用户 | 时间
|
1ac2bc
|
1 |
package cn.stylefeng.guns.sys.modular.rest.controller; |
懒 |
2 |
|
|
3 |
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo; |
|
4 |
import cn.stylefeng.guns.sys.modular.rest.entity.RestDictType; |
|
5 |
import cn.stylefeng.guns.sys.modular.rest.service.RestDictTypeService; |
|
6 |
import cn.stylefeng.guns.sys.modular.system.model.params.DictTypeParam; |
|
7 |
import cn.stylefeng.roses.core.base.controller.BaseController; |
|
8 |
import cn.stylefeng.roses.kernel.model.response.ResponseData; |
|
9 |
import cn.stylefeng.roses.kernel.model.response.SuccessResponseData; |
|
10 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
11 |
import org.springframework.beans.factory.annotation.Autowired; |
|
12 |
import org.springframework.web.bind.annotation.RequestBody; |
|
13 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
14 |
import org.springframework.web.bind.annotation.RestController; |
|
15 |
|
|
16 |
import java.util.List; |
|
17 |
|
|
18 |
|
|
19 |
/** |
|
20 |
* 字典类型表控制器 |
|
21 |
* |
|
22 |
* @author stylefeng |
|
23 |
* @Date 2019-03-13 1:54 |
|
24 |
*/ |
|
25 |
@RestController |
|
26 |
@RequestMapping("/rest/dictType") |
|
27 |
public class RestDictTypeController extends BaseController { |
|
28 |
|
|
29 |
@Autowired |
|
30 |
private RestDictTypeService restDictTypeService; |
|
31 |
|
|
32 |
/** |
|
33 |
* 新增接口 |
|
34 |
* |
|
35 |
* @author stylefeng |
|
36 |
* @Date 2019-03-13 |
|
37 |
*/ |
|
38 |
@RequestMapping("/addItem") |
|
39 |
public ResponseData addItem(@RequestBody DictTypeParam dictTypeParam) { |
|
40 |
this.restDictTypeService.add(dictTypeParam); |
|
41 |
return ResponseData.success(); |
|
42 |
} |
|
43 |
|
|
44 |
/** |
|
45 |
* 编辑接口 |
|
46 |
* |
|
47 |
* @author stylefeng |
|
48 |
* @Date 2019-03-13 |
|
49 |
*/ |
|
50 |
@RequestMapping("/editItem") |
|
51 |
public ResponseData editItem(@RequestBody DictTypeParam dictTypeParam) { |
|
52 |
this.restDictTypeService.update(dictTypeParam); |
|
53 |
return ResponseData.success(); |
|
54 |
} |
|
55 |
|
|
56 |
/** |
|
57 |
* 删除接口 |
|
58 |
* |
|
59 |
* @author stylefeng |
|
60 |
* @Date 2019-03-13 |
|
61 |
*/ |
|
62 |
@RequestMapping("/delete") |
|
63 |
public ResponseData delete(@RequestBody DictTypeParam dictTypeParam) { |
|
64 |
this.restDictTypeService.delete(dictTypeParam); |
|
65 |
return ResponseData.success(); |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* 查看详情接口 |
|
70 |
* |
|
71 |
* @author stylefeng |
|
72 |
* @Date 2019-03-13 |
|
73 |
*/ |
|
74 |
@RequestMapping("/detail") |
|
75 |
public ResponseData detail(@RequestBody DictTypeParam dictTypeParam) { |
|
76 |
RestDictType detail = this.restDictTypeService.getById(dictTypeParam.getDictTypeId()); |
|
77 |
return ResponseData.success(detail); |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* 查询列表 |
|
82 |
* |
|
83 |
* @author stylefeng |
|
84 |
* @Date 2019-03-13 |
|
85 |
*/ |
|
86 |
@RequestMapping("/list") |
|
87 |
public LayuiPageInfo list(@RequestBody DictTypeParam dictTypeParam) { |
|
88 |
return this.restDictTypeService.findPageBySpec(dictTypeParam); |
|
89 |
} |
|
90 |
|
|
91 |
/** |
|
92 |
* 查询所有字典 |
|
93 |
* |
|
94 |
* @author stylefeng |
|
95 |
* @Date 2019-03-13 |
|
96 |
*/ |
|
97 |
@RequestMapping("/listTypes") |
|
98 |
public ResponseData listTypes() { |
|
99 |
|
|
100 |
QueryWrapper<RestDictType> objectQueryWrapper = new QueryWrapper<>(); |
|
101 |
objectQueryWrapper.select("dict_type_id", "code", "name"); |
|
102 |
|
|
103 |
List<RestDictType> list = this.restDictTypeService.list(objectQueryWrapper); |
|
104 |
return new SuccessResponseData(list); |
|
105 |
} |
|
106 |
|
|
107 |
} |
|
108 |
|
|
109 |
|