Skip to content

Commit b705c1b

Browse files
committed
Style(#56): 포멧 수정
1 parent 8637507 commit b705c1b

File tree

42 files changed

+11798
-308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+11798
-308
lines changed

application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/service/repetition/strategy/DayRepetitionStrategy.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public List<ScheduleFindResponse> getScheduleResponses(Schedule schedule, LocalD
2828

2929
return searchStartDate.datesUntil(searchEndDate.plusDays(1)).map(
3030
date -> {
31-
LocalDateTime startDateTime = LocalDateTime.of(date, schedule.getStartDateTime().toLocalTime());
32-
LocalDateTime endDateTime = LocalDateTime.of(date, schedule.getEndDateTime().toLocalTime());
33-
return ScheduleFindResponse.of(schedule, startDateTime, endDateTime);
34-
}).collect(Collectors.toList());
31+
LocalDateTime startDateTime = LocalDateTime.of(date, schedule.getStartDateTime().toLocalTime());
32+
LocalDateTime endDateTime = LocalDateTime.of(date, schedule.getEndDateTime().toLocalTime());
33+
return ScheduleFindResponse.of(schedule, startDateTime, endDateTime);
34+
}).collect(Collectors.toList());
3535
}
3636
}

application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/service/repetition/strategy/MonthRepetitionStrategy.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class MonthRepetitionStrategy implements RepetitionStrategy {
2424
public List<ScheduleFindResponse> getScheduleResponses(Schedule schedule, LocalDate searchStartDate,
2525
LocalDate searchEndDate) {
2626

27-
searchStartDate = getMaxDate(searchStartDate, schedule.getRepetitionStartDate());
27+
searchStartDate = getMaxDate(searchStartDate, schedule.getRepetitionStartDate());
2828
searchEndDate = getMinDate(searchEndDate, schedule.getRepetitionEndDate());
2929
LocalDate startDate = getFirstScheduleStartDate(schedule, searchStartDate);
3030

@@ -44,9 +44,11 @@ public List<ScheduleFindResponse> getScheduleResponses(Schedule schedule, LocalD
4444
*/
4545
private LocalDate getFirstScheduleStartDate(Schedule schedule, LocalDate searchStartDate) {
4646

47-
LocalDate firstScheduleEndDate = findNextOrSameByDayOfMonth(searchStartDate, schedule.getEndDateTime().getDayOfMonth());
47+
LocalDate firstScheduleEndDate = findNextOrSameByDayOfMonth(searchStartDate,
48+
schedule.getEndDateTime().getDayOfMonth());
4849

49-
LocalDateTime firstScheduleEndDateTime = LocalDateTime.of(firstScheduleEndDate, schedule.getEndDateTime().toLocalTime());
50+
LocalDateTime firstScheduleEndDateTime = LocalDateTime.of(firstScheduleEndDate,
51+
schedule.getEndDateTime().toLocalTime());
5052

5153
return firstScheduleEndDateTime.minus(schedule.getDuration()).toLocalDate();
5254

application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/service/repetition/strategy/YearRepetitionStrategy.java

+14-12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@
1717
@Service
1818
public class YearRepetitionStrategy implements RepetitionStrategy {
1919

20+
/**
21+
* searchStartDate 와 같거나 그 이후의 첫 번째 일정 시작일을 찾는다.
22+
* @param schedule 할일
23+
* @param searchStartDate 검색 시작 일자
24+
* @return LocalDateTime
25+
*/
26+
private static LocalDate getFirstScheduleStartDate(Schedule schedule, LocalDate searchStartDate) {
27+
LocalDate firstScheduleEndDate = findNextOrSame(searchStartDate, schedule.getEndDateTime().getMonth(),
28+
schedule.getEndDateTime().getDayOfMonth());
29+
LocalDateTime firstScheduleEndDateTime = LocalDateTime.of(firstScheduleEndDate,
30+
schedule.getEndDateTime().toLocalTime());
31+
return firstScheduleEndDateTime.minus(schedule.getDuration()).toLocalDate();
32+
}
33+
2034
/**
2135
* RepetitionCycle = Year 인 경우, Schedule 반복 일정을 조회한다.
2236
* @param schedule Target Schedule
@@ -45,16 +59,4 @@ public List<ScheduleFindResponse> getScheduleResponses(Schedule schedule, LocalD
4559
}
4660
).toList();
4761
}
48-
49-
/**
50-
* searchStartDate 와 같거나 그 이후의 첫 번째 일정 시작일을 찾는다.
51-
* @param schedule 할일
52-
* @param searchStartDate 검색 시작 일자
53-
* @return LocalDateTime
54-
*/
55-
private static LocalDate getFirstScheduleStartDate(Schedule schedule, LocalDate searchStartDate) {
56-
LocalDate firstScheduleEndDate = findNextOrSame(searchStartDate, schedule.getEndDateTime().getMonth(), schedule.getEndDateTime().getDayOfMonth());
57-
LocalDateTime firstScheduleEndDateTime = LocalDateTime.of(firstScheduleEndDate, schedule.getEndDateTime().toLocalTime());
58-
return firstScheduleEndDateTime.minus(schedule.getDuration()).toLocalDate();
59-
}
6062
}

application/wypl-core/src/test/java/com/wypl/wyplcore/ScheduleFixture.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import java.time.LocalDate;
44
import java.time.LocalDateTime;
55

6-
import com.wypl.jpacalendardomain.schedule.domain.embedded.RepetitionCycle;
76
import com.wypl.jpacalendardomain.schedule.domain.Schedule;
87
import com.wypl.jpacalendardomain.schedule.domain.ScheduleInfo;
8+
import com.wypl.jpacalendardomain.schedule.domain.embedded.RepetitionCycle;
99

1010
public enum ScheduleFixture {
1111
DAILY_SCHEDULE(

application/wypl-core/src/test/java/com/wypl/wyplcore/auth/AuthMemberServiceImplTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import com.wypl.googleoauthclient.data.response.GoogleTokenValidationResponse;
1919
import com.wypl.googleoauthclient.domain.AuthMember;
2020
import com.wypl.jpamemberdomain.member.OauthProvider;
21-
import com.wypl.jpamemberdomain.member.repository.SocialMemberRepository;
2221
import com.wypl.jpamemberdomain.member.domain.SocialMember;
2322
import com.wypl.jpamemberdomain.member.exception.MemberErrorCode;
2423
import com.wypl.jpamemberdomain.member.exception.MemberException;
24+
import com.wypl.jpamemberdomain.member.repository.SocialMemberRepository;
2525
import com.wypl.wyplcore.auth.service.AuthMemberServiceImpl;
2626

2727
@ExtendWith(MockitoExtension.class)

application/wypl-core/src/test/java/com/wypl/wyplcore/auth/controller/AuthControllerTest.java

+71-71
Original file line numberDiff line numberDiff line change
@@ -53,41 +53,41 @@ void signInTest() throws Exception {
5353
/* Given */
5454
AuthTokensResponse response = new AuthTokensResponse(0, "at", "rt");
5555
given(authService.generateToken(any(String.class), any(String.class)))
56-
.willReturn(response);
56+
.willReturn(response);
5757

5858
/* When */
5959
ResultActions actions = mockMvc.perform(
60-
RestDocumentationRequestBuilders.post(
61-
"/auth/v1/sign-in/{provider}?code={code}",
62-
"google",
63-
"dummy_code"
64-
)
65-
.contentType(MediaType.APPLICATION_JSON)
60+
RestDocumentationRequestBuilders.post(
61+
"/auth/v1/sign-in/{provider}?code={code}",
62+
"google",
63+
"dummy_code"
64+
)
65+
.contentType(MediaType.APPLICATION_JSON)
6666
);
6767

6868
/* Then */
6969
actions.andDo(print())
70-
.andDo(document("auth/sign-in",
71-
preprocessRequest(prettyPrint()),
72-
preprocessResponse(prettyPrint()),
73-
pathParameters(
74-
parameterWithName("provider").description("소셜 로그인 제공자")
75-
),
76-
queryParameters(
77-
parameterWithName("code").description("인증 코드")
78-
),
79-
responseFields(
80-
fieldWithPath("message").type(JsonFieldType.STRING)
81-
.description("응답 메시지"),
82-
fieldWithPath("body.member_id").type(JsonFieldType.NUMBER)
83-
.description("회원 식별자"),
84-
fieldWithPath("body.access_token").type(JsonFieldType.STRING)
85-
.description("OAuth Access Token"),
86-
fieldWithPath("body.refresh_token").type(JsonFieldType.STRING)
87-
.description("OAuth Refresh Token")
88-
)
89-
))
90-
.andExpect(status().isOk());
70+
.andDo(document("auth/sign-in",
71+
preprocessRequest(prettyPrint()),
72+
preprocessResponse(prettyPrint()),
73+
pathParameters(
74+
parameterWithName("provider").description("소셜 로그인 제공자")
75+
),
76+
queryParameters(
77+
parameterWithName("code").description("인증 코드")
78+
),
79+
responseFields(
80+
fieldWithPath("message").type(JsonFieldType.STRING)
81+
.description("응답 메시지"),
82+
fieldWithPath("body.member_id").type(JsonFieldType.NUMBER)
83+
.description("회원 식별자"),
84+
fieldWithPath("body.access_token").type(JsonFieldType.STRING)
85+
.description("OAuth Access Token"),
86+
fieldWithPath("body.refresh_token").type(JsonFieldType.STRING)
87+
.description("OAuth Refresh Token")
88+
)
89+
))
90+
.andExpect(status().isOk());
9191
}
9292

9393
@DisplayName("토큰을 재발급 한다.")
@@ -96,39 +96,39 @@ void reissueTest() throws Exception {
9696
/* Given */
9797
AuthTokensResponse response = new AuthTokensResponse(0, "at", "rt");
9898
given(authService.reissueToken(any(String.class), any(String.class)))
99-
.willReturn(response);
99+
.willReturn(response);
100100

101101
/* When */
102102
ResultActions actions = mockMvc.perform(
103-
RestDocumentationRequestBuilders.put(
104-
"/auth/v1/reissue?access_token={access_token}&refresh_token={refresh_token}",
105-
"access",
106-
"refresh"
107-
)
108-
.contentType(MediaType.APPLICATION_JSON)
103+
RestDocumentationRequestBuilders.put(
104+
"/auth/v1/reissue?access_token={access_token}&refresh_token={refresh_token}",
105+
"access",
106+
"refresh"
107+
)
108+
.contentType(MediaType.APPLICATION_JSON)
109109
);
110110

111111
/* Then */
112112
actions.andDo(print())
113-
.andDo(document("auth/reissue",
114-
preprocessRequest(prettyPrint()),
115-
preprocessResponse(prettyPrint()),
116-
queryParameters(
117-
parameterWithName("access_token").description("Access Token"),
118-
parameterWithName("refresh_token").description("Refresh Token")
119-
),
120-
responseFields(
121-
fieldWithPath("message").type(JsonFieldType.STRING)
122-
.description("응답 메시지"),
123-
fieldWithPath("body.member_id").type(JsonFieldType.NUMBER)
124-
.description("회원 식별자"),
125-
fieldWithPath("body.access_token").type(JsonFieldType.STRING)
126-
.description("OAuth Access Token"),
127-
fieldWithPath("body.refresh_token").type(JsonFieldType.STRING)
128-
.description("OAuth Refresh Token")
129-
)
130-
))
131-
.andExpect(status().isCreated());
113+
.andDo(document("auth/reissue",
114+
preprocessRequest(prettyPrint()),
115+
preprocessResponse(prettyPrint()),
116+
queryParameters(
117+
parameterWithName("access_token").description("Access Token"),
118+
parameterWithName("refresh_token").description("Refresh Token")
119+
),
120+
responseFields(
121+
fieldWithPath("message").type(JsonFieldType.STRING)
122+
.description("응답 메시지"),
123+
fieldWithPath("body.member_id").type(JsonFieldType.NUMBER)
124+
.description("회원 식별자"),
125+
fieldWithPath("body.access_token").type(JsonFieldType.STRING)
126+
.description("OAuth Access Token"),
127+
fieldWithPath("body.refresh_token").type(JsonFieldType.STRING)
128+
.description("OAuth Refresh Token")
129+
)
130+
))
131+
.andExpect(status().isCreated());
132132
}
133133

134134
@DisplayName("사용자가 로그아웃한다.")
@@ -138,36 +138,36 @@ void logoutTest() throws Exception {
138138
AuthMember authMemberMock = AuthMember.of(1L, "accessToken");
139139

140140
given(authMemberService.getValidatedMemberId(anyString()))
141-
.willReturn(authMemberMock);
141+
.willReturn(authMemberMock);
142142

143143
/* When */
144144
ResultActions actions = mockMvc.perform(
145-
RestDocumentationRequestBuilders.delete("/auth/v1/logout")
146-
.header(HttpHeaders.AUTHORIZATION, AUTHORIZATION_HEADER_VALUE)
147-
.contentType(MediaType.APPLICATION_JSON)
145+
RestDocumentationRequestBuilders.delete("/auth/v1/logout")
146+
.header(HttpHeaders.AUTHORIZATION, AUTHORIZATION_HEADER_VALUE)
147+
.contentType(MediaType.APPLICATION_JSON)
148148
);
149149

150150
/* Then */
151151
actions.andDo(print())
152-
.andDo(document("auth/logout",
153-
preprocessRequest(prettyPrint()),
154-
preprocessResponse(prettyPrint()),
155-
responseFields(
156-
fieldWithPath("message").type(JsonFieldType.STRING).description("응답 메시지")
157-
)
158-
))
159-
.andExpect(status().isOk());
152+
.andDo(document("auth/logout",
153+
preprocessRequest(prettyPrint()),
154+
preprocessResponse(prettyPrint()),
155+
responseFields(
156+
fieldWithPath("message").type(JsonFieldType.STRING).description("응답 메시지")
157+
)
158+
))
159+
.andExpect(status().isOk());
160160
}
161161

162162
// Todo : 이거 정상 작동하지 않아서 리졸버가 동작한다. 이유를 알아보자.
163163
private void givenMockLoginMember() {
164164
given(authenticatedArgumentResolver.supportsParameter(any(MethodParameter.class)))
165-
.willReturn(true);
165+
.willReturn(true);
166166
given(authenticatedArgumentResolver.resolveArgument(
167-
any(MethodParameter.class),
168-
any(ModelAndViewContainer.class),
169-
any(NativeWebRequest.class),
170-
any(WebDataBinderFactory.class))
167+
any(MethodParameter.class),
168+
any(ModelAndViewContainer.class),
169+
any(NativeWebRequest.class),
170+
any(WebDataBinderFactory.class))
171171
).willReturn(any(AuthMember.class));
172172
}
173173
}

application/wypl-core/src/test/java/com/wypl/wyplcore/schedule/service/repetition/MonthRepetitionStrategyTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void getSchedulesResponsesForToday() {
4242

4343
// when
4444
List<ScheduleFindResponse> scheduleResponses = RepetitionService.getScheduleResponses(
45-
monthRepetitionSchedule, startDate, startDate);
45+
monthRepetitionSchedule, startDate, startDate);
4646

4747
// then
4848
logger.debug("조회 결과: {} 건", scheduleResponses.size());
@@ -63,7 +63,7 @@ void getSchedulesResponsesForMonth() {
6363

6464
// when
6565
List<ScheduleFindResponse> scheduleResponses = RepetitionService.getScheduleResponses(
66-
monthRepetitionSchedule, searchStartDate, searchEndDate);
66+
monthRepetitionSchedule, searchStartDate, searchEndDate);
6767

6868
// then
6969
assertEquals(1, scheduleResponses.size());
@@ -79,7 +79,7 @@ void getSchedulesResponsesForYear() {
7979

8080
// when
8181
List<ScheduleFindResponse> scheduleResponses = RepetitionService.getScheduleResponses(
82-
monthRepetitionSchedule, searchStartDate, searchEndDate);
82+
monthRepetitionSchedule, searchStartDate, searchEndDate);
8383

8484
// then
8585
assertEquals(3, scheduleResponses.size());
@@ -96,7 +96,7 @@ void getSchedulesResponsesForSpecial1() {
9696

9797
// when
9898
List<ScheduleFindResponse> scheduleResponses = RepetitionService.getScheduleResponses(
99-
monthRepetitionSchedule, searchStartDate, searchEndDate);
99+
monthRepetitionSchedule, searchStartDate, searchEndDate);
100100

101101
for (ScheduleFindResponse response : scheduleResponses) {
102102
logger.debug("할일 : {}, {} ~ {}", response.title(), response.startDateTime(), response.endDateTime());
@@ -118,7 +118,7 @@ void getSchedulesResponsesForSpecial2() {
118118

119119
// when
120120
List<ScheduleFindResponse> scheduleResponses = RepetitionService.getScheduleResponses(
121-
monthRepetitionSchedule, searchStartDate, searchEndDate);
121+
monthRepetitionSchedule, searchStartDate, searchEndDate);
122122

123123
for (ScheduleFindResponse response : scheduleResponses) {
124124
logger.debug("할일 : {}, {} ~ {}", response.title(), response.startDateTime(), response.endDateTime());

application/wypl-core/src/test/java/com/wypl/wyplcore/schedule/service/repetition/WeekRepetitionStrategyTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void getSchedulesResponsesForTodayWithDayOfWeek() {
9898
weekRepetitionScheduleWithDayOfWeek, startDate, startDate);
9999

100100
// then
101-
for (ScheduleFindResponse response : scheduleResponses){
101+
for (ScheduleFindResponse response : scheduleResponses) {
102102
logger.info("할일 : {}, {} ~ {}", response.title(), response.startDateTime(), response.endDateTime());
103103
}
104104
assertEquals(1, scheduleResponses.size());

application/wypl-core/src/test/java/com/wypl/wyplcore/schedule/service/repetition/YearRepetitionStrategyTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void getSchedulesResponsesForNoResult() {
4040
yearRepetitionSchedule, startDate, startDate);
4141

4242
// then
43-
for (ScheduleFindResponse response : scheduleResponses){
43+
for (ScheduleFindResponse response : scheduleResponses) {
4444
logger.info("할일 : {}, {} ~ {}", response.title(), response.startDateTime(), response.endDateTime());
4545
}
4646
assertEquals(0, scheduleResponses.size());
@@ -72,13 +72,12 @@ void getSchedulesResponsesForYear() {
7272
LocalDate endDate = startDate.plusYears(2);
7373
logger.info("searchStartDate : {} ~ searchEndDate : {}", startDate, endDate);
7474

75-
7675
// when
7776
List<ScheduleFindResponse> scheduleResponses = yearRepetitionStrategy.getScheduleResponses(
7877
yearRepetitionSchedule, startDate, endDate);
7978

8079
// then
81-
for (ScheduleFindResponse response : scheduleResponses){
80+
for (ScheduleFindResponse response : scheduleResponses) {
8281
logger.info("할일 : {}, {} ~ {}", response.title(), response.startDateTime(), response.endDateTime());
8382
}
8483
assertEquals(2, scheduleResponses.size());

application/wypl-image/src/main/java/com/wypl/wyplimage/controller/ImageController.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ public class ImageController {
2323

2424
@PostMapping("/v1/images")
2525
public WyplResponseEntity<UploadImageResponse> uploadImage(
26-
@RequestPart("image") final MultipartFile file
26+
@RequestPart("image") final MultipartFile file
2727
) {
2828
String savedImageUrl = imageService.saveImage(file);
2929
return WyplResponseEntity.created(new UploadImageResponse(savedImageUrl),
30-
"이미지 업로드가 정상적으로 처리되었습니다.");
30+
"이미지 업로드가 정상적으로 처리되었습니다.");
3131
}
3232

3333
@DeleteMapping("/v1/images")
3434
public WyplResponseEntity<Void> deleteImage(
35-
@RequestBody DeleteImageRequest request
35+
@RequestBody DeleteImageRequest request
3636
) {
3737
imageService.removeImages(request);
3838
return WyplResponseEntity.ok("사진 삭제가 정상적으로 처리되었습니다.");

application/wypl-image/src/main/java/com/wypl/wyplimage/data/DeleteImageRequest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.fasterxml.jackson.annotation.JsonProperty;
66

77
public record DeleteImageRequest(
8-
@JsonProperty("image_url_list")
9-
ArrayList<String> imageUrlList
8+
@JsonProperty("image_url_list")
9+
ArrayList<String> imageUrlList
1010
) {
1111
}

0 commit comments

Comments
 (0)