Home > Back-end >  Encounter SpringBoot return Json format of the Date of strange questions
Encounter SpringBoot return Json format of the Date of strange questions

Time:05-21

Projects using SpringBoot default converter, despite the introduction of FastJson serialization to Redis, but no configuration returns to the front-end converter,
Nacos configured with the default Date in transformation format

Then in the entity using the @ JsonFormat (pattern="yyyy") annotation is invalid, using the @ JSONField (format="yyyy") but effective
The debug the HttpMessageConverter list, didn't find FastJson converter,
Beg ace answering questions,

CodePudding user response:

Has resolved, has found a problem reason,
Because of its own within the framework of the use of unified returns the entity for Result<?> , and through the built-in dictionary translation of aop, the dictionary translation in the aop use entity with FastJson to JSONObject first, and then the existing members of the annotation insert the key, so in fact the outermost layer of the Converter has no date type of data,

CodePudding user response:

  • Related