68 lines
1.9 KiB
Java
68 lines
1.9 KiB
Java
|
|
package com.ruoyi.airline.controller;
|
|||
|
|
|
|||
|
|
import com.ruoyi.airline.api.domain.AirlineFileVO;
|
|||
|
|
import com.ruoyi.airline.controller.convert.AirlineFileControllerConvert;
|
|||
|
|
import com.ruoyi.airline.service.api.IAirlineFileService;
|
|||
|
|
import com.ruoyi.airline.service.dto.AirlineFileDTO;
|
|||
|
|
import com.ruoyi.common.core.exception.base.BaseException;
|
|||
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|||
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|||
|
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
|||
|
|
import org.slf4j.Logger;
|
|||
|
|
import org.slf4j.LoggerFactory;
|
|||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
|
import org.springframework.web.bind.annotation.*;
|
|||
|
|
import org.springframework.web.multipart.MultipartFile;
|
|||
|
|
|
|||
|
|
import java.io.IOException;
|
|||
|
|
import java.util.List;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 航线文件Controller
|
|||
|
|
*
|
|||
|
|
* @author ruoyi
|
|||
|
|
* @date 2026-01-17
|
|||
|
|
*/
|
|||
|
|
@RestController
|
|||
|
|
@RequestMapping("/airline/file")
|
|||
|
|
public class AirlineFileController extends BaseController {
|
|||
|
|
|
|||
|
|
private static final Logger log = LoggerFactory.getLogger(AirlineFileController.class);
|
|||
|
|
|
|||
|
|
|
|||
|
|
@Autowired
|
|||
|
|
private IAirlineFileService airlineFileService;
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 编辑航线文件信息
|
|||
|
|
*
|
|||
|
|
* @param entity 实体对象
|
|||
|
|
* @return
|
|||
|
|
*/
|
|||
|
|
@PutMapping("/edit")
|
|||
|
|
public AjaxResult edit(@RequestBody AirlineFileVO entity) {
|
|||
|
|
AirlineFileDTO dto = AirlineFileControllerConvert.toDTO(entity);
|
|||
|
|
return success(airlineFileService.save(dto));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 长江口
|
|||
|
|
* <p>
|
|||
|
|
* kmz类似zip,一般情况下内部包含kml和wpml两个文件
|
|||
|
|
*
|
|||
|
|
* @param vo
|
|||
|
|
*/
|
|||
|
|
@PostMapping("/parseAndUpload")
|
|||
|
|
public AjaxResult createOrupdate(@RequestBody AirlineFileVO vo) {
|
|||
|
|
AirlineFileDTO airlineFile = AirlineFileControllerConvert.toDTO(vo);
|
|||
|
|
try {
|
|||
|
|
return success(airlineFileService.createOrupdate(airlineFile));
|
|||
|
|
} catch (IOException e) {
|
|||
|
|
throw new BaseException("更新航线失败", e.getMessage());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|