Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

shinheekim
Copy link
Contributor

🚩 관련 이슈

  • close #

📋 구현 기능 명세

메뉴 판매량 등록

[메뉴 판매량 조회](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

  • 무슨 이유로 어떻게 코드를 변경했는지

  • 어떤 부분에 리뷰어가 집중해야 하는지

  • 개발하면서 어떤 점이 궁금했는지

📸 결과물 스크린샷

ㄱ## 🚩 관련 이슈

  • close #

📋 구현 기능 명세

메뉴 판매량 등록

[메뉴 판매량 조회](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

🛠️ 테스트

  • 테스트

🚀 API Endpoint

Copy link
Contributor

@djdongjae djdongjae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일단 cors 관련 코드 주석 처리 해주고 나머지는 나도 테스트를 안해봐서 모르겠는데 일단 돌아가면 머지하면 될 듯? 그리고 지금 피그마 보면 수정 부분도 저장처럼 여러 개의 재고랑 메뉴에 대한 요청을 하나하나 받는게 아니라 버튼 하나로 처리하고 있자나? 그러면 변경사항을 한 번에 다 전송하는 게 맞는데 지금은 하나하나 수정으로 받고 있어서 이 부분 은혜랑 얘기해 보거나 고쳐야 할 듯


Screenshot 2024-06-17 at 4 46 54 AM

Comment on lines +1 to +27
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);
}
}
Copy link
Contributor

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;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 어쩌다가 들어갔지요? id 값은 보통 한 번 생성되면 불변인데..?

Copy link
Contributor Author

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);
Copy link
Contributor

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);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그 확인은 그냥 간단하게 @Slf4j 쓰면 돼

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 맞넹 감샤합니당

@shinheekim
Copy link
Contributor Author

아 나도 그거땜에 사실 update부분이 좀 걸렸는데 잘 안돼서 이게 아닌가 싶어서 그냥 id받아서 update로 구현했거든. api는 일단 포스트맨에 있업!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants