| | |
| | | import com.iailab.module.model.mcs.pre.dto.MmPredictItemDTO; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictItemEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmPredictItemService; |
| | | import com.iailab.module.model.mcs.pre.vo.*; |
| | | import com.iailab.module.model.mcs.pre.vo.CountItemtypeVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictItemPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.error; |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | /** |
| | |
| | | return success(BeanUtils.toBean(page, MmPredictItemRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-predict:query')") |
| | | public CommonResult<List<MmPredictItemEntity>> list(@RequestParam Map<String, Object> params) { |
| | | List<MmPredictItemEntity> list = mmPredictItemService.list(params); |
| | | |
| | | return success(list); |
| | | } |
| | | |
| | | /** |
| | | * 预测项信息 |
| | | */ |
| | |
| | | @PostMapping("/create") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-predict:create')") |
| | | @DSTransactional(rollbackFor= Exception.class) |
| | | public CommonResult<Boolean> save(@RequestBody MmPredictItemEntity mmPredictItemEntity){ |
| | | String id = UUID.randomUUID().toString(); |
| | | mmPredictItemEntity.setId(id); |
| | | mmPredictItemService.add(mmPredictItemEntity); |
| | | public CommonResult<Boolean> save(@RequestBody MmPredictItemDTO mmPredictItemDto){ |
| | | mmPredictItemService.add(mmPredictItemDto); |
| | | return success(true); |
| | | } |
| | | |
| | |
| | | @PutMapping("/update") |
| | | @PreAuthorize("@ss.hasPermission('model:pre-predict:update')") |
| | | @DSTransactional(rollbackFor= Exception.class) |
| | | public CommonResult<Boolean> update(@RequestBody MmPredictItemEntity mmPredictItemEntity){ |
| | | mmPredictItemService.update(mmPredictItemEntity); |
| | | public CommonResult<Boolean> update(@RequestBody MmPredictItemDTO mmPredictItemDTO){ |
| | | mmPredictItemService.update(mmPredictItemDTO); |
| | | return success(true); |
| | | } |
| | | |