-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 메뉴 판매량 및 재고 기록 CRUD 작성 #26
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package net.skhu.tastyinventory_be.config; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
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 MvcConfigurer implements WebMvcConfigurer { | ||
@Value("${client.origins}") | ||
private String[] allowedOrigins; | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**") | ||
.allowedOrigins(allowedOrigins) | ||
.allowedMethods( | ||
HttpMethod.GET.name(), | ||
HttpMethod.HEAD.name(), | ||
HttpMethod.POST.name(), | ||
HttpMethod.PUT.name(), | ||
HttpMethod.DELETE.name()) | ||
.maxAge(3600) | ||
.allowCredentials(true); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 다시 주석 처리! cors 에러는 요청에 헤더를 추가하는 과정이라서 nginx랑 spring에서 cors 처리 이중으로 하면 충돌 남..ㅇㅇ 이거는 로컬에서 리액트랑 스프링 같이 테스트할 때만 써주세여
|
||
protected void setId(Long id) { | ||
this.id = id; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 어쩌다가 들어갔지요? id 값은 보통 한 번 생성되면 불변인데..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 id를 받아야했어서 생성했었긴 한데 수정해볼게여
@@ -26,9 +30,13 @@ public class Sold extends BaseEntity { | |||
private Long count; | |||
|
|||
@Builder | |||
public Sold(LocalDate date, Menu menu, Long count) { | |||
public Sold(Long id, LocalDate date, Menu menu, Long count) { | |||
this.setId(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기가 원인인듯? 생성자에 id 없어도 됩니당
@@ -20,6 +27,8 @@ public class SoldService { | |||
private final SoldRepository soldRepository; | |||
private final MenuRepository menuRepository; | |||
|
|||
private static final Logger logger = LoggerFactory.getLogger(SoldService.class); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그 확인은 그냥 간단하게 @Slf4j
쓰면 돼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 맞넹 감샤합니당
아 나도 그거땜에 사실 update부분이 좀 걸렸는데 잘 안돼서 이게 아닌가 싶어서 그냥 id받아서 update로 구현했거든. api는 일단 포스트맨에 있업!! |
🚩 관련 이슈
📋 구현 기능 명세
메뉴 판매량 등록
[메뉴 판매량 조회](https://www.notion.so/5d66a464bca747818e594d6daa9016b8?pvs=21)
[메뉴 판매량 수정](https://www.notion.so/ada80affc2774fe3b2d2b54e117b67b0?pvs=21)
[메뉴 판매량 삭제](https://www.notion.so/a43b628f7802484e99cd8813b83a4d23?pvs=21)
[실제 재고 기록](https://www.notion.so/96b178a0e98743af986d7aeda95f61b8?pvs=21)
[실제 재고 조회](https://www.notion.so/407898197dc341d49d38822343e698e6?pvs=21)
[실제 재고 수정](https://www.notion.so/60d30999796844e8a1635ffc2576ba03?pvs=21)
[실제 재고 삭제](https://www.notion.so/c568b8baad684f3f93145f51c95f2b6e?pvs=21)
📌 PR Point
무슨 이유로 어떻게 코드를 변경했는지
어떤 부분에 리뷰어가 집중해야 하는지
개발하면서 어떤 점이 궁금했는지
📸 결과물 스크린샷
ㄱ## 🚩 관련 이슈
📋 구현 기능 명세
메뉴 판매량 등록
[메뉴 판매량 조회](https://www.notion.so/5d66a464bca747818e594d6daa9016b8?pvs=21)
[메뉴 판매량 수정](https://www.notion.so/ada80affc2774fe3b2d2b54e117b67b0?pvs=21)
[메뉴 판매량 삭제](https://www.notion.so/a43b628f7802484e99cd8813b83a4d23?pvs=21)
[실제 재고 기록](https://www.notion.so/96b178a0e98743af986d7aeda95f61b8?pvs=21)
[실제 재고 조회](https://www.notion.so/407898197dc341d49d38822343e698e6?pvs=21)
[실제 재고 수정](https://www.notion.so/60d30999796844e8a1635ffc2576ba03?pvs=21)
[실제 재고 삭제](https://www.notion.so/c568b8baad684f3f93145f51c95f2b6e?pvs=21)
📌 PR Point
무슨 이유로 어떻게 코드를 변경했는지
어떤 부분에 리뷰어가 집중해야 하는지
개발하면서 어떤 점이 궁금했는지
📸 결과물 스크린샷
ㄱ![image](https://private-user-images.githubusercontent.com/128473266/340098568-c4bb2ddd-bc93-4dbc-b7f1-ad2fd9abb4fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTA0OTcsIm5iZiI6MTczOTAxMDE5NywicGF0aCI6Ii8xMjg0NzMyNjYvMzQwMDk4NTY4LWM0YmIyZGRkLWJjOTMtNGRiYy1iN2YxLWFkMmZkOWFiYjRmZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQxMDIzMTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mODdhMTEyZTkxZmJhZGNjNzgzOGIxNDNmYjQ3YzM4OWMyMDk3YTU3NzRkNjFiN2M0MGFmMWNiZGI4ZDdmOGRiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.WxsvqV-OxLUtnufQk-4C4Jiqn2V1tHJNxsAFYEcUdcs)
🛠️ 테스트
🚀 API Endpoint