如果想在 V2EX 获得更好的推广效果,欢迎了解 PRO 会员机制:
https://www.v2ex.com/pro/about

如果你经常使用铜币置顶主题,持有 V2EX Solana Token 会在每日签到时获得额外铜币:
https://www.v2ex.com/solana
kevinwan
V2EX  ›  推广

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

  •  1
     
  •   kevinwan · Nov 19, 2020 · 3206 views
    This topic created in 2184 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
    DoctorCat
    Nov 22, 2020
    1
    看着觉得累,不知为何。 话说怎么跟 swagger 结合呢
    kevinwan
    kevinwan
    OP
    Nov 24, 2020 via iPhone
    2
    @DoctorCat 我们不用 swagger🤩
    DoctorCat
    DoctorCat
    Nov 24, 2020
    3
    @kevinwan 那求教,用啥做文档化了?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2607 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:29 · PVG 12:29 · LAX 20:29 · JFK 23:29
    ♥ Do have faith in what you're doing.