elliotloststh
V2EX  ›  问与答

Java Service 接口返回的应该是大类型还是小类型

  •  
  •   elliotloststh · Jul 24, 2020 · 1175 views
    This topic created in 2150 days ago, the information mentioned may be changed or developed.

    如题,本人新程序员,前辈说都该用大类型( Integer ),我觉得用小类型(基本类型 int ),不然岂不是判空等都要到 controller 层判断?望各位解惑

    2 replies    2020-07-25 00:02:21 +08:00
    HuHui
        1
    HuHui  
       Jul 24, 2020 via Android
    看业务
    wdlth
        2
    wdlth  
       Jul 25, 2020
    VO 要用包装类型,Controller 判断可以用 JSR-303,在 VO 上加注解。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   931 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 19:59 · PVG 03:59 · LAX 12:59 · JFK 15:59
    ♥ Do have faith in what you're doing.