Leaf
Leaf copied to clipboard
关于Restful风格API的优化建议
看到com.sankuai.inf.leaf.server.controller.LeafController
这个类里面的接口采用了@PathVariable
,意味着其实是想用Restful风格,但是为什么不直接用@GetMapping
呢?目前做法是@RequestMapping(value = "/api/segment/get/{key}")
,采取了get这个动词做uri的一部分,感觉很不妥。建议@GetMapping(value = "/api/segment/{key}")
是同学吗