V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
如果想在 V2EX 获得更好的推广效果,欢迎了解 PRO 会员机制:
https://www.v2ex.com/pro/about
kevinwan
V2EX  ›  推广

我们这样定义 api,大家觉得如何?

  •  1
     
  •   kevinwan · Nov 19, 2020 · 2796 views
    This topic created in 1997 days ago, the information mentioned may be changed or developed.
    type Request {
    	Name string `path:"name"`
    }
    
    type Response {
    	Message string `json:"message"`
    }
    
    service greet-api {
    	@handler NoResponseHandler
    	get /greet/to/:name
    	
    	@handler RemoveHandler
    	delete /greet/remove/:name(Request)
    	
    	@handler NoRequestHandler
    	put /greet/talk returns (Response)
    	
    	@handler NormalHandler
    	post /greet/from/:name(Request) returns (Response)
    }
    
    3 replies    2020-11-24 15:35:26 +08:00
    DoctorCat
        1
    DoctorCat  
       Nov 22, 2020
    看着觉得累,不知为何。 话说怎么跟 swagger 结合呢
    kevinwan
        2
    kevinwan  
    OP
       Nov 24, 2020 via iPhone
    @DoctorCat 我们不用 swagger🤩
    DoctorCat
        3
    DoctorCat  
       Nov 24, 2020
    @kevinwan 那求教,用啥做文档化了?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3066 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 14:05 · PVG 22:05 · LAX 07:05 · JFK 10:05
    ♥ Do have faith in what you're doing.