提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.mcs.controller.admin; |
H |
2 |
|
|
3 |
import com.iailab.common.annotation.LogOperation; |
|
4 |
import com.iailab.framework.common.pojo.CommonResult; |
|
5 |
import com.iailab.framework.common.util.validation.ValidationUtils; |
|
6 |
import com.iailab.framework.common.validation.group.DefaultGroup; |
|
7 |
import com.iailab.framework.common.validation.group.UpdateGroup; |
|
8 |
import com.iailab.module.mcs.dto.StModelDocDTO; |
|
9 |
import com.iailab.module.mcs.service.StModelDocService; |
|
10 |
import io.swagger.v3.oas.annotations.Operation; |
|
11 |
import javax.annotation.Resource; |
|
12 |
import org.springframework.transaction.annotation.Transactional; |
|
13 |
import org.springframework.web.bind.annotation.*; |
|
14 |
|
|
15 |
|
|
16 |
@RestController |
|
17 |
@RequestMapping("/model/mcs/st-model-doc") |
|
18 |
public class StModelDocController { |
|
19 |
|
|
20 |
@Resource |
|
21 |
private StModelDocService stModelDocService; |
|
22 |
|
|
23 |
@GetMapping("{id}") |
|
24 |
@Operation(summary = "信息") |
|
25 |
public CommonResult<StModelDocDTO> get(@PathVariable("id") String id) { |
|
26 |
StModelDocDTO data = stModelDocService.get(id); |
|
27 |
|
|
28 |
return new CommonResult<StModelDocDTO>().setData(data); |
|
29 |
} |
|
30 |
|
|
31 |
@PutMapping |
|
32 |
@Operation(summary = "修改") |
|
33 |
@LogOperation("修改") |
|
34 |
public CommonResult update(@RequestBody StModelDocDTO dto){ |
|
35 |
//效验数据 |
|
36 |
ValidationUtils.validate(dto, UpdateGroup.class, DefaultGroup.class); |
|
37 |
stModelDocService.update(dto); |
|
38 |
return new CommonResult(); |
|
39 |
} |
|
40 |
|
|
41 |
@PostMapping |
|
42 |
@Operation(summary = "保存") |
|
43 |
@LogOperation("保存") |
|
44 |
@Transactional |
|
45 |
public CommonResult save(@RequestBody StModelDocDTO dto){ |
|
46 |
//效验数据 |
|
47 |
ValidationUtils.validate(dto, UpdateGroup.class, DefaultGroup.class); |
|
48 |
stModelDocService.save(dto); |
|
49 |
return new CommonResult(); |
|
50 |
} |
|
51 |
} |