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

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

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

  •  1
     
  •   kevinwan · Nov 19, 2020 · 2864 views
    This topic created in 2027 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   ·   1056 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 19:01 · PVG 03:01 · LAX 12:01 · JFK 15:01
    ♥ Do have faith in what you're doing.