| | |
| | | package com.iailab.module.model.mcs.pre.controller.admin; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.module.model.common.enums.CommonConstant; |
| | | import com.iailab.module.model.mcs.pre.dto.MmPredictItemDTO; |
| | | import com.iailab.module.model.mcs.pre.service.MmPredictItemService; |
| | | 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 com.iailab.module.model.mcs.pre.vo.*; |
| | | import com.iailab.module.model.mpk.common.utils.IAILModelUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | |
| | | import javax.annotation.security.PermitAll; |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | |
| | | * @author PanZhibao |
| | | * @date 2021年04月26日 14:42 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/model/pre/item") |
| | | public class MmPredictItemController { |
| | |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public CommonResult<List<MmPredictItemRespVO>> list(Map<String, Object> params) { |
| | | public CommonResult<List<MmPredictItemRespVO>> list(@RequestParam Map<String, Object> params) { |
| | | List<MmPredictItemRespVO> list = mmPredictItemService.list(params); |
| | | return success(list); |
| | | } |
| | |
| | | @PostMapping("/upload-model") |
| | | public CommonResult<Map<String, Object>> uploadModel(@RequestParam("file") MultipartFile file) throws Exception { |
| | | String uploadDir = modelPath + file.getOriginalFilename(); |
| | | FileUtil.mkParentDirs(uploadDir); |
| | | file.transferTo(new File(uploadDir)); |
| | | Map<String, Object> result = iAILModelUtil.parseModel(uploadDir); |
| | | result.put("originalFilename", file.getOriginalFilename().replace(CommonConstant.MDK_SUFFIX, "")); |