• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Str0Dytomh
V2EX  ›  程序员

关于 jackson 的 @JsonSerialize 注解

  •  
  •   Str0Dytomh · Feb 3, 2023 · 1366 views
    This topic created in 1225 days ago, the information mentioned may be changed or developed.

    需要每个字段都加上吗,有没有办法同一种类型的字段只要加一次

    @JsonSerialize(using = BigDecimal2StringJsonSerializer.class )
    BigDecimal money;
    BigDecimal money2;
    BigDecimal money3;
    
    2 replies    2023-02-03 17:05:57 +08:00
    newaccount
        1
    newaccount  
       Feb 3, 2023
    注册全局 formatter?

    WebMvcConfigurer.addFormatters
    beetlerx
        2
    beetlerx  
       Feb 3, 2023
    ObjectMapper.registerModule()
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   903 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 20:13 · PVG 04:13 · LAX 13:13 · JFK 16:13
    ♥ Do have faith in what you're doing.