mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-30 14:30:08 +08:00
Add user id to Project Members
This commit is contained in:
parent
b6140e4fe3
commit
79c22ae7c2
@ -132,12 +132,12 @@ public interface ProjectsApiDAO {
|
||||
|
||||
@RegisterConstructorMapper(ProjectMember.class)
|
||||
@RegisterColumnMapperFactory(CompactRoleColumnMapperFactory.class)
|
||||
@SqlQuery("SELECT u.name AS \"user\", array_agg(r.name) roles " +
|
||||
@SqlQuery("SELECT u.name AS \"user\", u.id AS \"userId\", array_agg(r.name) roles " +
|
||||
" FROM user_project_roles upr" +
|
||||
" JOIN users u ON upr.user_id = u.id " +
|
||||
" JOIN roles r ON upr.role_type = r.name " +
|
||||
" WHERE upr.project_id = :id " +
|
||||
" GROUP BY u.name ORDER BY max(r.permission::bigint) DESC " +
|
||||
" GROUP BY u.name, u.id ORDER BY max(r.permission::bigint) DESC " +
|
||||
" <offsetLimit>")
|
||||
List<ProjectMember> getProjectMembers(long id, @BindPagination RequestPagination pagination);
|
||||
|
||||
|
@ -3,5 +3,5 @@ package io.papermc.hangar.model.api.project;
|
||||
import io.papermc.hangar.model.common.roles.CompactRole;
|
||||
import java.util.List;
|
||||
|
||||
public record ProjectMember(String user, List<CompactRole> roles) {
|
||||
public record ProjectMember(String user, long userId, List<CompactRole> roles) {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user