Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/210 #215

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,4 @@ jobs:
version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
region: ap-northeast-1
deployment_package: deploy/deploy.zip
wait_for_environment_recovery: 300
# wait_for_deployment: false
wait_for_deployment: false
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public void init(){
@Transactional
public OAuthResult.OAuthResultDto SocialLogin(MemberRequestDto.OAuthRequestDto request,String type) {
Member member = memberRepository.findByEmail(request.getEmail()).orElse(null);

request.toString();
if(member != null) {
String accessToken = null;
Optional<FcmToken> fcmToken = fcmTokenRepository.findByTokenAndSerialNumber(request.getFcmToken(), request.getSerialNumber());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,46 +567,46 @@ public Page<Recipe> recipeListByCategory(Long categoryId, Integer pageIndex, Mem
if(recipeCategory.isEmpty())
throw new RecipeException(CommonStatus.RECIPE_NOT_FOUND);

QRecipe qRecipe = recipe;
QRecipeCategoryMapping qRecipeCategoryMapping = recipeCategoryMapping;
QFollow qFollow = follow;

//ํŒ”๋กœ์ž‰ ๋ ˆ์‹œํ”ผ ๊ฐฏ์ˆ˜ ๊ณ„์‚ฐ(์ผ์ฃผ์ผ ์ „ ๊ฒƒ๊นŒ์ง€)
Long followingCount = queryFactory
.select(recipe.count())
.from(recipe)
.join(recipe.categoryMappingList, recipeCategoryMapping).fetchJoin()
.where(blockedMemberNotInForRecipe(member),
recipeCategoryMapping.category.id.eq(categoryId),
getFollowerRecipeCondition(member),
recipe.createdAt.after(LocalDateTime.now().minusWeeks(1))
)
.fetchOne();

// QRecipe qRecipe = recipe;
// QRecipeCategoryMapping qRecipeCategoryMapping = recipeCategoryMapping;
// QFollow qFollow = follow;
//
// //ํŒ”๋กœ์ž‰ ๋ ˆ์‹œํ”ผ ๊ฐฏ์ˆ˜ ๊ณ„์‚ฐ(์ผ์ฃผ์ผ ์ „ ๊ฒƒ๊นŒ์ง€)
// Long followingCount = queryFactory
// .select(recipe.count())
// .from(recipe)
// .join(recipe.categoryMappingList, recipeCategoryMapping).fetchJoin()
// .where(blockedMemberNotInForRecipe(member),
// recipeCategoryMapping.category.id.eq(categoryId),
// getFollowerRecipeCondition(member),
// recipe.createdAt.after(LocalDateTime.now().minusWeeks(1))
// )
// .fetchOne();
//
List<Recipe> content = new ArrayList<>();

if(followingCount >= pageIndex*pageSize){
//index๋ฅผ ๋„˜์ง€ ์•Š์œผ๋ฉด ํŒ”๋กœ์ž‰ ๋ ˆ์‹œํ”ผ ๋จผ์ €
content = queryFactory
.selectFrom(recipe)
.join(recipe.categoryMappingList, recipeCategoryMapping).fetchJoin()
.where(blockedMemberNotInForRecipe(member),
recipeCategoryMapping.category.id.eq(categoryId),
getFollowerRecipeCondition(member),
recipe.createdAt.after(LocalDateTime.now().minusWeeks(1))
)
.orderBy(recipe.createdAt.desc())
.offset(pageIndex*pageSize)
.limit(pageSize)
.fetch();

} else if(followingCount >(pageIndex-1)*pageSize) {
//index์— ๋ผ์–ด์žˆ์œผ๋ฉด ํŒ”๋กœ์ž‰,์ผ๋ฐ˜ ๋ ˆ์‹œํ”ผ ๋‘˜ ๋‹ค. offset๊ณผ pagesize ์ž˜ ๊ณ„์‚ฐํ•ด์•ผํ•จ

} else{
//์ผ๋ฐ˜ ๋ ˆ์‹œํ”ผ๋งŒ. offset ์ž˜ ๊ณ„์‚ฐํ•ด์•ผํ•จ

}
//
// if(followingCount >= pageIndex*pageSize){
// //index๋ฅผ ๋„˜์ง€ ์•Š์œผ๋ฉด ํŒ”๋กœ์ž‰ ๋ ˆ์‹œํ”ผ ๋จผ์ €
// content = queryFactory
// .selectFrom(recipe)
// .join(recipe.categoryMappingList, recipeCategoryMapping).fetchJoin()
// .where(blockedMemberNotInForRecipe(member),
// recipeCategoryMapping.category.id.eq(categoryId),
// getFollowerRecipeCondition(member),
// recipe.createdAt.after(LocalDateTime.now().minusWeeks(1))
// )
// .orderBy(recipe.createdAt.desc())
// .offset(pageIndex*pageSize)
// .limit(pageSize)
// .fetch();
//
// } else if(followingCount >(pageIndex-1)*pageSize) {
// //index์— ๋ผ์–ด์žˆ์œผ๋ฉด ํŒ”๋กœ์ž‰,์ผ๋ฐ˜ ๋ ˆ์‹œํ”ผ ๋‘˜ ๋‹ค. offset๊ณผ pagesize ์ž˜ ๊ณ„์‚ฐํ•ด์•ผํ•จ
//
// } else{
// //์ผ๋ฐ˜ ๋ ˆ์‹œํ”ผ๋งŒ. offset ์ž˜ ๊ณ„์‚ฐํ•ด์•ผํ•จ
//
// }


content = queryFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public String toString() {
@Getter
@Setter
public static class OAuthRequestDto {
@Override
public String toString() {
return "OAuthRequestDto{" +
"email='" + email + '\'' +
", fcmToken='" + fcmToken + '\'' +
", serialNumber='" + serialNumber + '\'' +
'}';
}
private String email;
private String fcmToken;
private String serialNumber;
Expand Down
Loading