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> getPage(@Valid StSuggestSnapshotConfDetPageReqVO pageVO) { PageResult pageResult = stSuggestSnapshotConfDetService.page(pageVO); return success(BeanUtils.toBean(pageResult, StSuggestSnapshotConfDetRespVO.class)); } @PostMapping("/create") @PreAuthorize("@ss.hasPermission('suggest:snapshot:create')") public CommonResult create(@Valid @RequestBody StSuggestSnapshotConfDetSaveReqVO createReqVO) { stSuggestSnapshotConfDetService.create(createReqVO); return success(true); } @PutMapping("/update") @PreAuthorize("@ss.hasPermission('suggest:snapshot:update')") public CommonResult 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 deleteTenant(@RequestParam("id") String id) { stSuggestSnapshotConfDetService.delete(id); return success(true); } @GetMapping("/get") @PreAuthorize("@ss.hasPermission('suggest:snapshot:info')") public CommonResult get(@RequestParam("id") String id) { StSuggestSnapshotConfDetRespVO result = stSuggestSnapshotConfDetService.get(id); return success(result); } }