From 0c42d6175e35f2d63873efd44ad1ab6b0616d5ff Mon Sep 17 00:00:00 2001 From: cherishsince Date: Sat, 6 Apr 2024 21:59:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0mjutil=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/ai/midjourney/util/MjUtil.java | 10 ++------- .../yudao/framework/ai/mj/MjUtilTests.java | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/mj/MjUtilTests.java diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/midjourney/util/MjUtil.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/midjourney/util/MjUtil.java index bc7ee5504..e119b100f 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/midjourney/util/MjUtil.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/midjourney/util/MjUtil.java @@ -7,6 +7,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** + * mj util + * * author: fansili * time: 2024/4/6 19:00 */ @@ -57,12 +59,4 @@ public class MjUtil { return mjContent; } - public static void main(String[] args) { - String content1 = "**南极应该是什么样子? --v 6.0 --style raw** - <@972721304891453450> (32%) (fast, stealth)"; - String content2 = "**南极应该是什么样子? --v 6.0 --style raw** - <@972721304891453450> (fast, stealth)"; - - System.err.println(parseContent(content1));; - System.err.println(parseContent(content2));; - } - } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/mj/MjUtilTests.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/mj/MjUtilTests.java new file mode 100644 index 000000000..521e9b5ab --- /dev/null +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/mj/MjUtilTests.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.framework.ai.mj; + +import cn.iocoder.yudao.framework.ai.midjourney.util.MjUtil; +import org.junit.Test; + +/** + * mj util + * + * author: fansili + * time: 2024/4/6 21:57 + */ +public class MjUtilTests { + + @Test + public void parseContentTest() { + String content1 = "**南极应该是什么样子? --v 6.0 --style raw** - <@972721304891453450> (32%) (fast, stealth)"; + String content2 = "**南极应该是什么样子? --v 6.0 --style raw** - <@972721304891453450> (fast, stealth)"; + + System.err.println(MjUtil.parseContent(content1)); + System.err.println(MjUtil.parseContent(content2)); + } +}