| | |
| | | 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; |
| | |
| | | @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, "")); |