| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import com.ycl.platform.domain.form.ManualScoreForm; |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.ycl.platform.service.CheckResultService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.CheckResultForm; |
| | | import com.ycl.platform.domain.query.CheckResultQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 考核结果 前端控制器 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-07 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "考核结果", tags = "考核结果管理") |
| | | @RestController |
| | | @RequestMapping("/check-result") |
| | | public class CheckResultController { |
| | | |
| | | private final CheckResultService checkResultService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) CheckResultForm form) { |
| | | return checkResultService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) CheckResultForm form) { |
| | | return checkResultService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return checkResultService.removeById(id); |
| | | } |
| | | |
| | | @PutMapping("/publish/{id}") |
| | | @ApiOperation(value = "ID发布", notes = "ID发布") |
| | | public Result publishById(@PathVariable("id") String id) { |
| | | return checkResultService.publishById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return checkResultService.remove(ids); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(@RequestBody CheckResultQuery query) { |
| | | return checkResultService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return checkResultService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return checkResultService.all(); |
| | | } |
| | | |
| | | @PostMapping("/manual-score") |
| | | @ApiOperation(value = "人工打分", notes = "人工打分") |
| | | public Result manualScore(@RequestBody ManualScoreForm form) { |
| | | return checkResultService.manualScore(form); |
| | | } |
| | | } |