Skip to content

#1 feat: 재료 등록(Create) 기능 구현#6

Merged
yunjaeeun merged 1 commit intodevelopfrom
hongbeom
Dec 10, 2024
Merged

#1 feat: 재료 등록(Create) 기능 구현#6
yunjaeeun merged 1 commit intodevelopfrom
hongbeom

Conversation

@KIM9909
Copy link
Copy Markdown
Contributor

@KIM9909 KIM9909 commented Dec 10, 2024

** 변수명 대소문자 통일해주었습니다.

  1. dto 파일을 만들고 IngredientCreateRequest 클래스를 만들어 재료 등록시 필요한 컬럼명을 설정 해주었습니다.
package moja.refrigerator.dto.ingredient.request;

import lombok.Data;

@Data
public class IngredientCreateRequest {
    private String ingredientName;
    private String expirationDate;
    private String registrationDate;
    private int seasonDate;

//    private int ingredientCategoryPk;
//    private int ingredientStoragePk;
}
  1. repository : 추후 카테고리와 보관방법을 위한 repository 인터페이스를 만들어 주었습니다.
    image

  2. controller : PostMapping 어노테이션으로 API 진입지점을 만들어 주었습니다.

@RestController
@RequestMapping("/ingredient")
public class IngredientController {
    private IngredientService ingredientService;

    @Autowired
    public IngredientController(IngredientService ingredientService) {
        this.ingredientService = ingredientService;
    }

    @PostMapping
    public void createIngredient(@RequestBody IngredientCreateRequest request) {
        ingredientService.createIngredient(request);
    }
}
  1. service : ModelMapper와 Tranctional을 사용하여 재료 등록 service를 작성하였습니다.
    -> 주석 처리된 부분은 추후 사용될 가능성이 있어 지우지 않았습니다 !
    -> 코드 리뷰 하시면서 한번 씩 확인 부탁드립니다 !

Copy link
Copy Markdown
Contributor

@MinFe4990 MinFe4990 left a comment

Choose a reason for hiding this comment

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

check!!
우측 상단에 reviewers 눌러서 추가해줘야하고,
이슈 #1 가 음습니다.

Copy link
Copy Markdown
Contributor

@LeeGukgeon LeeGukgeon left a comment

Choose a reason for hiding this comment

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

재료 create 를 위한 aggregate, controller, dto, repository, service 를 잘 구현한 것 같습니다

Copy link
Copy Markdown
Contributor

@kingkang85 kingkang85 left a comment

Choose a reason for hiding this comment

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

오 패키지 분리가 잘 되어있는 것 같습니다.

Copy link
Copy Markdown
Contributor

@uni-zun uni-zun left a comment

Choose a reason for hiding this comment

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

계층구조가 잘 분리되었네요 ! @DaTa 쓴거 좋습니다

@KIM9909 KIM9909 changed the title feat: 재료 등록(Create) 기능 구현 #1. feat: 재료 등록(Create) 기능 구현 Dec 10, 2024
@KIM9909 KIM9909 changed the title #1. feat: 재료 등록(Create) 기능 구현 #1 feat: 재료 등록(Create) 기능 구현 Dec 10, 2024
@yunjaeeun
Copy link
Copy Markdown
Contributor

실수 바로 잡아준거 좋습니다 :)

@yunjaeeun yunjaeeun merged commit 2f45418 into develop Dec 10, 2024
yunjaeeun added a commit that referenced this pull request Dec 13, 2024
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.

6 participants