| | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelParamEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelSettingEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleModelParamService; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleModelService; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleModelPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleModelRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleModelSaveReqVO; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleModelSettingService; |
| | | import com.iailab.module.model.mcs.sche.vo.*; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.error; |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | |
| | | @Autowired |
| | | private StScheduleModelService stScheduleModelService; |
| | | |
| | | @Autowired |
| | | private StScheduleModelParamService stScheduleModelParamService; |
| | | |
| | | @Autowired |
| | | private StScheduleModelSettingService stScheduleModelSettingService; |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得分页") |
| | | @PreAuthorize("@ss.hasPermission('sche:model:query')") |
| | |
| | | return success(BeanUtils.toBean(page, StScheduleModelRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @PreAuthorize("@ss.hasPermission('sche:model:query')") |
| | | public CommonResult<List<StScheduleModelRespVO>> list() { |
| | | List<StScheduleModelEntity> list = stScheduleModelService.list(); |
| | | return success(BeanUtils.toBean(list, StScheduleModelRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得详情") |
| | | @PreAuthorize("@ss.hasPermission('sche:model:query')") |
| | | public CommonResult<StScheduleModelRespVO> get(@RequestParam("id") String id){ |
| | | StScheduleModelEntity data = stScheduleModelService.get(id); |
| | | return success(BeanUtils.toBean(data, StScheduleModelRespVO.class)); |
| | | StScheduleModelRespVO result = BeanUtils.toBean(data, StScheduleModelRespVO.class); |
| | | List<StScheduleModelParamEntity> paramList = stScheduleModelParamService.getByModelId(data.getId()); |
| | | result.setParamList(BeanUtils.toBean(paramList, StScheduleModelParamRespVO.class)); |
| | | List<StScheduleModelSettingEntity> settingList = stScheduleModelSettingService.getByModelId(data.getId()); |
| | | result.setSettingList(BeanUtils.toBean(settingList, StScheduleModelSettingRespVO.class)); |
| | | return success(result); |
| | | } |
| | | |
| | | @PostMapping("/create") |