From 94eab51d6c2183c2f026f87052ae399cd2c17eba Mon Sep 17 00:00:00 2001 From: xupei <1779019091@qq.com> Date: Thu, 23 Nov 2023 12:02:41 +0800 Subject: [PATCH] =?UTF-8?q?BUGFIX:=E6=A0=B9=E6=8D=AE=E6=80=A7=E5=88=AB?= =?UTF-8?q?=E5=AF=B9=E5=9B=BE=E7=89=87=E8=B7=AF=E5=BE=84=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/service/impl/ChatRobotServiceImpl.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 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 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; }