-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
23 deletions.
There are no files selected for viewing
14 changes: 13 additions & 1 deletion
14
src/main/java/com/example/busan/auth/dto/FindEmailResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
package com.example.busan.auth.dto; | ||
|
||
public record FindEmailResponse(String email) { | ||
import com.example.busan.member.domain.Member; | ||
|
||
import java.util.List; | ||
|
||
public record FindEmailResponse(List<String> emails) { | ||
|
||
public static FindEmailResponse from(final List<Member> members) { | ||
final List<String> emails = members.stream() | ||
.map(Member::getEmail) | ||
.toList(); | ||
|
||
return new FindEmailResponse(emails); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,10 +80,10 @@ paths: | |
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/auth-email-1599798553' | ||
$ref: '#/components/schemas/auth-email802416584' | ||
examples: | ||
휴대폰 번호로 이메일 찾기: | ||
value: "{\"email\":\"[email protected]\"}" | ||
value: "{\"emails\":[\"[email protected]\"]}" | ||
/auth/login: | ||
post: | ||
tags: | ||
|
@@ -154,7 +154,7 @@ paths: | |
현재 유저 정보 조회하기: | ||
value: "{\"name\":\"연어\",\"phone\":\"01012341234\",\"email\":\"\ | ||
[email protected]\",\"role\":\"USER\",\"company\":\"우형\",\"region\"\ | ||
:\"BUSAN\",\"createdAt\":\"2023-11-30T00:09:16.804123\"}" | ||
:\"BUSAN\",\"createdAt\":\"2023-11-30T00:23:50.435321\"}" | ||
post: | ||
tags: | ||
- members | ||
|
@@ -281,13 +281,13 @@ paths: | |
examples: | ||
자신의 회의실 예약 목록 최신 순으로 보기: | ||
value: "[{\"id\":1,\"status\":\"RESERVED\",\"cancelReason\":null,\"\ | ||
startTime\":\"2023-11-30T00:09:18.518235\",\"endTime\":\"2023-11-30T02:09:18.518239\"\ | ||
startTime\":\"2023-11-30T00:23:52.419309\",\"endTime\":\"2023-11-30T02:23:52.419313\"\ | ||
,\"name\":\"황재현\",\"phone\":\"01012341234\",\"reservedAt\":\"\ | ||
2023-11-30T00:09:18.518249\",\"roomId\":1,\"roomName\":\"대회의실\"\ | ||
2023-11-30T00:23:52.419324\",\"roomId\":1,\"roomName\":\"대회의실\"\ | ||
},{\"id\":2,\"status\":\"CANCELED\",\"cancelReason\":\"쓰기 싫어졌어\ | ||
요..\",\"startTime\":\"2023-11-30T00:09:18.518257\",\"endTime\"\ | ||
:\"2023-11-30T02:09:18.518259\",\"name\":\"황재현\",\"phone\":\"\ | ||
01012341234\",\"reservedAt\":\"2023-11-30T00:09:18.518263\",\"\ | ||
요..\",\"startTime\":\"2023-11-30T00:23:52.419331\",\"endTime\"\ | ||
:\"2023-11-30T02:23:52.419333\",\"name\":\"황재현\",\"phone\":\"\ | ||
01012341234\",\"reservedAt\":\"2023-11-30T00:23:52.419335\",\"\ | ||
roomId\":1,\"roomName\":\"대회의실\"}]" | ||
post: | ||
tags: | ||
|
@@ -404,12 +404,6 @@ components: | |
roomId: | ||
type: number | ||
description: 예약할 회의실 ID | ||
auth-email-1599798553: | ||
type: object | ||
properties: | ||
email: | ||
type: string | ||
description: 해당 번호의 이메일 | ||
auth-phone2135928301: | ||
type: object | ||
properties: | ||
|
@@ -535,6 +529,18 @@ components: | |
email: | ||
type: string | ||
description: 이메일 | ||
auth-email802416584: | ||
type: object | ||
properties: | ||
emails: | ||
type: array | ||
description: 해당 번호로된 이메일 리스트 | ||
items: | ||
oneOf: | ||
- type: object | ||
- type: boolean | ||
- type: string | ||
- type: number | ||
reservations-reservationId-361069914: | ||
type: object | ||
properties: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
import org.springframework.mock.web.MockHttpServletResponse; | ||
import org.springframework.mock.web.MockHttpSession; | ||
|
||
import java.util.List; | ||
|
||
import static com.epages.restdocs.apispec.MockMvcRestDocumentationWrapper.document; | ||
import static com.example.busan.auth.AuthController.AUTHORIZATION; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
@@ -132,7 +134,7 @@ void authenticatePhone2() throws Exception { | |
void findEmailByPhone() throws Exception { | ||
//given | ||
given(authService.findEmailByPhone(any())) | ||
.willReturn(new FindEmailResponse("[email protected]")); | ||
.willReturn(new FindEmailResponse(List.of("[email protected]"))); | ||
|
||
//when | ||
final MockHttpServletResponse response = mockMvc.perform( | ||
|
@@ -141,7 +143,7 @@ void findEmailByPhone() throws Exception { | |
.andDo(print()) | ||
.andDo(document("휴대폰 번호로 이메일 찾기", | ||
queryParameters(parameterWithName("phone").description("인증 완료된 휴대폰 번호")), | ||
responseFields(fieldWithPath("email").description("해당 번호의 이메일")))) | ||
responseFields(fieldWithPath("emails").description("해당 번호로된 이메일 리스트")))) | ||
.andReturn() | ||
.getResponse(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters