You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
示例ctrl:
@RestController
@RequestMapping("/test/")
public class TestCtrl {
@GetMapping(value = "getMapInfo")
@ApiOperation(value = "获取MAP信息")
public Map<Long, String> getMapInfo(){
return ImmutableMap.of(-1L, "");
}
}
//fastJsonHttpMessageConverter设置全局参数
FastJsonConfig config = new FastJsonConfig();
//Long类型转String类型
SerializeConfig serializeConfig = SerializeConfig.globalInstance;
serializeConfig.put(Long.class, ToStringSerializer.instance);
serializeConfig.put(BigInteger.class, ToStringSerializer.instance);
serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
config.setSerializeConfig(serializeConfig);
config.setSerializerFeatures(SerializerFeature.BrowserSecure,
SerializerFeature.WriteMapNullValue,
SerializerFeature.WriteNullListAsEmpty,
SerializerFeature.WriteNullStringAsEmpty,
SerializerFeature.WriteNullBooleanAsFalse,
SerializerFeature.WriteDateUseDateFormat,
SerializerFeature.DisableCircularReferenceDetect
);
config.setCharset(StandardCharsets.UTF_8);
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
fastJsonHttpMessageConverter.setFastJsonConfig(config);
//错误输出如下:
{
""-1"": ""
}
The text was updated successfully, but these errors were encountered: