|
|
@@ -202,6 +202,9 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
if (code == 3) {
|
|
|
throw BusinessRuntimeException.getInstance("账号不存在");
|
|
|
}
|
|
|
+ if (code == 4) {
|
|
|
+ throw BusinessRuntimeException.getInstance("图片重复");
|
|
|
+ }
|
|
|
if (code == 24) {
|
|
|
throw BusinessRuntimeException.getInstance("prompt包含敏感词");
|
|
|
}
|
|
|
@@ -285,7 +288,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
for (String base64 : base64Array) {
|
|
|
byte[] body = Base64.getDecoder().decode(base64);
|
|
|
- Path tempFile = Files.createTempFile(UUID.randomUUID().toString(), ".jpg");
|
|
|
+ Path tempFile = Files.createTempFile(UUID.randomUUID().toString(), ".jpeg");
|
|
|
try (FileImageOutputStream imageOutput = new FileImageOutputStream(tempFile.toFile())) {
|
|
|
imageOutput.write(body, 0, body.length);
|
|
|
}
|