Skip to content

Commit

Permalink
develop post list by location #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingadinga committed Aug 28, 2022
1 parent fce1014 commit 160d586
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 6 deletions.
42 changes: 40 additions & 2 deletions src/main/java/com/team20/t4/plan/domain/Gu.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,52 @@
@AllArgsConstructor
public enum Gu {

JONGRO("종로구");
JONGROGU("종로구"),
JUNGGU("중구"),
YONGSANGU("용산구"),
SEONGDONGGU("성동구"),
GWANGJINGU("광진구"),
DONGDAEMUNGU("동대문구"),
JUNGANGGU("중랑구"),
SEONGBUKGU("성북구"),
GANGBUKGU("강북구"),
DOBONGGU("도봉구"),
NOWONGU("노원구"),
EUNPYEONGGU("은평구"),
SEODAEMUNGU("서대문구"),
MAPOGU("마포구"),
YANGCHEONGU("양천구"),
GANGSEOGU("강서구"),
GUROGU("구로구"),
GEUMCHEONGU("금천구"),
YEONGDEUNGPOGU("영등포구"),
DONGJAKGU("동작구"),
GWANAKGU("관악구"),
SEOCHOGU("서초구"),
GANGNAMGU("강남구"),
SONGPAGU("송파구"),
GANGDONGGU("강동구");


@JsonValue
private String value;

/**
*
*종로구 중구 용산구 성동구 광진구 동대문구 중랑구 성북구 강북구 도봉구 노원구 은평구 서대문구 마포구 양천구 강서구 구로구 금천구 영등포구 동작구 관악구 서초구 강남구 송파구 강동구
*종로구
* 중구
* 용산구
* 성동구
* 광진구
* 동대문구
* 중랑구
* 성북구
* 강북구
* 도봉구
* 노원구
* 은평구
* 서대문구
* 마포구 양천구 강서구 구로구 금천구 영등포구 동작구 관악구 서초구 강남구 송파구 강동구
* */

@JsonCreator
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/team20/t4/post/PostController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.team20.t4.plan.PlanService;
import com.team20.t4.plan.domain.Location;
import com.team20.t4.plan.dto.ListAppointmentSimpleResponseDto;
import com.team20.t4.post.dto.LocationRequestDto;
import com.team20.t4.post.dto.PostResponseDto;
import com.team20.t4.post.dto.PostSaveRequestDto;
import com.team20.t4.post.dto.PostUpdateRequestDto;
Expand All @@ -28,10 +29,9 @@ public Long saveNewPost(@RequestBody @Valid PostSaveRequestDto requestDto){
}

@GetMapping("/post/location")
public ListAppointmentSimpleResponseDto getPostListByLocation(@RequestBody Location location){
log.info(location.toString());
log.info(location.getGu().getValue());
return postService.getPostListByLocation(location);
public ListAppointmentSimpleResponseDto getPostListByLocation(@RequestBody LocationRequestDto location){
Location gotLocation = location.getLocation();
return postService.getPostListByLocation(gotLocation);
}

@GetMapping("/post/{postId}")
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/team20/t4/post/dto/LocationRequestDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.team20.t4.post.dto;

import com.team20.t4.plan.domain.Location;
import lombok.Getter;

@Getter
public class LocationRequestDto {
private Location location;
}

0 comments on commit 160d586

Please sign in to comment.