forked from codesquad-members-2023/kiosk-max
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [BE] README 수정 (#34) * chore : 로컬 환경 세팅 h2 의존성추가 , mysql 연결 추가 * docs : README ERD 추가 * [BE] ci/cd 디렉토리 생성 (#40) * chore : 로컬 환경 세팅 h2 의존성추가 , mysql 연결 추가 * docs : README ERD 추가 * chore : ci/cd 환경 세팅 * [be] feat #54 : 상단바 카테고리 조회 api (#55) * [BE] 카테고리별 메뉴 조회 API 구현 (#65) * [BE] feat #63: Json 형식에 맞게 DTO 만들기 * [BE] feat #63: builder 어노테이션 추가 * [BE] feat #63: 카테고리별 메뉴 조회 Controller, Service, Repository 구현 * [BE] feat #66 메뉴담기 화면 조회 API (#67) * [BE] feat #66: dto 생성 * [BE] feat #66: 메뉴담기 화면 조회 controller 생성 * [BE] feat #66: 메뉴담기 화면 조회 repository 생 * [BE] feat #66: 메뉴담기 화면 조회 service 생 --------- Co-authored-by: he2joo <[email protected]> * [BE] 주문 api 구현 (#64) * [be] feat #59 : OrderRequestDto 생성 * [be] feat #59 : 도메인에 Builder 추가 * [be] feat #59 : Orders 테이블 Insert,날짜 비교 후 주문번호 초기화 구현 * [be] feat #59 : OrderMenu 테이블 INSERT , ORDER_MENU_OPTION 테이블 INSERT 구현 * [BE] feat #69: 영수증 조회 api 구현 (#70) * [BE] feat #59: 결제 API 구현 (#71) * [BE] feat #59: @NoArgsConstructor 어노테이션 추가 * [BE] feat #59: Controller 결제 API 구현 * [BE] feat #59: Service 결제 API 구현 * [BE] feat #59: Repository 결제 API 구현 * [BE] feat #59: 카드 결제 실패 (#74) Co-authored-by: he2joo <[email protected]> * feat #59: 현금결제 ResponseDto 생성 (#73) Co-authored-by: HeeJu Cho <[email protected]> * [BE] feat #59: 카드 결제 (#75) * [BE] feat #69: 영수증 조회 api 구현 * [BE] feat #59: 카드 결제 메서드 구현 * fix #59: merge 수정 (#76) * [BE] #59 결제/주문 api 구현 완료 (#77) * fix #59: 주문 insert 방식 수정 * fix #59: 주문번호 초기화 메서드 수정 * refactor #59: 결제 성공시 보내는 responseDto에 주문번호 추가 * refactor #59: dto 부분 수정 * refactor #59: 결제/주문 저장 api 완료 * [BE] #59 결제로직 수정 (#78) * refactor #59: 결제 response 통합 * refactor #59: 결제 성공시 orderId 반환하게 변경 * style #59: 결제 컨트롤러 메서드명 수정 * [BE] refactor #63: getPopularityRanking() 메서드 수정 (#86) 당일 판매량이 없을 경우 테이블 값이 아예 없어 오류가 발생. Optional을 사용하여 첫번째 값만 받아오고 null일 경우 menuId가 0이 되도록 하여 인기 스티커가 아무곳에도 붙지 않도록 수정. * [BE] feat #92: cors 추가 (#94) Co-authored-by: he2joo <[email protected]> * [Be] feat #92 : cors 메서드 추가 (#99) * [BE] refactor #92: WebConfig 수정 * [BE] refactor #92: OrderRepository sql문 수정 * [BE] refactor #69: 영수증 조회 api 리팩토링 (#100) * [BE] refactor #69: DB에서 orderNumber, name, quantity를 가져오는 DTO 구현 * [BE] refactor #69: 영수증 조회를 위해 orderNumber를 반환하도록 Repository, Service 리팩토링 --------- Co-authored-by: Jeongwisdom <[email protected]> Co-authored-by: HeeJu Cho <[email protected]> Co-authored-by: he2joo <[email protected]> Co-authored-by: sejeong00 <[email protected]>
- Loading branch information
1 parent
9b86c69
commit b7ff7da
Showing
22 changed files
with
649 additions
and
15 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
be/src/main/java/com/codesquad/kiosk/config/WebConfig.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.codesquad.kiosk.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.HttpMethod; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
public class WebConfig { | ||
@Bean | ||
public WebMvcConfigurer corsConfigurer() { | ||
return new WebMvcConfigurer() { | ||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/api/**").allowedOrigins("http://localhost:3000") | ||
.allowedMethods(HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.HEAD.name(), | ||
HttpMethod.PUT.name(), HttpMethod.DELETE.name(), HttpMethod.OPTIONS.name()); | ||
} | ||
}; | ||
} | ||
} |
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
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
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
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 |
---|---|---|
@@ -1,14 +1,20 @@ | ||
package com.codesquad.kiosk.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.sql.Timestamp; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class Order { | ||
Integer id; | ||
Integer orderNumber; | ||
Timestamp orderTime; | ||
String orderTime; | ||
|
||
@Builder | ||
public Order(Integer orderNumber, String orderTime) { | ||
this.orderNumber = orderNumber; | ||
this.orderTime = orderTime; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,13 +1,21 @@ | ||
package com.codesquad.kiosk.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Builder | ||
public class OrderMenu { | ||
Integer id; | ||
Integer orderId; | ||
Integer menuId; | ||
Integer quantity; | ||
|
||
@Builder | ||
public OrderMenu(Integer menuId, Integer quantity) { | ||
this.menuId = menuId; | ||
this.quantity = quantity; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
be/src/main/java/com/codesquad/kiosk/dto/CategoryResponseDto.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.codesquad.kiosk.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class CategoryResponseDto { | ||
String name; | ||
} |
19 changes: 19 additions & 0 deletions
19
be/src/main/java/com/codesquad/kiosk/dto/MenuDetailDto.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,19 @@ | ||
package com.codesquad.kiosk.dto; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
|
||
@Setter | ||
@Getter | ||
@NoArgsConstructor | ||
public class MenuDetailDto { | ||
|
||
private String name; | ||
private int price; | ||
private String img; | ||
private List<OptionCategoryDto> option; | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
be/src/main/java/com/codesquad/kiosk/dto/MenusByCategoryResponseDto.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.codesquad.kiosk.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class MenusByCategoryResponseDto { | ||
private String name; | ||
private Integer price; | ||
private Integer menuId; | ||
private String img; | ||
private boolean popular; | ||
|
||
public void setPopular() { | ||
popular = true; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
be/src/main/java/com/codesquad/kiosk/dto/OptionCategoryDto.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.codesquad.kiosk.dto; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
|
||
@Setter | ||
@Getter | ||
@NoArgsConstructor | ||
public class OptionCategoryDto { | ||
private String optionCategoryType; | ||
private int optionId; | ||
private String optionName; | ||
private int optionPrice; | ||
} |
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.codesquad.kiosk.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class OrderItem { | ||
private int menuId; | ||
|
||
private int quantity; | ||
|
||
private int[] option; | ||
} |
11 changes: 11 additions & 0 deletions
11
be/src/main/java/com/codesquad/kiosk/dto/OrderNumberCreatorDto.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,11 @@ | ||
package com.codesquad.kiosk.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class OrderNumberCreatorDto { | ||
private String date; | ||
private int orderNumber; | ||
} |
16 changes: 16 additions & 0 deletions
16
be/src/main/java/com/codesquad/kiosk/dto/OrderRequestDto.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.codesquad.kiosk.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class OrderRequestDto { | ||
|
||
private List<OrderItem> orderList; | ||
private int inputMoney; | ||
} |
15 changes: 15 additions & 0 deletions
15
be/src/main/java/com/codesquad/kiosk/dto/PaymentFailedDto.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,15 @@ | ||
package com.codesquad.kiosk.dto; | ||
|
||
import lombok.Getter; | ||
@Getter | ||
public class PaymentFailedDto { | ||
|
||
private boolean result; | ||
|
||
private String cause; | ||
|
||
public PaymentFailedDto(String cause) { | ||
this.result = false; | ||
this.cause = cause; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
be/src/main/java/com/codesquad/kiosk/dto/PaymentResponseDto.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,19 @@ | ||
package com.codesquad.kiosk.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder | ||
public class PaymentResponseDto { | ||
|
||
private boolean result; | ||
private int changes; | ||
private int totalPay; | ||
private int orderId; | ||
|
||
} |
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,13 @@ | ||
package com.codesquad.kiosk.dto; | ||
|
||
import java.util.List; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class ReceiptDto { | ||
final Integer orderNumber; | ||
final List<ReceiptItemDto> orderList; | ||
} |
11 changes: 11 additions & 0 deletions
11
be/src/main/java/com/codesquad/kiosk/dto/ReceiptItemDto.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,11 @@ | ||
package com.codesquad.kiosk.dto; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class ReceiptItemDto { | ||
final String name; | ||
final Integer quantity; | ||
} |
12 changes: 12 additions & 0 deletions
12
be/src/main/java/com/codesquad/kiosk/dto/ReceiptOrderNumberDto.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.codesquad.kiosk.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class ReceiptOrderNumberDto { | ||
final Integer orderNumber; | ||
final String name; | ||
final Integer quantity; | ||
} |
Oops, something went wrong.