Skip to content

Endpoint get list users by id #2

@cchriss123

Description

@cchriss123

I could use an endpoint to people to get a list of users when I send a list of user Id.
Something like this would work but with DTO and service etc...

http://localhost:8002/getUsers/1,3,4

@GetMapping("/{userIds}")
List<User> getUsers(@PathVariable List<Long> userIds) {

    return userRepository.findAllById(userIds); 
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions