added columns id and role to users page
This commit is contained in:
parent
87c21ffc90
commit
c6d8371cc7
@ -12,7 +12,9 @@ export default {
|
||||
dataUrl: 'user',
|
||||
transformer: (data) => new User(data),
|
||||
headers: [
|
||||
{ name: 'login', label: 'Логин' }
|
||||
{ name: 'id', label: 'ID' },
|
||||
{ name: 'login', label: 'Логин' },
|
||||
{ name: 'role', label: 'Роль' }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -2,6 +2,7 @@ export default class Monitor {
|
||||
constructor(data) {
|
||||
this._id = data?.id;
|
||||
this._login = data?.login;
|
||||
this._role = data?.role;
|
||||
}
|
||||
|
||||
get id() {
|
||||
@ -18,4 +19,15 @@ export default class Monitor {
|
||||
}
|
||||
this._login = value;
|
||||
}
|
||||
|
||||
get role() {
|
||||
return this._role;
|
||||
}
|
||||
|
||||
set role(value) {
|
||||
if (typeof value !== 'string' || value === null || value.length == 0) {
|
||||
throw 'New model name value ' + value + ' is not a string or empty';
|
||||
}
|
||||
this._role = value;
|
||||
}
|
||||
}
|
@ -19,10 +19,8 @@ public class UserController {
|
||||
this.userService = userService;
|
||||
}
|
||||
@GetMapping(OpenAPI30Configuration.API_PREFIX + "/user")
|
||||
public List<UserDto> getUsers() {
|
||||
return userService.findAllUsers().stream()
|
||||
.map(UserDto::new)
|
||||
.toList();
|
||||
public List<User> getUsers() {
|
||||
return userService.findAllUsers();
|
||||
}
|
||||
@PostMapping(URL_LOGIN)
|
||||
public String login(@RequestBody @Valid UserDto userDto) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user