From bad3f86d6d4a7b9bb8191f188a0c4ccfa54fb17d Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Thu, 12 Oct 2023 10:07:23 +0800 Subject: [PATCH] =?UTF-8?q?BUGFIX:=20=E6=9C=BA=E5=99=A8=E4=BA=BA=E5=96=9C?= =?UTF-8?q?=E6=AC=A2=E5=9B=BE=E7=89=87=E5=96=9C=E6=AC=A2;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ai/da/service/impl/ChatRobotServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java b/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java index c19b4fb0..8be8f53f 100644 --- a/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java @@ -246,17 +246,23 @@ public class ChatRobotServiceImpl implements ChatRobotService { library.setUrl(chatRobotLibraryDTO.getUrl()); library.setLevel1Type(LibraryLevel1TypeEnum.SKETCH_BOARD.getRealName()); String[] split = chatRobotLibraryDTO.getUrl().split("/"); - if (split.length == 4) { - String level2Type = split[2]; + if (split.length == 5) { + String level3Type = split[2]; + if (level3Type != null && !level3Type.isEmpty()) { + library.setLevel3Type(Character.toUpperCase(level3Type.charAt(0)) + level3Type.substring(1)); + } + String level2Type = split[3]; if (level2Type != null && !level2Type.isEmpty()) { library.setLevel2Type(Character.toUpperCase(level2Type.charAt(0)) + level2Type.substring(1)); } - String name = split[3]; + String name = split[4]; if (name.contains(".")) { library.setName(name.split("\\.")[0]); }else { library.setName(name); } + }else { + throw new BusinessException("error url"); } try {