diff --git a/likelion-admin/src/main/java/likelion/univ/config/SecurityConfig.java b/likelion-admin/src/main/java/likelion/univ/config/SecurityConfig.java index 1af84968..c37f8d57 100644 --- a/likelion-admin/src/main/java/likelion/univ/config/SecurityConfig.java +++ b/likelion-admin/src/main/java/likelion/univ/config/SecurityConfig.java @@ -38,7 +38,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{ .authorizeRequests() .antMatchers(SwaggerUrlPatterns) .permitAll() -/* .antMatchers("/univAdmin/**").hasRole(ADMIN)*/ + .antMatchers("/v1/univAdmin/**").hasRole("MANAGER") + .antMatchers("/v1/headquaters/**").hasRole("SUPER_ADMIN") // .antMatchers("/v1/**").hasRole(ROLE_USER) // .anyRequest().authenticated(); .anyRequest().permitAll(); //임시 diff --git a/likelion-core/src/main/java/likelion/univ/domain/post/dto/enums/SubCategory.java b/likelion-core/src/main/java/likelion/univ/domain/post/dto/enums/SubCategory.java index 01e7da02..4e7249b7 100644 --- a/likelion-core/src/main/java/likelion/univ/domain/post/dto/enums/SubCategory.java +++ b/likelion-core/src/main/java/likelion/univ/domain/post/dto/enums/SubCategory.java @@ -10,7 +10,7 @@ @RequiredArgsConstructor public enum SubCategory { // HQ - NOTICE("공지 사항"), + NOTICE("공지사항"), // board INFO("정보공유"), diff --git a/likelion-core/src/main/java/likelion/univ/domain/user/repository/impl/UserCustomRepositoryImpl.java b/likelion-core/src/main/java/likelion/univ/domain/user/repository/impl/UserCustomRepositoryImpl.java index 32d69866..b5aaab5b 100644 --- a/likelion-core/src/main/java/likelion/univ/domain/user/repository/impl/UserCustomRepositoryImpl.java +++ b/likelion-core/src/main/java/likelion/univ/domain/user/repository/impl/UserCustomRepositoryImpl.java @@ -78,7 +78,7 @@ private BooleanExpression eqRole(Role role) { @Override public Page findByUniversityInfoUniversityId(Long univId, Pageable pageable){ - List ids = getCoveringIndex(null); + List ids = getCoveringIndexByUniversityId(univId); NumberExpression partOrder = new CaseBuilder() .when(user.profile.part.eq(Part.PM)).then(1) .when(user.profile.part.eq(Part.DESIGNER)).then(2) @@ -91,8 +91,7 @@ public Page findByUniversityInfoUniversityId(Long univId, Pageable pageabl .select(user) .from(user) .innerJoin(user.universityInfo.university, university).fetchJoin() - .where( eqUnivId(univId), - user.id.in(ids)) + .where(user.id.in(ids)) .offset(pageable.getOffset()) .orderBy(user.universityInfo.ordinal.desc(), user.universityInfo.university.name.asc(), @@ -114,6 +113,7 @@ public Page findByUnivNameAndRole(Role role, String univName, Pageable pag .when(user.profile.part.eq(Part.FRONTEND)).then(4) .when(user.profile.part.eq(Part.BACKEND)).then(5) .otherwise(6); + List users = queryFactory .select(user) @@ -132,6 +132,7 @@ public Page findByUnivNameAndRole(Role role, String univName, Pageable pag return PageableExecutionUtils.getPage(users, pageable, ids::size); + } @@ -223,6 +224,16 @@ private List getCoveringIndex(Predicate predicate){ .where(predicate, user.authInfo.accountStatus.eq(AccountStatus.ACTIVE)) .fetch(); } + + private List getCoveringIndexByUniversityId(Long univId){ + return queryFactory + .select(user.id) + .from(user) + .where(user.authInfo.accountStatus.eq(AccountStatus.ACTIVE), + eqUnivId(univId)) + .fetch(); + } + private OrderSpecifier[] getOrders(EntityPath qEntity, Sort sort) { return sort.stream().map(it -> getOrder(qEntity, it)).toArray(OrderSpecifier[]::new); }