V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
elliotloststh
V2EX  ›  问与答

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

  •  
  •   elliotloststh · Jul 24, 2020 · 1104 views
    This topic created in 2103 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   ·   1044 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:47 · PVG 06:47 · LAX 15:47 · JFK 18:47
    ♥ Do have faith in what you're doing.