工业互联网平台2.0版本后端代码
houzhongjian
2025-05-29 24996ea75ec4ca3b7d154387bfe37ec9dd387255
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
package com.iailab.module.model.mcs.sche.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.sche.entity.StSuggestSnapshotConfDetEntity;
import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfDetService;
import com.iailab.module.model.mcs.sche.vo.*;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
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 java.util.List;
 
import static com.iailab.framework.common.pojo.CommonResult.success;
 
/**
 * @author DongYukun
 * @Description
 * @createTime 2025年05月23日
 */
@Tag(name = "调度建议快照配置详情")
@RestController
@RequestMapping("/model/suggest/snapshot/conf-det")
public class StSuggestSnapshotConfDetController {
 
    @Autowired
    private StSuggestSnapshotConfDetService stSuggestSnapshotConfDetService;
    
    @GetMapping("/page")
    @PreAuthorize("@ss.hasPermission('suggest:snapshot:query')")
    public CommonResult<PageResult<StSuggestSnapshotConfDetRespVO>> getPage(@Valid StSuggestSnapshotConfDetPageReqVO pageVO) {
        PageResult<StSuggestSnapshotConfDetEntity> pageResult = stSuggestSnapshotConfDetService.page(pageVO);
        return success(BeanUtils.toBean(pageResult, StSuggestSnapshotConfDetRespVO.class));
    }
 
    @PostMapping("/create")
    @PreAuthorize("@ss.hasPermission('suggest:snapshot:create')")
    public CommonResult<Boolean> create(@Valid @RequestBody StSuggestSnapshotConfDetSaveReqVO createReqVO) {
        stSuggestSnapshotConfDetService.create(createReqVO);
        return success(true);
    }
 
    @PutMapping("/update")
    @PreAuthorize("@ss.hasPermission('suggest:snapshot:update')")
    public CommonResult<Boolean> update(@Valid @RequestBody StSuggestSnapshotConfDetSaveReqVO updateReqVO) {
        stSuggestSnapshotConfDetService.update(updateReqVO);
        return success(true);
    }
 
    @DeleteMapping("/delete")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('suggest:snapshot:delete')")
    public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) {
        stSuggestSnapshotConfDetService.delete(id);
        return success(true);
    }
 
    @GetMapping("/get")
    @PreAuthorize("@ss.hasPermission('suggest:snapshot:info')")
    public CommonResult<StSuggestSnapshotConfDetRespVO> get(@RequestParam("id") String id) {
        StSuggestSnapshotConfDetRespVO result = stSuggestSnapshotConfDetService.get(id);
        return success(result);
    }
}