bug fix: Ambiguous mapping. Cannot map ‘***’ method
This commit is contained in:
parent
0a31998bd3
commit
f8123c6e52
@ -19,22 +19,22 @@ public class UsersController {
|
|||||||
//添加新用户
|
//添加新用户
|
||||||
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public Users addUsers(@RequestBody UsersPassword usersPassword, @RequestBody Users users) {
|
public Users addUsers(@RequestBody UsersPassword usersPassword,
|
||||||
usersService.addPassword(usersPassword);
|
@RequestBody Users users) {
|
||||||
return usersService.addUsers(users);
|
return usersService.addUsers(users, usersPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
//通过ID删除用户
|
//通过ID删除用户
|
||||||
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete/{userID}")
|
||||||
public void deleteUsers(@RequestParam(name = "userID") Long userID) {
|
public void deleteUsers(@PathVariable(name = "userID") Long userID) {
|
||||||
usersService.deleteUsersById(userID);
|
usersService.deleteUsersById(userID);
|
||||||
}
|
}
|
||||||
|
|
||||||
//通过姓名删除用户
|
//通过姓名删除用户
|
||||||
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete/{name}")
|
||||||
public void deleteUsers(@RequestParam(name = "name") String name) {
|
public void deleteUsers(@PathVariable(name = "name") String name) {
|
||||||
usersService.deleteUsersByName(name);
|
usersService.deleteUsersByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,15 +54,15 @@ public class UsersController {
|
|||||||
|
|
||||||
//根据姓名查找用户
|
//根据姓名查找用户
|
||||||
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
||||||
@GetMapping("/find")
|
@GetMapping("/find/{name}")
|
||||||
public Users getUsersByName(@RequestParam(name = "name") String name) {
|
public Users getUsersByName(@PathVariable(name = "name") String name) {
|
||||||
return usersService.findByName(name);
|
return usersService.findByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据ID查找用户
|
//根据ID查找用户
|
||||||
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
@RoleVerificationAnnotation(RoleIDList = {1}, UserIDList = {1})
|
||||||
@GetMapping("/find")
|
@GetMapping("/find/{id}")
|
||||||
public Users getUsersById(@RequestParam(name = "id") Long userID) {
|
public Users getUsersById(@PathVariable(name = "id") Long userID) {
|
||||||
return usersService.findById(userID);
|
return usersService.findById(userID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user