| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | |
| | |
| | | private MinioPojo pojo; |
| | | |
| | | @PostMapping("/createPoints") |
| | | public ResponseResult createPoints(@RequestBody CreateWaylineParam param) { |
| | | public ResponseResult createPoints(@RequestBody @Valid CreateWaylineParam param) { |
| | | return ResponseResult.success(PlaneCourseUtils.createWaylinePoints(param)); |
| | | } |
| | | |
| | | @PostMapping("/{workspace_id}/saveWayLineFile") |
| | | public ResponseResult saveWayLineFile(@PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestBody CreateWaylineParam param, |
| | | @RequestBody @Valid CreateWaylineParam param, |
| | | HttpServletRequest request |
| | | ) throws IOException { |
| | | CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | |
| | | @RequestBody CreateWaylineParam param, |
| | | HttpServletRequest request) throws IOException { |
| | | String kmz=param.getWaylineName()+".kmz"; |
| | | // 初始化模板对象 |
| | | MinioFileDownloader.deleteFileFromMinio(pojo.getEndpoint(), pojo.getAccessKey(), pojo.getSecretKey(), pojo.getBucket(), kmz); |
| | | CustomClaim customClaim = (CustomClaim) request.getAttribute(TOKEN_CLAIM); |
| | | String creator = customClaim.getUsername(); |
| | | // 初始化模板对象 |
| | | // 初始化模板对象 |
| | | XMLTemplateModel xmlModel = XMLTemplateModel.initPolygon(param); |
| | | // 生成航线文件 |
| | | CreateWaylineFileUtils.createWaylineFileByPolygon(xmlModel, patchesConfigPojo.getPlaneTemplate(), patchesConfigPojo.getPlaneTargetTemplate()); |