Skip to content

Commit

Permalink
feat: 회원 정보 조회에 지역 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
nuyh99 committed Nov 27, 2023
1 parent 30b2f65 commit 2e8e81c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 31 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/example/busan/member/MemberService.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public MemberInfoResponse getMemberInfo(final Authentication authentication) {
member.getEmail(),
authentication.role(),
member.getCompany(),
member.getRegion(),
member.getCreatedAt());
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.example.busan.member.dto;

import com.example.busan.member.domain.Region;
import com.example.busan.member.domain.Role;

import java.time.LocalDateTime;

public record MemberInfoResponse(String name, String phone, String email, Role role, String company,
LocalDateTime createdAt) {
Region region, LocalDateTime createdAt) {
}
61 changes: 32 additions & 29 deletions src/main/resources/static/api/openapi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/members-140297472'
$ref: '#/components/schemas/members1182193868'
examples:
현재 유저 정보 조회하기:
value: "{\"name\":\"연어\",\"phone\":\"01012341234\",\"email\":\"\
[email protected]\",\"role\":\"USER\",\"company\":\"우형\",\"createdAt\"\
:\"2023-11-25T21:57:28.839265\"}"
[email protected]\",\"role\":\"USER\",\"company\":\"우형\",\"region\"\
:\"BUSAN\",\"createdAt\":\"2023-11-27T15:23:52.095109\"}"
post:
tags:
- members
Expand Down Expand Up @@ -279,13 +279,13 @@ paths:
examples:
자신의 회의실 예약 목록 최신 순으로 보기:
value: "[{\"id\":1,\"status\":\"RESERVED\",\"cancelReason\":null,\"\
startTime\":\"2023-11-25T21:57:30.235679\",\"endTime\":\"2023-11-25T23:57:30.235684\"\
startTime\":\"2023-11-27T15:23:53.632779\",\"endTime\":\"2023-11-27T17:23:53.632784\"\
,\"name\":\"황재현\",\"phone\":\"01012341234\",\"reservedAt\":\"\
2023-11-25T21:57:30.235693\",\"roomId\":1,\"roomName\":\"대회의실\"\
2023-11-27T15:23:53.632794\",\"roomId\":1,\"roomName\":\"대회의실\"\
},{\"id\":2,\"status\":\"CANCELED\",\"cancelReason\":\"쓰기 싫어졌어\
요..\",\"startTime\":\"2023-11-25T21:57:30.235701\",\"endTime\"\
:\"2023-11-25T23:57:30.235703\",\"name\":\"황재현\",\"phone\":\"\
01012341234\",\"reservedAt\":\"2023-11-25T21:57:30.235705\",\"\
요..\",\"startTime\":\"2023-11-27T15:23:53.632803\",\"endTime\"\
:\"2023-11-27T17:23:53.632804\",\"name\":\"황재현\",\"phone\":\"\
01012341234\",\"reservedAt\":\"2023-11-27T15:23:53.632807\",\"\
roomId\":1,\"roomName\":\"대회의실\"}]"
post:
tags:
Expand Down Expand Up @@ -422,27 +422,6 @@ components:
email:
type: string
description: 이메일 형식
members-140297472:
type: object
properties:
createdAt:
type: string
description: 가입일
role:
type: string
description: 계정 권한
phone:
type: string
description: 휴대폰
name:
type: string
description: 이름
company:
type: string
description: 회사
email:
type: string
description: 이메일
members-email-1386460070:
type: object
properties:
Expand Down Expand Up @@ -529,6 +508,30 @@ components:
email:
type: string
description: 이메일
members1182193868:
type: object
properties:
createdAt:
type: string
description: 가입일
role:
type: string
description: 계정 권한
phone:
type: string
description: 휴대폰
name:
type: string
description: 이름
company:
type: string
description: 회사
region:
type: string
description: 지역
email:
type: string
description: 이메일
reservations-reservationId-361069914:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void getMemberInfo() throws Exception {
//given
httpSession.setAttribute(AUTHORIZATION, new Authentication("[email protected]", Role.USER));
given(memberService.getMemberInfo(any()))
.willReturn(new MemberInfoResponse("연어", "01012341234", "[email protected]", Role.USER, "우형", LocalDateTime.now()));
.willReturn(new MemberInfoResponse("연어", "01012341234", "[email protected]", Role.USER, "우형", Region.BUSAN, LocalDateTime.now()));

//when
final MockHttpServletResponse response = mockMvc.perform(
Expand All @@ -215,6 +215,7 @@ void getMemberInfo() throws Exception {
fieldWithPath("company").description("회사"),
fieldWithPath("createdAt").description("가입일"),
fieldWithPath("email").description("이메일"),
fieldWithPath("region").description("지역"),
fieldWithPath("role").description("계정 권한"))))
.andReturn()
.getResponse();
Expand Down

0 comments on commit 2e8e81c

Please sign in to comment.