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

关于 SSM 框架的一些问题

  •  
  •   shuai007 · Aug 29, 2019 · 4492 views
    This topic created in 2444 days ago, the information mentioned may be changed or developed.
    我在 mybatis 中根据 id 查到一条数据,想把这条数据的值返回到 controller,该怎么做啊
    10 replies    2019-08-30 10:24:33 +08:00
    shadow0801
        1
    shadow0801  
       Aug 29, 2019
    没太明白你的问题。按我的理解,你在 mapper 查询之后依次返回到 service,再往上不就到 controller 了吗?
    shuai007
        2
    shuai007  
    OP
       Aug 29, 2019
    好像是在 service 层需要处理数据
    zardly666
        3
    zardly666  
       Aug 29, 2019
    你在 service 层调用 mapper 拿到数据以后处理,然后把 service 注入到 controller,就直接拿到了
    mineqiqi
        4
    mineqiqi  
       Aug 29, 2019   ❤️ 1
    mybatis-->entity-->dao-->service-->controller-->model&view-->view
    szandy6
        5
    szandy6  
       Aug 29, 2019   ❤️ 3
    可以在顺丰下个单,寄给 controller,这样就完全解耦了。
    imiao
        6
    imiao  
       Aug 29, 2019 via Android
    把数据告诉我,我寄给 controller
    anakinsky
        7
    anakinsky  
       Aug 29, 2019
    return
    Kontinue
        8
    Kontinue  
       Aug 29, 2019
    这种问题直接问 google 啊,哪篇博客里没有。
    shanding
        9
    shanding  
       Aug 30, 2019
    @wukaixian6 哈哈哈哈哈哈哈哈哈哈哈哈哈哈 兄弟 秀!
    shangfabao
        10
    shangfabao  
       Aug 30, 2019
    ...。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3299 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 79ms · UTC 13:31 · PVG 21:31 · LAX 06:31 · JFK 09:31
    ♥ Do have faith in what you're doing.