潘志宝
2025-05-26 9881ce0814ad642646d9b76ad2caa70a0b966036
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StSuggestSnapshotConfDetController.java
对比新文件
@@ -0,0 +1,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);
    }
}