-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from DebbieIsFree/feature/airplane
Feature/airplane PR 하겠습니다.
- Loading branch information
Showing
21 changed files
with
509 additions
and
83 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/controller/HouseController.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.example.EnjoyTripBackend.controller; | ||
|
||
import com.example.EnjoyTripBackend.dto.NonPagingResponseResult; | ||
import com.example.EnjoyTripBackend.dto.ResponseResult; | ||
import com.example.EnjoyTripBackend.dto.house.HouseRequestDto; | ||
import com.example.EnjoyTripBackend.dto.house.HouseResponseDto; | ||
import com.example.EnjoyTripBackend.service.HouseService; | ||
import com.example.EnjoyTripBackend.util.argumentresolver.LimitedSizePagination; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.web.PageableDefault; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/api") | ||
@RequiredArgsConstructor | ||
public class HouseController { | ||
|
||
private final HouseService houseService; | ||
|
||
@GetMapping("/houses") | ||
public ResponseEntity<ResponseResult<List<HouseResponseDto>>> houseList(@PageableDefault(size = 20) Pageable pageable){ | ||
return ResponseEntity.ok().body(houseService.houseList(pageable)); | ||
} | ||
|
||
@GetMapping("/houses/{id}") | ||
public ResponseEntity<NonPagingResponseResult<HouseResponseDto>> houseDetail(@PathVariable("id")String id){ | ||
return ResponseEntity.ok().body(houseService.findById(id)); | ||
} | ||
|
||
@PostMapping("/houses/search") | ||
@LimitedSizePagination(maxSize = 20) | ||
public ResponseEntity<ResponseResult<List<HouseResponseDto>>> houseSearchList(@PageableDefault(size = 20) Pageable pageable, @RequestBody HouseRequestDto requestDto){ | ||
return ResponseEntity.ok().body(houseService.houseSearchList(pageable, requestDto)); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/domain/House.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.example.EnjoyTripBackend.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class House { | ||
private String addr1; | ||
private String addr2; | ||
private String areacode; | ||
private String contentid; | ||
private String firstimage; | ||
private String mapx; | ||
private String mapy; | ||
private String mlevel; | ||
private String tel; | ||
private String title; | ||
private String sigungucode; | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/airplane/AirplaneBody.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.EnjoyTripBackend.dto.airplane; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class AirplaneBody { | ||
private AirplaneItems items; | ||
} |
18 changes: 18 additions & 0 deletions
18
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/airplane/AirplaneDto.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example.EnjoyTripBackend.dto.airplane; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class AirplaneDto { | ||
|
||
private AirplaneResponse response; | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/airplane/AirplaneItem.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.EnjoyTripBackend.dto.airplane; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Builder | ||
@ToString | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class AirplaneItem { | ||
private String airlineNm; | ||
private String arrAirportNm; | ||
private String arrPlandTime; | ||
private String depAirportNm; | ||
private String depPlandTime; | ||
private String economyCharge; | ||
private String prestigeCharge; | ||
private String vihicleId; | ||
} |
18 changes: 18 additions & 0 deletions
18
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/airplane/AirplaneItems.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example.EnjoyTripBackend.dto.airplane; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class AirplaneItems { | ||
private List<AirplaneItem> item; | ||
} |
16 changes: 16 additions & 0 deletions
16
...TripBackend/src/main/java/com/example/EnjoyTripBackend/dto/airplane/AirplaneResponse.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.EnjoyTripBackend.dto.airplane; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class AirplaneResponse { | ||
private AirplaneBody body; | ||
} |
16 changes: 16 additions & 0 deletions
16
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/house/HouseBody.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.EnjoyTripBackend.dto.house; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class HouseBody { | ||
private HouseItems items; | ||
} |
18 changes: 18 additions & 0 deletions
18
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/house/HouseDto.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example.EnjoyTripBackend.dto.house; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class HouseDto { | ||
|
||
private HouseResponse response; | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/house/HouseItem.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.example.EnjoyTripBackend.dto.house; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Builder | ||
@ToString | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class HouseItem { | ||
private String addr1; | ||
private String addr2; | ||
private String areacode; | ||
private String benikia; | ||
private String cat1; | ||
private String cat2; | ||
private String cat3; | ||
private String contentid; | ||
private String contenttypeid; | ||
private String createdtime; | ||
private String firstimage; | ||
private String firstimage2; | ||
private String cpyrhtDivCd; | ||
private String goodstay; | ||
private String hanok; | ||
private String mapx; | ||
private String mapy; | ||
private String mlevel; | ||
private String modifiedtime; | ||
private String tel; | ||
private String title; | ||
private String booktour; | ||
private String sigungucode; | ||
} |
18 changes: 18 additions & 0 deletions
18
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/house/HouseItems.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example.EnjoyTripBackend.dto.house; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class HouseItems { | ||
private List<HouseItem> item; | ||
} |
10 changes: 10 additions & 0 deletions
10
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/house/HouseRequestDto.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.example.EnjoyTripBackend.dto.house; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class HouseRequestDto { | ||
private String areacode; | ||
} |
16 changes: 16 additions & 0 deletions
16
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/house/HouseResponse.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.EnjoyTripBackend.dto.house; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class HouseResponse { | ||
private HouseBody body; | ||
} |
22 changes: 22 additions & 0 deletions
22
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/dto/house/HouseResponseDto.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.example.EnjoyTripBackend.dto.house; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class HouseResponseDto { | ||
private Long id; | ||
private String addr1; | ||
private String addr2; | ||
private String areacode; | ||
private String contentid; | ||
private String firstimage; | ||
private String mapx; | ||
private String mapy; | ||
private String mlevel; | ||
private String tel; | ||
private String title; | ||
private String sigungucode; | ||
} |
18 changes: 18 additions & 0 deletions
18
EnjoyTripBackend/src/main/java/com/example/EnjoyTripBackend/repository/HouseRepository.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example.EnjoyTripBackend.repository; | ||
|
||
import com.example.EnjoyTripBackend.domain.House; | ||
import com.example.EnjoyTripBackend.dto.PageRequestList; | ||
import com.example.EnjoyTripBackend.dto.house.HouseResponseDto; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Mapper | ||
public interface HouseRepository { | ||
Long save(House house); | ||
List<HouseResponseDto> findAll(PageRequestList<?> requestList); | ||
Optional<HouseResponseDto> findById(String id); | ||
List<HouseResponseDto> findAllBySearch(PageRequestList<?> requestList); | ||
Long findTotalCount(); | ||
} |
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
Oops, something went wrong.