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 {