“谢茂盛”
authored
|
1
2
|
package com.order.erp.controller;
|
“谢茂盛”
authored
|
3
|
import com.order.erp.common.annotation.AnonymousAccess;
|
“谢茂盛”
authored
|
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
|
import com.order.erp.common.constant.ServerResult;
import com.order.erp.domain.vo.admin.AdminDeptQueryVO;
import com.order.erp.domain.vo.admin.AdminDeptVO;
import com.order.erp.log.Log;
import com.order.erp.service.admin.AdminDeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @date 2019-03-25
*/
@RestController
@Api(tags = "系统:部门管理")
@RequestMapping("/order/erp/depts")
public class DeptController {
@Resource
private AdminDeptService deptService;
@Log("查询部门")
@ApiOperation("查询部门")
@PostMapping(value = "/list_by_page")
|
“谢茂盛”
authored
|
32
|
@AnonymousAccess
|
“谢茂盛”
authored
|
33
34
35
36
37
38
39
|
public ServerResult listByPage(@RequestBody @Validated AdminDeptQueryVO queryVO) {
return deptService.list(queryVO);
}
@Log("新增部门")
@ApiOperation("新增部门")
@PostMapping("/add")
|
“谢茂盛”
authored
|
40
|
@AnonymousAccess
|
“谢茂盛”
authored
|
41
42
43
44
45
46
47
|
public ServerResult add(@RequestBody @Validated AdminDeptVO deptVO) {
return deptService.add(deptVO);
}
@Log("修改部门")
@ApiOperation("修改部门")
@PutMapping
|
“谢茂盛”
authored
|
48
|
@AnonymousAccess
|
“谢茂盛”
authored
|
49
50
51
52
53
54
55
|
public ServerResult edit(@RequestBody @Validated AdminDeptVO deptVO) {
return deptService.edit(deptVO);
}
@Log("删除部门")
@ApiOperation("删除部门")
@DeleteMapping
|
“谢茂盛”
authored
|
56
|
@AnonymousAccess
|
“谢茂盛”
authored
|
57
|
public ServerResult delete(@RequestBody @Validated AdminDeptQueryVO queryVO) {
|
“谢茂盛”
authored
|
58
|
return deptService.deleteById(queryVO);
|
“谢茂盛”
authored
|
59
60
|
}
}
|