moodboard基础模型修改
This commit is contained in:
@@ -66,6 +66,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@@ -248,6 +249,13 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
jsonString = JSON.toJSONString(generateToPythonDTO, SerializerFeature.WriteMapNullValue);
|
jsonString = JSON.toJSONString(generateToPythonDTO, SerializerFeature.WriteMapNullValue);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (Objects.equals(version, "fast")) {
|
||||||
|
GenerateToPythonDTO generateToPythonDTO = new GenerateToPythonDTO(generateThroughImageTextDTO.getUniqueId(), text, Objects.isNull(collectionElement) ? "" : collectionElement.getUrl(),
|
||||||
|
mode, category, generateThroughImageTextDTO.getGender(), version);
|
||||||
|
jsonString = JSON.toJSONString(generateToPythonDTO, SerializerFeature.WriteMapNullValue);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
path = CommonConstant.GENERATE_PATH_FLUX2_KLEIN;
|
path = CommonConstant.GENERATE_PATH_FLUX2_KLEIN;
|
||||||
// 构建object_name: {userId}/{category}/{uuid}.png
|
// 构建object_name: {userId}/{category}/{uuid}.png
|
||||||
String objectName = generateThroughImageTextDTO.getUserId() + "/" + category + "/" + UUID.randomUUID() + ".png";
|
String objectName = generateThroughImageTextDTO.getUserId() + "/" + category + "/" + UUID.randomUUID() + ".png";
|
||||||
@@ -259,6 +267,8 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
jsonString = JSON.toJSONString(imageProcessRequest);
|
jsonString = JSON.toJSONString(imageProcessRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Boolean requestResult = pythonService.generateSketchOrPrint(jsonString, port, path, generateThroughImageTextDTO.getUniqueId());
|
Boolean requestResult = pythonService.generateSketchOrPrint(jsonString, port, path, generateThroughImageTextDTO.getUniqueId());
|
||||||
|
|
||||||
|
|
||||||
@@ -274,6 +284,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
|||||||
redisUtil.addToString(key, new Gson().toJson(generateResultVO), CommonConstant.GENERATE_RESULT_EXPIRE_TIME);
|
redisUtil.addToString(key, new Gson().toJson(generateResultVO), CommonConstant.GENERATE_RESULT_EXPIRE_TIME);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveGenerateImmediately(Generate generate) {
|
public void saveGenerateImmediately(Generate generate) {
|
||||||
save(generate);
|
save(generate);
|
||||||
// 使用 TransactionSynchronizationManager 在事务真正提交后再设锁
|
// 使用 TransactionSynchronizationManager 在事务真正提交后再设锁
|
||||||
|
|||||||
Reference in New Issue
Block a user