| | |
| | | |
| | | 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.api.mcs.dto.StScheduleModelOutDTO; |
| | | import com.iailab.module.model.mcs.sche.entity.*; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleModelService; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfMainService; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainSaveReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.*; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | 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; |
| | | |
| | |
| | | * @Description |
| | | * @createTime 2025年05月23日 |
| | | */ |
| | | @Tag(name = "调度建议快照") |
| | | @Tag(name = "调度建议快照配置主表") |
| | | @RestController |
| | | @RequestMapping("/model/suggest/snapshot/conf-main") |
| | | public class StSuggestSnapshotConfMainController { |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotConfMainService stSuggestSnapshotConfMainService; |
| | | |
| | | |
| | | @Autowired |
| | | private StScheduleModelService stScheduleModelService; |
| | | |
| | | @GetMapping("/page") |
| | | public CommonResult<PageResult<StSuggestSnapshotConfMainRespVO>> getPage(@Valid StSuggestSnapshotConfMainPageReqVO pageVO) { |
| | | PageResult<StSuggestSnapshotConfMainRespVO> pageResult = stSuggestSnapshotConfMainService.page(pageVO); |
| | | return success(pageResult); |
| | | PageResult<StSuggestSnapshotConfMainEntity> pageResult = stSuggestSnapshotConfMainService.page(pageVO); |
| | | PageResult<StSuggestSnapshotConfMainRespVO> result = BeanUtils.toBean(pageResult, StSuggestSnapshotConfMainRespVO.class); |
| | | result.getList().forEach(item -> { |
| | | item.setModelName(stScheduleModelService.get(item.getModelId())!=null?stScheduleModelService.get(item.getModelId()).getModelName():null); |
| | | }); |
| | | return success(result); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:info')") |
| | | public CommonResult<StSuggestSnapshotConfMainRespVO> get(@RequestParam("id") String id) { |
| | | StSuggestSnapshotConfMainRespVO result = stSuggestSnapshotConfMainService.get(id); |
| | | return success(result); |
| | | } |
| | | |
| | | @PostMapping("/create") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:create')") |
| | | public CommonResult<Boolean> create(@Valid @RequestBody StSuggestSnapshotConfMainSaveReqVO createReqVO) { |
| | | stSuggestSnapshotConfMainService.create(createReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:update')") |
| | | public CommonResult<Boolean> update(@Valid @RequestBody StSuggestSnapshotConfMainSaveReqVO updateReqVO) { |
| | | stSuggestSnapshotConfMainService.update(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:delete')") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { |
| | | stSuggestSnapshotConfMainService.delete(id); |