Skip to content

Commit

Permalink
fix: PR 리뷰 수정사항 반영
Browse files Browse the repository at this point in the history
- HTTP Security 스키마명 변경
- userCount 오류 수정
  • Loading branch information
raymondanythings committed Jul 13, 2024
1 parent bef285b commit 16abe79
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SwaggerConfig {
SecurityScheme apiAuth = new SecurityScheme()
.type(SecurityScheme.Type.HTTP)
.in(SecurityScheme.In.HEADER)
.scheme("bearer")
.scheme("Bearer")
.bearerFormat("JWT")
.name(AUTH_TOKEN);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.layer.domain.space.repository;

import com.querydsl.core.types.ExpressionUtils;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQueryFactory;
import jakarta.persistence.EntityManager;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -33,7 +35,23 @@ public List<SpaceWithMemberCount> findAllSpacesByMemberIdAndCategoryAndCursor(Lo
.and(hasCategory(category));

return queryFactory.select(
new QSpaceWithMemberCount(space.id, space.createdAt, space.updatedAt, space.category, space.field, space.name, space.introduction, space.leaderId, space.formId, memberSpaceRelation.id.count().as("userCount")))
new QSpaceWithMemberCount(
space.id,
space.createdAt,
space.updatedAt,
space.category,
space.field,
space.name,
space.introduction,
space.leaderId,
space.formId,
ExpressionUtils.as(JPAExpressions.select(
memberSpaceRelation.id.count()
)
.from(memberSpaceRelation)
.where(memberSpaceRelation.spaceId.eq(space.id))
, "userCount")
))
.from(space)
.join(memberSpaceRelation).on(space.id.eq(memberSpaceRelation.spaceId))
.where(predicate)
Expand All @@ -55,7 +73,13 @@ public Optional<SpaceWithMemberCount> findByIdAndJoinedMemberId(Long spaceId, Lo
space.introduction,
space.leaderId,
space.formId,
memberSpaceRelation.id.count().as("userCount"))
ExpressionUtils.as(JPAExpressions.select(
memberSpaceRelation.id.count()
)
.from(memberSpaceRelation)
.where(memberSpaceRelation.spaceId.eq(space.id))
, "userCount")
)
)
.from(memberSpaceRelation)
.join(space)
Expand Down

0 comments on commit 16abe79

Please sign in to comment.