潘志宝
2024-11-26 757bfdc997691450a68514c879fcb08cfbd5451f
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
68
69
70
71
72
73
74
package com.iailab.module.model.mcs.pre.controller.admin;
 
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity;
import com.iailab.module.model.mcs.pre.service.MmItemAccuracyHisService;
import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO;
import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisRespVO;
import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisSaveReqVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import javax.validation.Valid;
 
import static com.iailab.framework.common.pojo.CommonResult.success;
 
/**
 * @author lirm
 * @Description
 * @createTime 2024年11月25日
 */
@RestController
@RequestMapping("/model/item/accuracy-his")
public class MmItemAccuracyHisController {
 
    @Autowired
    private MmItemAccuracyHisService mmItemAccuracyHisService;
 
    @PostMapping("/create")
    @Operation(summary = "创建预测精准度历史配置")
    @PreAuthorize("@ss.hasPermission('item:accuracy-his:create')")
    public CommonResult<Boolean> create(@Valid @RequestBody MmItemAccuracyHisSaveReqVO createReqVO) {
        mmItemAccuracyHisService.create(createReqVO);
        return success(true);
    }
 
    @PutMapping("/update")
    @Operation(summary = "更新预测精准度历史配置")
    @PreAuthorize("@ss.hasPermission('item:accuracy-his:update')")
    public CommonResult<Boolean> update(@Valid @RequestBody MmItemAccuracyHisSaveReqVO updateReqVO) {
        mmItemAccuracyHisService.update(updateReqVO);
        return success(true);
    }
 
    @DeleteMapping("/delete")
    @Operation(summary = "删除预测精准度历史配置")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('item:accuracy-his:delete')")
    public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) {
        mmItemAccuracyHisService.delete(id);
        return success(true);
    }
 
    @GetMapping("/get/{id}")
    @Operation(summary = "获得预测精准度历史配置")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('item:accuracy-his:query')")
    public CommonResult<MmItemAccuracyHisRespVO> getInfo(@PathVariable("id") String id) {
        MmItemAccuracyHisEntity entity = mmItemAccuracyHisService.getInfo(id);
        return success(BeanUtils.toBean(entity, MmItemAccuracyHisRespVO.class));
    }
 
    @GetMapping("/page")
    @Operation(summary = "获得预测精准度历史配置分页")
    @PreAuthorize("@ss.hasPermission('item:accuracy-his:query')")
    public CommonResult<PageResult<MmItemAccuracyHisRespVO>> getTenantPage(@Valid MmItemAccuracyHisPageReqVO pageVO) {
        PageResult<MmItemAccuracyHisEntity> pageResult = mmItemAccuracyHisService.page(pageVO);
        return success(BeanUtils.toBean(pageResult, MmItemAccuracyHisRespVO.class));
    }
}