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

kevinwan 11天前 8

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)
}
最新回复 (0)
  • 游客
    2
返回