diff --git a/src/main/java/com/ai/da/common/enums/PoseEnum.java b/src/main/java/com/ai/da/common/enums/PoseEnum.java index 713e791e..09480d9e 100644 --- a/src/main/java/com/ai/da/common/enums/PoseEnum.java +++ b/src/main/java/com/ai/da/common/enums/PoseEnum.java @@ -63,7 +63,9 @@ public enum PoseEnum { } public static List> getPropertyList() { - return new ArrayList<>(PROPERTY_LIST); // 返回副本以保证不可变性 + return PROPERTY_LIST.stream() + .map(HashMap::new) // 深拷贝每个 Map + .collect(Collectors.toList()); } public static List getVideoList() { diff --git a/src/main/java/com/ai/da/common/utils/MinioUtil.java b/src/main/java/com/ai/da/common/utils/MinioUtil.java index de9e423b..1dc16740 100644 --- a/src/main/java/com/ai/da/common/utils/MinioUtil.java +++ b/src/main/java/com/ai/da/common/utils/MinioUtil.java @@ -377,7 +377,8 @@ public class MinioUtil { try { String lowerName = fileName.toLowerCase(); - boolean isImage = lowerName.endsWith(".jpg") || lowerName.endsWith(".jpeg") || lowerName.endsWith(".png"); + boolean isImage = lowerName.endsWith(".jpg") || lowerName.endsWith(".jpeg") + || lowerName.endsWith(".png") || lowerName.endsWith(".gif"); GetPresignedObjectUrlArgs.Builder builder = GetPresignedObjectUrlArgs.builder() .bucket(bucketName) @@ -390,6 +391,8 @@ public class MinioUtil { String contentType = "image/jpeg"; if (lowerName.endsWith(".png")) { contentType = "image/png"; + } else if (lowerName.endsWith(".gif")) { // 新增 GIF + contentType = "image/gif"; } Map queryParams = new HashMap<>(); @@ -400,8 +403,10 @@ public class MinioUtil { } return minioClient.getPresignedObjectUrl(builder.build()); - } catch (MinioException | InvalidKeyException | IOException | NoSuchAlgorithmException e) { + } catch (MinioException | InvalidKeyException + | IOException | NoSuchAlgorithmException | IllegalArgumentException e) { e.printStackTrace(); + log.error("bucket: {}, object:{}", bucketName, fileName); throw new BusinessException(e.getMessage()); } } diff --git a/src/main/java/com/ai/da/controller/AccountController.java b/src/main/java/com/ai/da/controller/AccountController.java index aef2353f..1e27bf17 100644 --- a/src/main/java/com/ai/da/controller/AccountController.java +++ b/src/main/java/com/ai/da/controller/AccountController.java @@ -371,4 +371,13 @@ public class AccountController { public Response subAccountImport(@RequestParam("file") MultipartFile file) { return Response.success(accountService.subAccountImport(file)); } + + /*@GetMapping("/send618Email") + @ApiOperation(value = "618邮件发送") + public Response send618PromotionEmailTemp() { + accountService.send618PromotionEmailTemp(); + return Response.success("success"); + }*/ + + } diff --git a/src/main/java/com/ai/da/service/AccountService.java b/src/main/java/com/ai/da/service/AccountService.java index 9b7ff681..a725e395 100644 --- a/src/main/java/com/ai/da/service/AccountService.java +++ b/src/main/java/com/ai/da/service/AccountService.java @@ -233,4 +233,6 @@ public interface AccountService extends IService { Boolean subAccountImport(MultipartFile file); Set organizationNameSearch(String type, String name); + + /*void send618PromotionEmailTemp();*/ } diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 2a3f4293..b7cec9b6 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -3031,4 +3031,32 @@ public class AccountServiceImpl extends ServiceImpl impl return new HashSet<>(); } +/* @Override + public void send618PromotionEmailTemp() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("is_deleted", 0); + + List trialOrders = trialOrderMapper.selectList(queryWrapper); + +// List accountList = accountMapper.selectList(queryWrapper); + System.out.println(trialOrders); + int total = trialOrders.size(); + log.info("试用用户总量:{}", total); + int current = 1; + for (TrialOrder trialOrder : trialOrders) { + log.info("邮件发送进度 {}/{}", current, total); + try { + if (!StringUtil.isNullOrEmpty(trialOrder.getCountry()) && trialOrder.getCountry().equals("China")) { + SendEmailUtil.send618PromotionEmailTemp(trialOrder.getEmail(), "CHINESE_SIMPLIFIED"); + } else { + // 英文 + SendEmailUtil.send618PromotionEmailTemp(trialOrder.getEmail(), "ENGLISH"); + } + }catch (Exception e) { + log.info(e.getMessage()); + } + current ++; + } + }*/ + } diff --git a/src/main/java/com/ai/da/service/impl/LLMServiceImpl.java b/src/main/java/com/ai/da/service/impl/LLMServiceImpl.java index 11945ca5..80b53184 100644 --- a/src/main/java/com/ai/da/service/impl/LLMServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/LLMServiceImpl.java @@ -234,8 +234,8 @@ public class LLMServiceImpl implements LLMService { executor.submit(() -> { try { -// boolean validate = jwtTokenHelper.validateToken(token); - boolean validate = true; + boolean validate = jwtTokenHelper.validateToken(token); +// boolean validate = true; if (validate) { AuthPrincipalVo principal = jwtTokenHelper.parserToUser(token); Long accountId = principal.getId(); @@ -367,7 +367,7 @@ public class LLMServiceImpl implements LLMService { systemImage.setAccountId(accountId); chatMessageMapper.insert(systemImage); } else if (Objects.nonNull(toolsName) && toolsName.equals("search_sketch_img")) { - json.put("content", processSearchSketchToolCon(toolsData)); + json.put("content", processSearchSketchToolCon(projectId, toolsData)); } else if (Objects.nonNull(toolsName) && toolsName.equals("update_project_info")) { updateProjectParams(projectId, toolsData); @@ -395,7 +395,7 @@ public class LLMServiceImpl implements LLMService { return emitter; } - private String processSearchSketchToolCon(JSONObject content){ + private String processSearchSketchToolCon(Long projectId, JSONObject content){ // content内容 "{\"sketch_list\": [\"\\\\female\\\\blouse\\\\blouse_645.jpg\", \"\\\\female\\\\dress\\\\0902004968.jpg\"]}" JSONArray sketchList = content.getJSONArray("sketch_list"); if (sketchList.isEmpty()){ @@ -404,12 +404,18 @@ public class LLMServiceImpl implements LLMService { ArrayList dataList = new ArrayList<>(); sketchList.forEach(sketch -> { ReceiveCollectionElement receiveCollectionElement = new ReceiveCollectionElement(); - receiveCollectionElement.setUrl((String) sketch); - receiveCollectionElement.setMinioUrl(minioUtil.getPreSignedUrl(sysImage + "/images" + sketch, CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); + String path = sketch.toString().replace("\\", "/"); + String minioPath = sysImage + "/images" + path; + receiveCollectionElement.setUrl(minioPath); + receiveCollectionElement.setLevel1Type(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()); + receiveCollectionElement.setLevel2Type(path.split("/")[2]); + receiveCollectionElement.setMinioUrl(minioUtil.getPreSignedUrl(minioPath, CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); dataList.add(receiveCollectionElement); }); ReceiveDesignParam receiveDesignParam = new ReceiveDesignParam(); receiveDesignParam.setReceiveCollectionElementList(dataList); + receiveDesignParam.setProjectId(projectId); + designService.receiveDesignParams(receiveDesignParam); return JSONArray.toJSONString(receiveDesignParam); } diff --git a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java index 98956f0a..438c47fb 100644 --- a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java @@ -422,6 +422,11 @@ public class LibraryServiceImpl extends ServiceImpl impl throw new BusinessException("processMannequins.interface.exception"); } + /** + * 去sketch白边 + * @param filePath + * @param category + */ @Override public void processSketchBoards(String filePath, String category) { Long imageId = pythonTAllInfoService.getImageIdByPath(filePath); diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index b799197f..a0dca557 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -668,7 +668,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl