Closed 9oj0e closed 2 months ago
@Data // 매장 메뉴 목록보기 public static class MenuListDTO { // 매장 정보 private int storeId; private String storeName; // 메뉴 정보 private List<MenuDTO> menuList; public MenuListDTO(Store store, List<Menu> menus) { this.storeId = store.getId(); this.storeName = store.getName(); this.menuList = menus.stream().map(MenuDTO::new).toList(); } @Data private class MenuDTO { private int id; private String category; private String name; private String imgFilename; private String description; private int price; public MenuDTO(Menu menu) { this.id = menu.getId(); this.category = menu.getCategory(); this.name = menu.getName(); this.imgFilename = menu.getImgFilename(); this.description = menu.getDescription(); this.price = menu.getPrice(); } } }
업데이트
구조 변경
설명
기타
리펙토링 (과정)
리펙토링 (코드)
문제가 될 수 있는 코드