BUGFIX: 机器人喜欢图片喜欢;
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user