Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop_back_core' into develop_…
Browse files Browse the repository at this point in the history
…back_core
  • Loading branch information
seokho-1116 committed Aug 4, 2024
2 parents 8d40ddf + 892df12 commit 6e0f232
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ ResponseEntity<ApiSpec<GroupCapsuleSliceResponse>> getGroupCapsules(
@Max(value = 40, message = "최대 페이징 크기는 40입니다.")
int size,

@Parameter(in = ParameterIn.QUERY, description = "마지막 캡슐 아이디", required = true)
@Parameter(in = ParameterIn.QUERY, description = "마지막 캡슐 아이디")
Long lastCapsuleId
);

Expand Down Expand Up @@ -151,7 +151,7 @@ ResponseEntity<ApiSpec<GroupSpecificCapsuleSliceResponse>> getGroupSpecificCapsu
@Parameter(in = ParameterIn.QUERY, description = "페이지 크기", required = true)
int size,

@Parameter(in = ParameterIn.QUERY, description = "마지막 캡슐 아이디", required = true)
@Parameter(in = ParameterIn.QUERY, description = "마지막 캡슐 아이디")
Long lastCapsuleId
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class Member extends BaseEntity {
private Boolean tagSearchAvailable = Boolean.TRUE;

@Column(name = "phone_search_available", nullable = false)
private Boolean phoneSearchAvailable = Boolean.TRUE;
private Boolean phoneSearchAvailable = Boolean.FALSE;

@Builder
private Member(String profileUrl, String nickname, SocialType socialType, String email,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

// swagger 접속 url -> http://localhost:8080/api/swagger-ui/index.html#/

@Configuration
public class SwaggerConfig {

@Bean
public OpenAPI springShopOpenAPI() {
public OpenAPI openApi() {
return new OpenAPI()
.servers(getServers())
.info(getInfo())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-- friend_invite 외래 키 삭제 -> 유니크 키 삭제 -> 외래 키 추가
ALTER TABLE friend_invite
DROP CONSTRAINT fk_friend_invite_owner_id;

ALTER TABLE friend_invite
DROP CONSTRAINT fk_friend_invite_friend_id;

ALTER TABLE friend_invite DROP KEY unique_owner_friend_pair;

ALTER TABLE friend_invite
ADD CONSTRAINT fk_friend_invite_owner_id FOREIGN KEY (owner_id) REFERENCES member (member_id);

ALTER TABLE friend_invite
ADD CONSTRAINT fk_friend_invite_friend_id FOREIGN KEY (friend_id) REFERENCES member (member_id);

-- member_friend 외래 키 삭제 -> 유니크 키 삭제 -> 외래 키 추가
ALTER TABLE member_friend
DROP CONSTRAINT fk_member_friend_owner_id;

ALTER TABLE member_friend
DROP CONSTRAINT fk_member_friend_friend_id;

ALTER TABLE member_friend DROP KEY unique_owner_friend_relation;

ALTER TABLE member_friend
ADD CONSTRAINT fk_member_friend_owner_id FOREIGN KEY (owner_id) REFERENCES member (member_id);

ALTER TABLE member_friend
ADD CONSTRAINT fk_member_friend_friend_id FOREIGN KEY (friend_id) REFERENCES member (member_id);
Original file line number Diff line number Diff line change
Expand Up @@ -245,36 +245,6 @@ void clear(@Autowired EntityManager entityManager) {
assertThat(friends).isEmpty();
}

@Test
void 사용자가_친구인_사용자로_주소록_기반_사용자_리스트_조회하면_친구인_앱_사용자_리스트가_나온다() {
//given
//when
List<SearchFriendSummaryDto> friends = memberFriendQueryRepository.findFriendsByPhone(
ownerId,
hashedFriendPhones);

//then
assertSoftly(softly -> {
softly.assertThat(friends.size()).isSameAs(MAX_COUNT);
softly.assertThat(friends).allMatch(friend -> friend.isFriend() == Boolean.TRUE);
});
}

@Test
void 사용자가_친구가_아닌_사용자로_주소록_기반_사용자_리스트_조회하면_앱_사용자_리스트가_나온다() {
//given
//when
List<SearchFriendSummaryDto> friends = memberFriendQueryRepository.findFriendsByPhone(
ownerId,
hashedNotFriendPhones);

//then
assertSoftly(softly -> {
assertThat(friends.size()).isSameAs(MAX_COUNT);
softly.assertThat(friends).allMatch(friend -> friend.isFriend() == Boolean.FALSE);
});
}

@Test
void 사용자가_빈_전화번호_목록으로_주소록_기반_사용자_리스트_조회하면_빈_리스트가_나온다() {
//given
Expand Down

0 comments on commit 6e0f232

Please sign in to comment.