Skip to content

Commit

Permalink
๐Ÿ› CORS ์˜ค๋ฅ˜ ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganghee-Lee-0522 committed Jan 12, 2024
1 parent cc70834 commit d36fb57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@Component
public class AuthenticationUtils {

/*
public static String getNickname() {
Authentication authentication = getAuthentication();
Expand Down Expand Up @@ -57,4 +57,6 @@ private static CustomAuthenticationToken getCustomAuthenticationToken(Authentica
throw new IllegalStateException("Unexpected principal type: " + principal.getClass());
}
}
*/
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.committers.snowflowerthon.committersserver.domain.follow.service;

import com.committers.snowflowerthon.committersserver.auth.config.AuthenticationUtils;
import com.committers.snowflowerthon.committersserver.common.validation.ValidationService;
import com.committers.snowflowerthon.committersserver.domain.follow.dto.FollowPatchedDto;
import com.committers.snowflowerthon.committersserver.domain.follow.entity.Follow;
Expand All @@ -20,7 +19,7 @@ public class FollowService {

// Follow ์ƒ์„ฑ
public Follow createFollow(Member buddy){
Long memberId = AuthenticationUtils.getMemberId();
Long memberId = 1L;
Member member = validationService.valMember(memberId);
return Follow.builder()
.buddyId(buddy.getId())
Expand All @@ -45,7 +44,7 @@ public FollowPatchedDto changeFollowStatus(String nickname, Boolean isFollowed)

// 1:1 ์—ฐ๊ฒฐ๋œ Follow ๊ด€๊ณ„๋ฅผ ๋ฐ›์•„์˜ด
public Follow getFollowRelation(Member buddy){ // ๋ฐ˜ํ™˜๊ฐ’์ด NULL์ผ ์ˆ˜ ์žˆ์Œ
Long memberId = AuthenticationUtils.getMemberId();
Long memberId = 1L;
Member member = validationService.valMember(memberId);
return followRepository.findByMemberAndBuddyId(member, buddy.getId())
.orElse(null);
Expand All @@ -62,7 +61,7 @@ public Boolean followStatus(Member otherMember) {

// ๋‚ด๊ฐ€ Followํ•˜๊ณ  ์žˆ๋Š” ์‚ฌ์šฉ์ž๋“ค ๋ถˆ๋Ÿฌ์˜ด
public List<Member> getBuddyList() {
Long memberId = AuthenticationUtils.getMemberId();
Long memberId = 1L;
Member member = validationService.valMember(memberId);
List<Follow> followList = followRepository.findAllByMember(member);
if (followList == null || followList.isEmpty()) { // ํŒ”๋กœ์šฐ ์ค‘์ธ ์‚ฌ๋žŒ์ด ์—†์Œ
Expand Down

0 comments on commit d36fb57

Please sign in to comment.