刘光辉
7 小时以前 06f314545ac3514d7ce28939920866ae8188d31c
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
package jnpf.tmsController;
 
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.annotation.HandleLog;
import jnpf.base.ActionResult;
import jnpf.tmsEntity.practice.TmsPracticeForm;
import jnpf.tmsService.TmsPracticeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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;
 
/**
 * 实操打分。网关 /api/tms/practice/** → /practice/**
 */
@Tag(name = "TMS实操打分", description = "Practice")
@RestController
@RequestMapping("/practice")
@RequiredArgsConstructor
public class TmsPracticeController {
 
    private final TmsPracticeService practiceService;
 
    @Operation(summary = "按培训记录加载实操评分")
    @GetMapping("/record/{recordId}")
    public ActionResult<TmsPracticeForm> byRecord(@PathVariable("recordId") String recordId) {
        return ActionResult.success(practiceService.getByRecordId(recordId));
    }
 
    @HandleLog(moduleName = "实操打分", requestMethod = "保存")
    @Operation(summary = "保存实操评分")
    @PostMapping
    public ActionResult<String> save(@RequestBody TmsPracticeForm form) {
        return ActionResult.success(practiceService.save(form));
    }
}