| | |
| | | import com.ard.route.service.IArdRouteInformationService; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import static com.ard.route.util.ToolUtils.extractFilePath; |
| | | import static com.ard.route.util.ToolUtils.getFileNameWithoutExtension; |
| | | |
| | | /** |
| | |
| | | // 删除航线(kmz)文件 |
| | | for (String id : ids) { |
| | | ArdRouteInformation information = ardRouteInformationMapper.selectArdRouteInformationById(id); |
| | | ossService.deleteObject("kmz", information.getUpPath()); |
| | | ossService.deleteObject("kmz", information.getMinioUpPath()); |
| | | } |
| | | return ardRouteInformationMapper.deleteArdRouteInformationByIds(ids); |
| | | } |
| | |
| | | ArdRouteInformation information = new ArdRouteInformation(); |
| | | information.setFileName(file.getOriginalFilename()); |
| | | information.setFileNameNew(getFileNameWithoutExtension(url)); |
| | | information.setMinioUpPath(extractFilePath(url)); |
| | | information.setUpPath(url); |
| | | information.setUpFileSize((double) file.getSize()); |
| | | insertArdRouteInformation(information); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据文件名称查询航线信息 |
| | | * |
| | | * @param name 文件名称 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public ArdRouteInformation selectArdRouteInformationByName(String name) { |
| | | return ardRouteInformationMapper.selectArdRouteInformationByName(name); |
| | | } |
| | | |
| | | } |