Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Dec 20, 2023
1 parent 9d1c7bd commit 09d6488
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
@AllArgsConstructor
public class SavePlanRequest {
private UUID groupId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "Asia/Seoul")

@JsonFormat(
shape = JsonFormat.Shape.STRING,
pattern = "yyyy-MM-dd HH:mm",
timezone = "Asia/Seoul")
private LocalDateTime planDay;

private PlaceDetails placeDetails;
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface PlanMapper {
@Mapping(target = "planMakerId", source = "plan.planMakerId")
@Mapping(target = "groupInfo", source = "groupInfoResponse")
@Mapping(target = "members", source = "memberResponses")
@Mapping(target = "planDay",source = "planDay")
@Mapping(target = "planDay", source = "planDay")
PlanInfoResponse toPlanInfoResponse(
Plan plan,
PlaceClientDetails placeDetails,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public PlanResponse savePlan(final SavePlanRequest request) {
Member member = authService.getMemberByJwt();
Group group = groupService.getGroupEntity(request.getGroupId());
Place place = placeService.getEntityByDetail(request.getPlaceDetails());
Plan plan = new Plan(member, place, group,request.getPlanDay());
Plan plan = new Plan(member, place, group, request.getPlanDay());

return planMapper.toPlanResponse(planRepository.save(plan));
}
Expand Down Expand Up @@ -109,7 +109,8 @@ private PlanInfoResponse getPlanInfoResponse(final Plan plan) {
String planDay = plan.getPlanDay().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
List<MemberResponse> memberResponse = toMemberResponse(plan);

return planMapper.toPlanInfoResponse(plan, placeDetails, planDay, groupInfo, memberResponse);
return planMapper.toPlanInfoResponse(
plan, placeDetails, planDay, groupInfo, memberResponse);
}

public void deletePlan(UUID id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void makeGroup() {

Place place = PlaceEntityFixture.FIRST_PLACE.toEntity();

Plan plan = new Plan(member1, place, group, LocalDateTime.of(2023,12,25,13,30));
Plan plan = new Plan(member1, place, group, LocalDateTime.of(2023, 12, 25, 13, 30));
plan.addMember(member2);

// when
Expand Down Expand Up @@ -87,7 +87,7 @@ void getPlan() {

Place place = PlaceEntityFixture.FIRST_PLACE.toEntity();

Plan plan = new Plan(member1, place, group,LocalDateTime.of(2023,12,25,13,30));
Plan plan = new Plan(member1, place, group, LocalDateTime.of(2023, 12, 25, 13, 30));
plan.addMember(member2);

// when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void savePlan() throws Exception {
toRequestBody(
new SavePlanRequest(
UUID.randomUUID(),
LocalDateTime.of(2023,12,25,15,30),
LocalDateTime.of(2023, 12, 25, 15, 30),
new PlaceDetails(
"카페 온마이마인드",
"https://place.map.kakao.com/1625295668",
Expand Down Expand Up @@ -210,7 +210,7 @@ void joinPlan() throws Exception {
toRequestBody(
new SavePlanRequest(
UUID.randomUUID(),
LocalDateTime.of(2023,12,25,13,30),
LocalDateTime.of(2023, 12, 25, 13, 30),
new PlaceDetails(
"이디야커피 안성죽산점",
"http://place.map.kakao.com/1562566188",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ void saveAndFindById() {
final Member member = memberRepository.save(MemberEntityFixture.LOGIN_MEMBER.toEntity());
final Plan plan =
PlanEntityFixture.FIRST_PLACE.toEntity(
member, GroupEntityFixture.BTS_GROUP.toEntity(member), LocalDateTime.of(2023,12,25,13,30));
member,
GroupEntityFixture.BTS_GROUP.toEntity(member),
LocalDateTime.of(2023, 12, 25, 13, 30));

// when
final UUID expected = planRepository.save(plan).getId();
Expand All @@ -59,7 +61,15 @@ void softDelete() {

final Group group = new Group("그룹", "http://abcdefg", member);

final UUID planId = planRepository.save(new Plan(member, place, group,LocalDateTime.of(2023,12,25,13,30))).getId();
final UUID planId =
planRepository
.save(
new Plan(
member,
place,
group,
LocalDateTime.of(2023, 12, 25, 13, 30)))
.getId();

// when
planRepository.deleteById(planId);
Expand Down Expand Up @@ -89,8 +99,16 @@ void findAllPlanByMember() {

final Group group = new Group("그룹", "http://abcdefg", member);

final Plan plan = planRepository.save(new Plan(member, firstPlace, group,LocalDateTime.of(2023,12,25,13,30)));
planRepository.save(new Plan(member, secondPlace, new Group("1", "2", member),LocalDateTime.of(2023,12,26,13,30)));
final Plan plan =
planRepository.save(
new Plan(
member, firstPlace, group, LocalDateTime.of(2023, 12, 25, 13, 30)));
planRepository.save(
new Plan(
member,
secondPlace,
new Group("1", "2", member),
LocalDateTime.of(2023, 12, 26, 13, 30)));
plan.addMember(firstMember);
plan.addMember(secondMember);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ void savePlan() {
final PlanResponse planResponse =
planService.savePlan(
new SavePlanRequest(
groupId, LocalDateTime.of(2023,12,25,15,30), PlaceDetailsFixture.FIRST_PLACE.toPlaceDetails()));
groupId,
LocalDateTime.of(2023, 12, 25, 15, 30),
PlaceDetailsFixture.FIRST_PLACE.toPlaceDetails()));

// then
final Optional<Plan> result = planRepository.findById(planResponse.getPlanId());
Expand All @@ -77,7 +79,7 @@ void joinPlan() {
member,
PlaceEntityFixture.FIRST_PLACE.toEntity(),
GroupEntityFixture.BTS_GROUP.toEntity(loginUser),
LocalDateTime.of(2023,12,25,15,30)));
LocalDateTime.of(2023, 12, 25, 15, 30)));
final UUID planId = plan.getId();

// when
Expand All @@ -94,7 +96,9 @@ void outPlan() {
// given
final Plan plan =
PlanEntityFixture.SECOND_PLACE.toEntity(
loginUser, GroupEntityFixture.HDJ_GROUP.toEntity(loginUser),LocalDateTime.of(2023,12,25,13,30));
loginUser,
GroupEntityFixture.HDJ_GROUP.toEntity(loginUser),
LocalDateTime.of(2023, 12, 25, 13, 30));
final UUID planId = planRepository.save(plan).getId();

// when
Expand All @@ -116,7 +120,7 @@ void getPlanById() {
loginUser,
PlaceEntityFixture.SECOND_PLACE.toEntity(),
GroupEntityFixture.HDJ_GROUP.toEntity(loginUser),
LocalDateTime.of(2023,12,25,15,30)))
LocalDateTime.of(2023, 12, 25, 15, 30)))
.getId();

// when
Expand All @@ -137,7 +141,7 @@ void deletePlan() {
loginUser,
PlaceEntityFixture.SECOND_PLACE.toEntity(),
GroupEntityFixture.HDJ_GROUP.toEntity(loginUser),
LocalDateTime.of(2023,12,25,15,30)))
LocalDateTime.of(2023, 12, 25, 15, 30)))
.getId();

// when
Expand Down

0 comments on commit 09d6488

Please sign in to comment.