Merge remote-tracking branch 'origin/dev/dev' into dev/dev

This commit is contained in:
shahaibo
2025-06-17 09:42:15 +08:00
3 changed files with 39 additions and 19 deletions

13
pom.xml
View File

@@ -32,6 +32,7 @@
<javacv.version>1.5.5</javacv.version>
<system.windowsx64>windows-x86_64</system.windowsx64>
<javacpp.platform.linux-x86_64>linux-x86_64</javacpp.platform.linux-x86_64>
</properties>
<dependencyManagement>
<dependencies>
@@ -373,26 +374,30 @@
<groupId>org.bytedeco</groupId>
<artifactId>opencv</artifactId>
<version>4.5.1-${javacv.version}</version>
<classifier>${system.windowsx64}</classifier>
<!--<classifier>${system.windowsx64}</classifier>-->
<classifier>${javacpp.platform.linux-x86_64}</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>openblas</artifactId>
<version>0.3.13-${javacv.version}</version>
<classifier>${system.windowsx64}</classifier>
<!--<classifier>${system.windowsx64}</classifier>-->
<classifier>${javacpp.platform.linux-x86_64}</classifier>
</dependency>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>flycapture</artifactId>
<version>2.13.3.31-${javacv.version}</version>
<classifier>${system.windowsx64}</classifier>
<!--<classifier>${system.windowsx64}</classifier>-->
<classifier>${javacpp.platform.linux-x86_64}</classifier>
</dependency>
<!-- FFmpeg视频处理解决你的报错 -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg</artifactId>
<version>4.4-1.5.6</version>
<classifier>${system.windowsx64}</classifier>
<!--<classifier>${system.windowsx64}</classifier>-->
<classifier>${javacpp.platform.linux-x86_64}</classifier>
</dependency>

View File

@@ -964,7 +964,8 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
String clothCategory = pythonService.getClothCategory(sketchPath, gender);
return new GenerateResultVO(generateDetail.getId(), minioUtil.getPreSignedUrl(sketchPath, CommonConstant.MINIO_IMAGE_EXPIRE_TIME), "Success", clothCategory);
return new GenerateResultVO(generate.getUniqueId(), generateDetail.getId(),
minioUtil.getPreSignedUrl(sketchPath, CommonConstant.MINIO_IMAGE_EXPIRE_TIME), "Success", clothCategory);
}
public void doCreditsSubtract(Long accountId, CreditsEventsEnum event){

View File

@@ -390,6 +390,18 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
toProductImageRecord.setUserLikeGroupId(userLikeGroupId);
}
// 翻译
String prompt = toProductImageDTO.getPrompt();
StringBuilder sb = new StringBuilder("The best quality, masterpiece, real image.");
if (!StringUtil.isNullOrEmpty(prompt)) {
prompt = pythonService.promptTranslate(prompt);
}
String[] words = prompt.split("\\s+");
if (words.length > 200) {
throw new BusinessException("Please keep your input text under 200 words. Thanks!");
}
toProductImageRecord.setCreateTime(LocalDateTime.now());
if (!StringUtils.isEmpty(toProductImageDTO.getPrompt())) {
toProductImageRecord.setPrompt(toProductImageDTO.getPrompt());
@@ -399,12 +411,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
List<ToProductImageResult> result = new ArrayList<>();
int i = 0;
// 翻译
String prompt = toProductImageDTO.getPrompt();
StringBuilder sb = new StringBuilder("The best quality, masterpiece, real image.");
if (!StringUtil.isNullOrEmpty(prompt)) {
prompt = pythonService.promptTranslate(prompt);
}
// else {
// s = "best quality, masterpiece. detailed, high-res, simple background, studio photography, extremely detailed, updo, detailed face, face, close-up, HDR, UHD, 8K realistic, Highly detailed, simple background, Studio lighting";
// }
@@ -924,6 +931,20 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
toProductImageRecord.setUserLikeGroupId(userLikeGroupId);
}
// 翻译
String prompt = toProductImageDTO.getPrompt();
String s = "";
if (!StringUtil.isNullOrEmpty(prompt)) {
s = pythonService.promptTranslate(prompt);
}else {
s = "Snow moutain, snowy day, natural light";
}
// 对输入文本进行长度限制
String[] words = prompt.split("\\s+");
if (words.length > 200) {
throw new BusinessException("Please keep your input text under 200 words. Thanks!");
}
toProductImageRecord.setCreateTime(LocalDateTime.now());
if (!StringUtils.isEmpty(toProductImageDTO.getPrompt())) {
toProductImageRecord.setPrompt(toProductImageDTO.getPrompt());
@@ -933,14 +954,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
List<ToProductImageResult> result = new ArrayList<>();
int i = 0;
// 翻译
String prompt = toProductImageDTO.getPrompt();
String s = "";
if (!StringUtil.isNullOrEmpty(prompt)) {
s = pythonService.promptTranslate(prompt);
}else {
s = "Snow moutain, snowy day, natural light";
}
for (ToProductImageVO toProductImageVO : toProductImageDTO.getToProductImageVOList()) {
String taskId = UUID.randomUUID() + "-" + i + "-" + userHolder.getId();
i ++;