FormController.java
1.93 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
57
58
59
60
61
62
63
64
65
66
67
package vion.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import vion.dto.FormDTO;
import vion.service.IFormService;
import vion.vo.FormVO;
/**
* 表单集合
*/
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class FormController {
private final IFormService formService;
@GetMapping("/form")
@SaCheckPermission(value = "form:list", orRole = "admin")
public Page<FormVO> list(FormDTO dto) {
return formService.list(dto);
}
@PostMapping("/form")
@SaCheckPermission(value = "form:save", orRole = "admin")
public Object save(@RequestBody FormDTO dto) {
return formService.save(dto);
}
@PostMapping("/form/{id}")
@SaCheckPermission(value = "form:edit", orRole = "admin")
public String updateById(@PathVariable Long id, @RequestBody FormDTO dto) {
return formService.updateById(id, dto);
}
@GetMapping("/form/{id}")
@SaCheckPermission(value = "form:query", orRole = "admin")
public FormVO getById(@PathVariable Long id) {
return formService.getByUniqueId(id, null);
}
@DeleteMapping("/form/{id}")
@SaCheckPermission(value = "form:remove", orRole = "admin")
public String removeById(@PathVariable Long id) {
return formService.removeById(id) ? "删除成功" : "删除失败";
}
@GetMapping("/form/sign/{uuid}")
public FormVO getByUuid(@PathVariable String uuid) {
return formService.getByUniqueId(null, uuid);
}
/**
* 签字专用更新接口
*
* @param uuid uuid
* @param dto dto
* @return java.lang.String
*/
@PostMapping("/form/sign/{uuid}")
public String updByUuid(@PathVariable String uuid, @RequestBody FormDTO dto) {
return formService.updByUuid(uuid, dto);
}
}