From ef92f42831c296c6093a45ba15347449ea0c7aa7 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Thu, 26 Sep 2024 09:11:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96yaml=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/NewModelFromGitController.java | 14 -------------- .../java/com/ruoyi/platform/utils/YamlUtils.java | 1 + 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/model/NewModelFromGitController.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/model/NewModelFromGitController.java index 06efa978..426c3de4 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/model/NewModelFromGitController.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/model/NewModelFromGitController.java @@ -26,9 +26,6 @@ public class NewModelFromGitController { @Resource private ModelsService modelsService; - @Resource - private DVCUtils dvcUtils; - @PostMapping("/addModel") @ApiOperation("添加模型") public AjaxResult addModelAndVersion(@RequestBody ModelsVo modelsVo) throws Exception { @@ -119,15 +116,4 @@ public class NewModelFromGitController { return AjaxResult.success(); } -// @GetMapping("/test") -// public AjaxResult test() { -// try { -// dvcUtils.gitPush("E:\\test\\admin\\model\\1451938\\object-model", "fanshuai", "h1n2x3j4y5@"); -// } catch (IOException e) { -// throw new RuntimeException(e); -// } catch (GitAPIException e) { -// throw new RuntimeException(e); -// } -// return AjaxResult.success(); -// } } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/YamlUtils.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/YamlUtils.java index 06973e15..00f407a7 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/YamlUtils.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/YamlUtils.java @@ -19,6 +19,7 @@ public class YamlUtils { public static void generateYamlFile(Map data, String path, String fileName) { DumperOptions options = new DumperOptions(); options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + options.setDefaultScalarStyle(DumperOptions.ScalarStyle.PLAIN); options.setPrettyFlow(true); Yaml yaml = new Yaml(options); File directory = new File(path);