rain
2024-04-11 6545b0cb0817378cff3b20d962d4c4f0d51f2207
src/main/java/com/dji/sample/patches/xml/utils/CreateWaylineFileUtils.java
@@ -3,6 +3,7 @@
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.*;
@@ -17,13 +18,27 @@
@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);
    }
    /**