-
Notifications
You must be signed in to change notification settings - Fork 0
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 #183 from CoolPeace-yanolza/develop
01-24 오후 배포(데이터 초기화)
- Loading branch information
Showing
24 changed files
with
726 additions
and
80 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/main/java/com/coolpeace/domain/accommodation/repository/SidoRepository.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,8 @@ | ||
package com.coolpeace.domain.accommodation.repository; | ||
|
||
import com.coolpeace.domain.accommodation.entity.Sido; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface SidoRepository extends JpaRepository<Sido, Integer> { | ||
|
||
} |
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
56 changes: 56 additions & 0 deletions
56
src/main/java/com/coolpeace/domain/data/controller/GenerateDataController.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,56 @@ | ||
package com.coolpeace.domain.data.controller; | ||
|
||
import com.coolpeace.domain.data.dto.request.GenerateAccommodationRequest; | ||
import com.coolpeace.domain.data.dto.request.GenerateCouponRequest; | ||
import com.coolpeace.domain.data.dto.request.GenerateReservationRequest; | ||
import com.coolpeace.domain.data.dto.request.GenerateSettlementRequset; | ||
import com.coolpeace.domain.data.service.GenerateDataService; | ||
import jakarta.persistence.criteria.CriteriaBuilder.In; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequiredArgsConstructor | ||
@RequestMapping("/v1/data") | ||
public class GenerateDataController { | ||
|
||
|
||
private final GenerateDataService generateDataService; | ||
|
||
@PostMapping("/accommodation") | ||
public ResponseEntity<Integer> generateAccommodation( | ||
@RequestBody GenerateAccommodationRequest req | ||
){ | ||
return ResponseEntity.ok(generateDataService.generateAccommodation(req)); | ||
|
||
} | ||
|
||
|
||
@PostMapping("/coupon") | ||
public ResponseEntity<Integer> generateCoupon( | ||
@RequestBody GenerateCouponRequest req | ||
){ | ||
return ResponseEntity.ok(generateDataService.generateCoupon(req)); | ||
} | ||
|
||
|
||
@PostMapping("/reservation") | ||
public ResponseEntity<Integer> generateReservation( | ||
@RequestBody GenerateReservationRequest req | ||
){ | ||
return ResponseEntity.ok(generateDataService.generateReservation(req)); | ||
} | ||
|
||
@PostMapping("/settlement") | ||
public ResponseEntity<Integer> generateSettlement( | ||
@RequestBody GenerateSettlementRequset req | ||
){ | ||
return ResponseEntity.ok(generateDataService.generateSettlemnet(req)); | ||
} | ||
|
||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/coolpeace/domain/data/dto/request/GenerateAccommodationRequest.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,9 @@ | ||
package com.coolpeace.domain.data.dto.request; | ||
|
||
public record GenerateAccommodationRequest( | ||
|
||
Integer count, | ||
Long member | ||
){ | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/coolpeace/domain/data/dto/request/GenerateCouponRequest.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,14 @@ | ||
package com.coolpeace.domain.data.dto.request; | ||
|
||
public record GenerateCouponRequest ( | ||
|
||
Long member, | ||
Long accommodation, | ||
Integer count | ||
|
||
|
||
){ | ||
|
||
|
||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/coolpeace/domain/data/dto/request/GenerateReservationRequest.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,9 @@ | ||
package com.coolpeace.domain.data.dto.request; | ||
|
||
public record GenerateReservationRequest ( | ||
int count | ||
){ | ||
|
||
|
||
|
||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/coolpeace/domain/data/dto/request/GenerateSettlementRequset.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,12 @@ | ||
package com.coolpeace.domain.data.dto.request; | ||
|
||
import java.time.LocalDate; | ||
|
||
public record GenerateSettlementRequset ( | ||
LocalDate start, | ||
LocalDate end | ||
){ | ||
|
||
|
||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/coolpeace/domain/data/dto/request/SettlementStatistic.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.coolpeace.domain.data.dto.request; | ||
|
||
import java.time.LocalDate; | ||
|
||
public interface SettlementStatistic { | ||
|
||
Long getCouponId(); | ||
|
||
Long getAccommodationId(); | ||
|
||
LocalDate getCouponUseDate(); | ||
|
||
LocalDate getCompleteAt(); | ||
|
||
Integer getCount(); | ||
|
||
Integer getCancelPrice(); | ||
|
||
Integer getDiscountPrice(); | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/coolpeace/domain/data/repository/GenerateAccommodationRepository.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,8 @@ | ||
package com.coolpeace.domain.data.repository; | ||
|
||
import com.coolpeace.domain.accommodation.entity.Accommodation; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface GenerateAccommodationRepository extends JpaRepository<Accommodation, Long> { | ||
|
||
} |
Oops, something went wrong.