@RestController(value="user")
@RequestMapping(value={"/v1/auth","/v1/auth/users"})
public class UserController
extends Object
| 构造器和说明 |
|---|
UserController() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
createUser(String username,
String password)
Create a new user.
|
Object |
deleteUser(String username)
Delete an existed user.
|
Object |
getUsers(int pageNo,
int pageSize)
Get paged users.
|
Object |
login(String username,
String password,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request)
Login to Nacos
This methods uses username and password to require a new token.
|
List<String> |
searchUsersLikeUsername(String username)
Fuzzy matching username.
|
com.alibaba.nacos.common.model.RestResult<String> |
updatePassword(String oldPassword,
String newPassword)
已过时。
|
Object |
updateUser(String username,
String newPassword,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request)
Update an user.
|
@PostMapping public Object createUser(@RequestParam String username, @RequestParam String password)
username - usernamepassword - passwordIllegalArgumentException - if user already exist@DeleteMapping public Object deleteUser(@RequestParam String username)
username - username of user@PutMapping public Object updateUser(@RequestParam String username, @RequestParam String newPassword, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request) throws IOException
username - username of usernewPassword - new password of userresponse - http responserequest - http requestIllegalArgumentException - if user not exist or oldPassword is incorrectIOException@GetMapping public Object getUsers(@RequestParam int pageNo, @RequestParam int pageSize)
pageNo - number index of pagepageSize - size of page@PostMapping(value="/login") public Object login(@RequestParam String username, @RequestParam String password, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request) throws com.alibaba.nacos.auth.exception.AccessException
This methods uses username and password to require a new token.
username - username of userpassword - passwordresponse - http responserequest - http requestcom.alibaba.nacos.auth.exception.AccessException - if user info is incorrect@PutMapping(value="/password") @Deprecated public com.alibaba.nacos.common.model.RestResult<String> updatePassword(@RequestParam(value="oldPassword") String oldPassword, @RequestParam(value="newPassword") String newPassword)
oldPassword - old passwordnewPassword - new passwordCopyright © 2018–2021 Alibaba Group. All rights reserved.