a379395979
V2EX  ›  问与答

微服务如何划分给后台的接口和给前台的接口

  •  
  •   a379395979 · Aug 12, 2023 · 1846 views
    This topic created in 1026 days ago, the information mentioned may be changed or developed.

    比如一个商品微服务,面向后端有增删改查的接口,面向用户端也有增删改查的接口。 是写在一个 GoodsController 里, 还是用户端的接口写 GoodsController 里 后端的接口写 admin/GoodsController 里, 还是商品微服务只提供给用户端、后端接口另起一个后端微服务。 有什么标准做法吗? spring cloud

    3 replies    2023-08-13 10:28:26 +08:00
    akira
        1
    akira  
       Aug 12, 2023
    面向商品的,面向后端的,面向用户端的,写 3 个不就好了么,纠结啥
    shadow1949
        2
    shadow1949  
       Aug 13, 2023 via Android
    新增 bff 层后端服务,只提供给前端使用,不对后端服务提供能力,它可以调用商品服务和其他非 bff 服务。
    商品服务下沉,只被后端服务调用。
    securityCoding
        3
    securityCoding  
       Aug 13, 2023 via Android
    接入层区分开就好
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1031 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 18:35 · PVG 02:35 · LAX 11:35 · JFK 14:35
    ♥ Do have faith in what you're doing.