我得到以下代码:
@GetMapping(value = "/user/{username}/{auth_key}", produces = MediaType.APPLICATION_JSON_VALUE)
public ProfileRequest getUser(final @PathVariable("username") String username,
final @PathVariable(value = "auth_key", required = false) UUID authKey) {
而且我不明白为什么/ user / {username}无法处理我的请求。
制造商。
/ user / {用户名} / {auth_key}和/ user / {用户名}是不同的URL。将所有这些URL放入@GetMapping批注将解决您的问题:
@GetMapping(value = {"/user/{username}/{auth_key}", "/user/{username}/"}, produces = MediaType.APPLICATION_JSON_VALUE)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句