|
@@ -1457,7 +1457,9 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
.stream().map(item -> JSONUtil.toBean((String) item, MidjourneyUserQueue.class)).collect(Collectors.toList());
|
|
.stream().map(item -> JSONUtil.toBean((String) item, MidjourneyUserQueue.class)).collect(Collectors.toList());
|
|
|
list.forEach(item -> {
|
|
list.forEach(item -> {
|
|
|
try {
|
|
try {
|
|
|
- item.setBase64Array(JSONUtil.toJsonStr(List.of(encodeImageToBase64("/mnt/picture/"+item.getQueueId()+"."+item.getFileExt(),item.getFileExt()))));
|
|
|
|
|
|
|
+ if (item.getFileExt() != null){
|
|
|
|
|
+ item.setBase64Array(JSONUtil.toJsonStr(List.of(encodeImageToBase64("/mnt/picture/"+item.getQueueId()+"."+item.getFileExt(),item.getFileExt()))));
|
|
|
|
|
+ }
|
|
|
Long rank = redisService.zRank(RedisService.key.MIDJOURNEY_QUEUE_LIMIT.getName() + userId, item.getQueueId());
|
|
Long rank = redisService.zRank(RedisService.key.MIDJOURNEY_QUEUE_LIMIT.getName() + userId, item.getQueueId());
|
|
|
item.setPosition((rank != null) ? rank + 1 : 1);
|
|
item.setPosition((rank != null) ? rank + 1 : 1);
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
@@ -1558,6 +1560,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
* base64图片存本地
|
|
* base64图片存本地
|
|
|
*/
|
|
*/
|
|
|
public static String base64ToPic(Long queueId,List<String> base64Array) throws IOException {
|
|
public static String base64ToPic(Long queueId,List<String> base64Array) throws IOException {
|
|
|
|
|
+ if (base64Array == null) return null;
|
|
|
for (String base64 : base64Array) {
|
|
for (String base64 : base64Array) {
|
|
|
String fileExt = "jpeg";
|
|
String fileExt = "jpeg";
|
|
|
if (base64.contains(";")){
|
|
if (base64.contains(";")){
|