Repository: Sparta-Team14/sparta-outsourcing-project
Pull request #5: feat: menu, category create 기능 추가
Author: login: friedSaewoo
Created: 2025-03-02T06:45:58Z | Merged: 2025-03-02T07:25:11Z

- 인증, 인가 로직 추가시 수정할 예정입니다


Diff:
diff --git a/src/main/java/com/example/jeogiyoproject/domain/foodstore/entity/FoodStore.java b/src/main/java/com/example/jeogiyoproject/domain/foodstore/entity/FoodStore.java
index de21948..9537720 100644
--- a/src/main/java/com/example/jeogiyoproject/domain/foodstore/entity/FoodStore.java
+++ b/src/main/java/com/example/jeogiyoproject/domain/foodstore/entity/FoodStore.java
@@ -1,6 +1,5 @@
 package com.example.jeogiyoproject.domain.foodstore.entity;
 
-import com.example.jeogiyoproject.domain.account.entity.Account;
 import com.example.jeogiyoproject.domain.base.BaseEntity;
 import jakarta.persistence.*;
 import lombok.Getter;
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/controller/MenuCategoryController.java b/src/main/java/com/example/jeogiyoproject/domain/menu/controller/MenuCategoryController.java
new file mode 100644
index 0000000..4f46141
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/controller/MenuCategoryController.java
@@ -0,0 +1,26 @@
+package com.example.jeogiyoproject.domain.menu.controller;
+
+import com.example.jeogiyoproject.domain.menu.dto.category.MenuCategoryRequestDto;
+import com.example.jeogiyoproject.domain.menu.dto.category.MenuCategoryResponseDto;
+import com.example.jeogiyoproject.domain.menu.service.MenuCategoryService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+public class MenuCategoryController {
+    private final MenuCategoryService menuCategoryService;
+
+//    @PostMapping("/foodstore/{id}/categories")
+//    private ResponseEntity<MenuCategoryResponseDto> createCategory(@RequestBody MenuCategoryRequestDto requestDto,
+//                                                                   @PathVariable(name = "id") Long foodstoreId){
+//        // AOP로 userRole 체크, userId 가져오는 로직 추가 예정
+//        Long userId = 1L;
+//        return new ResponseEntity<>(menuCategoryService.createCategory(userId,foodstoreId,requestDto.getName()),HttpStatus.CREATED);
+//    }
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/controller/MenuController.java b/src/main/java/com/example/jeogiyoproject/domain/menu/controller/MenuController.java
new file mode 100644
index 0000000..eb439d4
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/controller/MenuController.java
@@ -0,0 +1,27 @@
+package com.example.jeogiyoproject.domain.menu.controller;
+
+import com.example.jeogiyoproject.domain.menu.dto.menu.MenuRequestDto;
+import com.example.jeogiyoproject.domain.menu.dto.menu.MenuResponseDto;
+import com.example.jeogiyoproject.domain.menu.service.MenuService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+public class MenuController {
+    private final MenuService menuService;
+
+    @PostMapping("/menu-categories/{id}/menus")
+    private ResponseEntity<MenuResponseDto> createMenu(@RequestBody MenuRequestDto requestDto,
+                                                       @PathVariable(name = "id") Long categoryId){
+        // AOP로 userRole 체크, userId 가져오는 로직 추가 예정
+        Long userId = 1L;
+        return new ResponseEntity<>(menuService.createMenu(userId,categoryId, requestDto), HttpStatus.CREATED);
+    }
+
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/dto/category/MenuCategoryRequestDto.java b/src/main/java/com/example/jeogiyoproject/domain/menu/dto/category/MenuCategoryRequestDto.java
new file mode 100644
index 0000000..4be5655
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/dto/category/MenuCategoryRequestDto.java
@@ -0,0 +1,8 @@
+package com.example.jeogiyoproject.domain.menu.dto.category;
+
+import lombok.Getter;
+
+@Getter
+public class MenuCategoryRequestDto {
+    String name;
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/dto/category/MenuCategoryResponseDto.java b/src/main/java/com/example/jeogiyoproject/domain/menu/dto/category/MenuCategoryResponseDto.java
new file mode 100644
index 0000000..9dc0773
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/dto/category/MenuCategoryResponseDto.java
@@ -0,0 +1,31 @@
+package com.example.jeogiyoproject.domain.menu.dto.category;
+
+
+import com.example.jeogiyoproject.domain.menu.entity.MenuCategory;
+import lombok.Builder;
+import lombok.Getter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Builder
+public class MenuCategoryResponseDto {
+    private Long id;
+    private Long foodstoreId;
+    private String name;
+    private LocalDateTime createdAt;
+    private LocalDateTime updatedAt;
+    private LocalDateTime deletedAt;
+
+    public static MenuCategoryResponseDto fromEntity(MenuCategory category){
+        return MenuCategoryResponseDto.builder()
+                .id(category.getId())
+                .foodstoreId(category.getFoodStore().getId())
+                .name(category.getName())
+                .createdAt(category.getCreatedAt())
+                .updatedAt(category.getUpdatedAt())
+                .deletedAt(category.getDeletedAt())
+                .build();
+    }
+
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/dto/menu/MenuRequestDto.java b/src/main/java/com/example/jeogiyoproject/domain/menu/dto/menu/MenuRequestDto.java
new file mode 100644
index 0000000..014ca8f
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/dto/menu/MenuRequestDto.java
@@ -0,0 +1,10 @@
+package com.example.jeogiyoproject.domain.menu.dto.menu;
+
+import lombok.Getter;
+
+@Getter
+public class MenuRequestDto {
+    private String name;
+    private String info;
+    private Integer price;
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/dto/menu/MenuResponseDto.java b/src/main/java/com/example/jeogiyoproject/domain/menu/dto/menu/MenuResponseDto.java
new file mode 100644
index 0000000..1b067cf
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/dto/menu/MenuResponseDto.java
@@ -0,0 +1,35 @@
+package com.example.jeogiyoproject.domain.menu.dto.menu;
+
+import com.example.jeogiyoproject.domain.menu.dto.category.MenuCategoryResponseDto;
+import com.example.jeogiyoproject.domain.menu.entity.Menu;
+import com.example.jeogiyoproject.domain.menu.entity.MenuCategory;
+import lombok.Builder;
+import lombok.Getter;
+
+import java.time.LocalDateTime;
+
+@Getter
+@Builder
+public class MenuResponseDto {
+    private Long categoryId;
+    private Long menuId;
+    private String name;
+    private String info;
+    private Integer price;
+    private LocalDateTime createdAt;
+    private LocalDateTime updatedAt;
+    private LocalDateTime deletedAt;
+
+    public static MenuResponseDto fromEntity(Menu menu){
+        return MenuResponseDto.builder()
+                .categoryId(menu.getMenuCategory().getId())
+                .menuId(menu.getId())
+                .name(menu.getName())
+                .info(menu.getInfo())
+                .price(menu.getPrice())
+                .createdAt(menu.getCreatedAt())
+                .updatedAt(menu.getUpdatedAt())
+                .deletedAt(menu.getDeletedAt())
+                .build();
+    }
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/entity/Menu.java b/src/main/java/com/example/jeogiyoproject/domain/menu/entity/Menu.java
index a7f860b..86d5994 100644
--- a/src/main/java/com/example/jeogiyoproject/domain/menu/entity/Menu.java
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/entity/Menu.java
@@ -4,18 +4,37 @@
 import jakarta.persistence.*;
 import lombok.Getter;
 
+import java.time.LocalDateTime;
+
 @Getter
 @Entity
 @Table(name = "menu")
 public class Menu extends BaseEntity {
 
-    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private Long id; // 메뉴 번호
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @ManyToOne
+    @JoinColumn(name="menu_category_id")
+    private MenuCategory menuCategory;
 
-    @Column(length = 100)
-    private String name; // 메뉴명
-    @Column(length = 100)
-    private String Field; // 메뉴소개
     @Column
-    private Integer price; // 가격
+    private String name;
+
+    @Column
+    private String info;
+
+    @Column
+    private Integer price;
+
+    @Column
+    private LocalDateTime deletedAt;
+
+    public Menu(MenuCategory menuCategory, String name, String info, Integer price) {
+        this.menuCategory = menuCategory;
+        this.name = name;
+        this.info = info;
+        this.price = price;
+    }
 }
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/entity/MenuCategory.java b/src/main/java/com/example/jeogiyoproject/domain/menu/entity/MenuCategory.java
new file mode 100644
index 0000000..bc50b29
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/entity/MenuCategory.java
@@ -0,0 +1,40 @@
+package com.example.jeogiyoproject.domain.menu.entity;
+
+import com.example.jeogiyoproject.domain.base.BaseEntity;
+import com.example.jeogiyoproject.domain.foodstore.entity.FoodStore;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+
+@Getter
+@Entity
+@Table(name = "menu_category")
+@NoArgsConstructor
+public class MenuCategory extends BaseEntity {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @Column
+    private String name;
+
+    @ManyToOne
+    @JoinColumn(name = "foodstore_id")
+    private FoodStore foodStore;
+
+    @OneToMany(mappedBy = "menuCategory",cascade = CascadeType.ALL, orphanRemoval = true)
+    private List<Menu> menus = new ArrayList<>();
+
+    @Column
+    private LocalDateTime deletedAt;
+
+    public MenuCategory(String name, FoodStore foodStore) {
+        this.name = name;
+        this.foodStore = foodStore;
+    }
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/exception/NotOwnerException.java b/src/main/java/com/example/jeogiyoproject/domain/menu/exception/NotOwnerException.java
new file mode 100644
index 0000000..764b394
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/exception/NotOwnerException.java
@@ -0,0 +1,7 @@
+package com.example.jeogiyoproject.domain.menu.exception;
+
+public class NotOwnerException extends RuntimeException {
+    public NotOwnerException(String message) {
+        super(message);
+    }
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/repository/MenuCategoryRepository.java b/src/main/java/com/example/jeogiyoproject/domain/menu/repository/MenuCategoryRepository.java
new file mode 100644
index 0000000..7f80d66
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/repository/MenuCategoryRepository.java
@@ -0,0 +1,7 @@
+package com.example.jeogiyoproject.domain.menu.repository;
+
+import com.example.jeogiyoproject.domain.menu.entity.MenuCategory;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface MenuCategoryRepository extends JpaRepository<MenuCategory,Long> {
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/repository/MenuRepository.java b/src/main/java/com/example/jeogiyoproject/domain/menu/repository/MenuRepository.java
new file mode 100644
index 0000000..caca8d9
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/repository/MenuRepository.java
@@ -0,0 +1,7 @@
+package com.example.jeogiyoproject.domain.menu.repository;
+
+import com.example.jeogiyoproject.domain.menu.entity.Menu;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface MenuRepository extends JpaRepository<Menu,Long> {
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/sample.java b/src/main/java/com/example/jeogiyoproject/domain/menu/sample.java
deleted file mode 100644
index c5ba045..0000000
--- a/src/main/java/com/example/jeogiyoproject/domain/menu/sample.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.example.jeogiyoproject.domain.menu;
-
-public class sample {
-}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/service/MenuCategoryService.java b/src/main/java/com/example/jeogiyoproject/domain/menu/service/MenuCategoryService.java
new file mode 100644
index 0000000..493b9a0
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/service/MenuCategoryService.java
@@ -0,0 +1,33 @@
+package com.example.jeogiyoproject.domain.menu.service;
+
+import com.example.jeogiyoproject.domain.foodstore.entity.FoodStore;
+import com.example.jeogiyoproject.domain.menu.dto.category.MenuCategoryResponseDto;
+import com.example.jeogiyoproject.domain.menu.entity.MenuCategory;
+import com.example.jeogiyoproject.domain.menu.exception.NotOwnerException;
+import com.example.jeogiyoproject.domain.menu.repository.MenuCategoryRepository;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class MenuCategoryService {
+
+    private final MenuCategoryRepository menuCategoryRepository;
+
+//    public MenuCategoryResponseDto createCategory(Long userId, Long foodstoreId, String name) {
+//        // request의 foodstore를 조회하는 로직 (추후 db에서 조회하도록 변경)
+//        FoodStore store = new FoodStore(foodstoreId,"테스트 치킨집","호원동",10000,LocalDateTime.now(),LocalDateTime.now(),1L);
+//
+//        if(!store.getUserId().equals(userId)){
+//            throw new NotOwnerException("해당 가게의 사장만 접근 가능합니다.");
+//        }
+//        MenuCategory category = new MenuCategory(name, store);
+//        menuCategoryRepository.save(category);
+//        return MenuCategoryResponseDto.fromEntity(category);
+//    }
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menu/service/MenuService.java b/src/main/java/com/example/jeogiyoproject/domain/menu/service/MenuService.java
new file mode 100644
index 0000000..3a82f64
--- /dev/null
+++ b/src/main/java/com/example/jeogiyoproject/domain/menu/service/MenuService.java
@@ -0,0 +1,26 @@
+package com.example.jeogiyoproject.domain.menu.service;
+
+import com.example.jeogiyoproject.domain.menu.dto.menu.MenuRequestDto;
+import com.example.jeogiyoproject.domain.menu.dto.menu.MenuResponseDto;
+import com.example.jeogiyoproject.domain.menu.entity.Menu;
+import com.example.jeogiyoproject.domain.menu.entity.MenuCategory;
+import com.example.jeogiyoproject.domain.menu.repository.MenuCategoryRepository;
+import com.example.jeogiyoproject.domain.menu.repository.MenuRepository;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+@Service
+@RequiredArgsConstructor
+public class MenuService {
+    private final MenuRepository menuRepository;
+    private final MenuCategoryRepository categoryRepository;
+
+    public MenuResponseDto createMenu(Long userId, Long categoryId, MenuRequestDto requestDto) {
+        MenuCategory category = categoryRepository.findById(categoryId)
+                .orElseThrow(() -> new NullPointerException("해당 카테고리가 존재하지 않습니다."));
+        // category.getFoodStore().getUserId() 와 userId를 비교, 해당 가게의 사장인지 확인
+        Menu menu = new Menu(category,requestDto.getName(),requestDto.getInfo(),requestDto.getPrice());
+        menuRepository.save(menu);
+        return MenuResponseDto.fromEntity(menu);
+    }
+}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/menucategory/entity/MenuCategory.java b/src/main/java/com/example/jeogiyoproject/domain/menucategory/entity/MenuCategory.java
deleted file mode 100644
index 0e006a8..0000000
--- a/src/main/java/com/example/jeogiyoproject/domain/menucategory/entity/MenuCategory.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.example.jeogiyoproject.domain.menucategory.entity;
-
-import jakarta.persistence.*;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-
-@Getter
-@Entity
-@Table(name = "category")
-@NoArgsConstructor
-public class MenuCategory {
-
-    @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private Long id; // 카테고리 번호
-
-    @Column
-    private String name; // 카테고리 명
-}
diff --git a/src/main/java/com/example/jeogiyoproject/domain/order/entity/Order.java b/src/main/java/com/example/jeogiyoproject/domain/order/entity/Order.java
index 00933b1..e69bc7f 100644
--- a/src/main/java/com/example/jeogiyoproject/domain/order/entity/Order.java
+++ b/src/main/java/com/example/jeogiyoproject/domain/order/entity/Order.java
@@ -1,6 +1,6 @@
 package com.example.jeogiyoproject.domain.order.entity;
 
-import com.example.jeogiyoproject.domain.account.entity.Account;
+import com.example.jeogiyoproject.domain.user.entity.User;
 import com.example.jeogiyoproject.domain.base.BaseEntity;
 import com.example.jeogiyoproject.domain.foodstore.entity.FoodStore;
 import com.example.jeogiyoproject.domain.order.enums.Status;
@@ -30,7 +30,7 @@ public class Order extends BaseEntity {
 
     @ManyToOne(fetch = FetchType.LAZY)
     @JoinColumn(name = "user_id")
-    private Account user; // Account?
+    private User user; // Account?
 
     @Enumerated(EnumType.STRING)
     private Status status = Status.WAIT;
@@ -41,7 +41,7 @@ public class Order extends BaseEntity {
 
     private LocalDateTime deletedAt;
 
-    public Order(FoodStore foodStore, Account user, Integer totalPrice, String request) {
+    public Order(FoodStore foodStore, User user, Integer totalPrice, String request) {
         this.foodStore = foodStore;
         this.user = user;
         this.totalPrice = totalPrice;
diff --git a/src/main/java/com/example/jeogiyoproject/domain/order/service/OrderService.java b/src/main/java/com/example/jeogiyoproject/domain/order/service/OrderService.java
index 8d9a538..692e4d9 100644
--- a/src/main/java/com/example/jeogiyoproject/domain/order/service/OrderService.java
+++ b/src/main/java/com/example/jeogiyoproject/domain/order/service/OrderService.java
@@ -1,6 +1,6 @@
 package com.example.jeogiyoproject.domain.order.service;
 
-import com.example.jeogiyoproject.domain.account.entity.Account;
+import com.example.jeogiyoproject.domain.user.entity.User;
 import com.example.jeogiyoproject.domain.foodstore.entity.FoodStore;
 import com.example.jeogiyoproject.domain.foodstore.repository.FoodStoreRepository;
 import com.example.jeogiyoproject.domain.menu.entity.Menu;
@@ -43,7 +43,7 @@ public class OrderService {
     @Transactional
     public CreateOrderResponseDto createOrder(Long foodstoreId, CreateOrderRequestDto dto) {
         // TODO 유저 데이터 -> account?
-        Account user = new Account();
+        User user = new User();
 
         // e1: 존재하지 않는 가게 조회 시
         FoodStore foodStore = findFoodStore(foodstoreId);
@@ -94,7 +94,7 @@ public CreateOrderResponseDto createOrder(Long foodstoreId, CreateOrderRequestDt
     @Transactional(readOnly = true)
     public Page<FindOrdersResponseDto> findAllOrders(Long foodstoreId, int page, int size, FindOrdersRequestDto dto) {
         // TODO 유저 데이터
-        Account user = new Account();
+        User user = new User();
 
         // e1: 해당 가게의 사장이 아닌 경우
         validFoodstoreOwner(foodstoreId, user);
@@ -113,7 +113,7 @@ public Page<FindOrdersResponseDto> findAllOrders(Long foodstoreId, int page, int
     @Transactional(readOnly = true)
     public OrderResponseDto findOrder(Long foodstoreId, Long orderId) {
         // TODO 유저 데이터
-        Account user = new Account();
+        User user = new User();
 
         // e1: 해당 가게의 사장이 아닌 경우
         validFoodstoreOwner(foodstoreId, user);
@@ -129,7 +129,7 @@ public OrderResponseDto findOrder(Long foodstoreId, Long orderId) {
     @Transactional
     public String changeStatus(Long foodstoreId, Long orderId, ChangeStatusRequestDto dto) {
         // TODO 유저 데이터
-        Account user = new Account();
+        User user = new User();
 
         // e1: 해당 가게의 사장이 아닌 경우
         validFoodstoreOwner(foodstoreId, user);
@@ -178,7 +178,7 @@ private boolean isNotOperatingTime(LocalTime openAt, LocalTime closeAt) {
         return true;
     }
 
-    private void validFoodstoreOwner(Long foodstoreId, Account user) {
+    private void validFoodstoreOwner(Long foodstoreId, User user) {
         FoodStore foodStore = findFoodStore(foodstoreId);
         // TODO 해당 가게의 사장이 아닌 경우
         /*
diff --git a/src/main/java/com/example/jeogiyoproject/domain/account/entity/Account.java b/src/main/java/com/example/jeogiyoproject/domain/user/entity/User.java
similarity index 83%
rename from src/main/java/com/example/jeogiyoproject/domain/account/entity/Account.java
rename to src/main/java/com/example/jeogiyoproject/domain/user/entity/User.java
index 84cbfbe..d5a1e6f 100644
--- a/src/main/java/com/example/jeogiyoproject/domain/account/entity/Account.java
+++ b/src/main/java/com/example/jeogiyoproject/domain/user/entity/User.java
@@ -1,4 +1,4 @@
-package com.example.jeogiyoproject.domain.account.entity;
+package com.example.jeogiyoproject.domain.user.entity;
 
 import com.example.jeogiyoproject.domain.base.BaseEntity;
 import jakarta.persistence.*;
@@ -9,7 +9,7 @@
 @Entity
 @Table(name = "users")
 @NoArgsConstructor
-public class Account extends BaseEntity {
+public class User extends BaseEntity {
 
     @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Long id; // 회원번호
@@ -19,10 +19,9 @@ public class Account extends BaseEntity {
     @Column(length = 100, nullable = false)
     private String password; // 비밀번호
     @Column(length = 15, nullable = false)
-    private String userName; // 이름
+    private String name; // 이름
     @Column(columnDefinition = "TEXT", nullable = false)
     private String address; // 주소
     @Column(length = 5, nullable = false)
     private String role; // 역할
-
 }


Reviews:
user: login: G-LePiz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-02T07:02:28Z
user: login: daylikezero
body: * 코드 확인
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-02T07:02:42Z
user: login: friedSaewoo
body: 수정사항입니다.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-02T07:03:20Z

Review comments:
diff_hunk: @@ -0,0 +1,40 @@
+package com.example.jeogiyoproject.domain.menu.entity;
+
+import com.example.jeogiyoproject.domain.base.BaseEntity;
+import com.example.jeogiyoproject.domain.foodstore.entity.FoodStore;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+
+@Getter
+@Entity
+@Table(name = "menu_category")
+@NoArgsConstructor
+public class MenuCategory extends BaseEntity {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @Column
+    private String name;
+
+    @ManyToOne
+    @JoinColumn(name = "foodstore_id")
+    private FoodStore foodStore;
+
+    @OneToMany(mappedBy = "menuCategory",cascade = CascadeType.ALL, orphanRemoval = true)
path: src/main/java/com/example/jeogiyoproject/domain/menu/entity/MenuCategory.java
user: login: daylikezero
body: - Menu 엔티티 `@ManyToOne` 중복 -> OneToMany 삭제
created_at: 2025-03-02T06:58:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,26 @@
+package com.example.jeogiyoproject.domain.menu.controller;
+
+import com.example.jeogiyoproject.domain.menu.dto.category.MenuCategoryRequestDto;
+import com.example.jeogiyoproject.domain.menu.dto.category.MenuCategoryResponseDto;
+import com.example.jeogiyoproject.domain.menu.service.MenuCategoryService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequiredArgsConstructor
+public class MenuCategoryController {
+    private final MenuCategoryService menuCategoryService;
+
+//    @PostMapping("/foodstore/{id}/categories")
path: src/main/java/com/example/jeogiyoproject/domain/menu/controller/MenuCategoryController.java
user: login: G-LePiz
body: 주석 처리 잘하셨습니다!
created_at: 2025-03-02T07:02:28Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,40 @@
+package com.example.jeogiyoproject.domain.menu.entity;
+
+import com.example.jeogiyoproject.domain.base.BaseEntity;
+import com.example.jeogiyoproject.domain.foodstore.entity.FoodStore;
+import jakarta.persistence.*;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+
+@Getter
+@Entity
+@Table(name = "menu_category")
+@NoArgsConstructor
+public class MenuCategory extends BaseEntity {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    @Column
+    private String name;
+
+    @ManyToOne
+    @JoinColumn(name = "foodstore_id")
+    private FoodStore foodStore;
+
+    @OneToMany(mappedBy = "menuCategory",cascade = CascadeType.ALL, orphanRemoval = true)
path: src/main/java/com/example/jeogiyoproject/domain/menu/entity/MenuCategory.java
user: login: friedSaewoo
body: OneToMany 왠만하면 사용하지 않는 형태로 수정하겠습니다!
created_at: 2025-03-02T07:02:35Z
author_association: CONTRIBUTOR

PR comments:
user: login: G-LePiz
created_at: 2025-03-02T06:59:56Z
body: 테스트입니다.
author_association: MEMBER
user: login: ChungwonJ
created_at: 2025-03-02T07:00:10Z
body: 확인했습니다
author_association: CONTRIBUTOR
user: login: BUHA289
created_at: 2025-03-02T07:50:06Z
body: 빌더 메서드 배웠씁니다.
author_association: NONE