| | |
| | | import com.dji.sample.patches.xml.mode.XMLTemplateModel; |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.io.*; |
| | |
| | | @Slf4j |
| | | public class CreateWaylineFileUtils { |
| | | |
| | | @Value("${xml.temple.template}") |
| | | static String templeFilePath; |
| | | @Value("${xml.temple.waylines}") |
| | | static String waylineFilePath; |
| | | |
| | | @Value("${xml.target.template}") |
| | | static String targetTempleFilePath; |
| | | @Value("${xml.target.waylines}") |
| | | static String targetWaylineFilePath; |
| | | /** |
| | | * 生成航线文件 |
| | | * @param xmlModel |
| | | */ |
| | | public static void createWaylineFile(XMLTemplateModel xmlModel) { |
| | | xml2XmlDoc(xmlModel, "src\\main\\resources\\template\\template.xml", "src\\main\\resources\\template\\wpmz\\template.kml"); |
| | | xml2XmlDoc(xmlModel, "src\\main\\resources\\template\\waylines.xml", "src\\main\\resources\\template\\wpmz\\waylines.wpml"); |
| | | |
| | | |
| | | // xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\template.xml", "home\\drone\\server\\template\\wpmz\\template.kml"); |
| | | // xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\waylines.xml", "home\\drone\\server\\template\\wpmz\\waylines.wpml"); |
| | | |
| | | xml2XmlDoc(xmlModel, templeFilePath, targetTempleFilePath); |
| | | xml2XmlDoc(xmlModel, waylineFilePath, targetWaylineFilePath); |
| | | } |
| | | |
| | | /** |