代码提交

This commit is contained in:
luozhun 2024-12-19 14:36:07 +08:00
parent c5f5f1df97
commit 63f806302f
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.changhu.support.fastjson2.serializer;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson2.JSONWriter;
import com.alibaba.fastjson2.writer.ObjectWriter;
@ -22,6 +23,8 @@ public class MinioPrefixSerializer implements ObjectWriter<String> {
@Override
public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {
jsonWriter.writeString(minioPrefix + object);
if (object instanceof String path && StrUtil.isNotEmpty(path)) {
jsonWriter.writeString(minioPrefix + object);
}
}
}