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 c1ca9644..65514a5f 100644 --- a/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/ChatRobotServiceImpl.java @@ -194,7 +194,7 @@ public class ChatRobotServiceImpl implements ChatRobotService { } ChatRobotLibraryVO chatRobotLibraryVO = new ChatRobotLibraryVO(); String bucketName = sysImage; - String prefix = getPrefix(array.getString(i)); + String prefix = getPrefix(array.getString(i),chatSendDTO.getGender()); String path = prefix; // String path = prefix + array.getString(i); QueryWrapper qw = new QueryWrapper<>(); @@ -314,22 +314,24 @@ public class ChatRobotServiceImpl implements ChatRobotService { } } - private String getPrefix(String minioPath){ - String substring = minioPath.substring(minioPath.lastIndexOf("/") + 1, minioPath.lastIndexOf("_")); - String folder = minioPath.substring(0,minioPath.lastIndexOf("/")); - if ("mens_test".equals(substring)){ - switch (folder){ - case "bottom": - minioPath = minioPath.replace("bottom","bottoms"); - break; - case "top": - minioPath = minioPath.replace("top","tops"); - break; - case "outer": - minioPath = minioPath.replace("outer","outwear"); - break; + private String getPrefix(String minioPath,String gender){ + if (gender.equals("Male")){ + String substring = minioPath.substring(minioPath.lastIndexOf("/") + 1, minioPath.lastIndexOf("_")); + String folder = minioPath.substring(0,minioPath.lastIndexOf("/")); + if ("mens_test".equals(substring)){ + switch (folder){ + case "bottom": + minioPath = minioPath.replace("bottom","bottoms"); + break; + case "top": + minioPath = minioPath.replace("top","tops"); + break; + case "outer": + minioPath = minioPath.replace("outer","outwear"); + break; + } + return "images/male/" + minioPath; } - return "images/male/" + minioPath; } return "images/female/" + minioPath; }