From 5f3a11386c4219ef76e2706a7eec6704fb5ca348 Mon Sep 17 00:00:00 2001 From: hskoo Date: Wed, 17 Nov 2021 21:10:47 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20E7-S3=20uid=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20#99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 태희님과 협의하에 uid는 주석 처리하고, 목표한 기간 이후에 추가하기로 하였습니다. --- .../category/controller/dto/CategoryDto.java | 8 ++-- .../dto/CategorySaveRequestDto.java | 8 ++-- .../ciat/category/controller/dto/MenuDto.java | 8 ++-- .../controller/dto/MenuSaveRequestDto.java | 8 ++-- .../infp/ciat/category/entity/Category.java | 8 ++-- .../com/infp/ciat/category/entity/Menu.java | 8 ++-- .../category/service/CategoryServiceImpl.java | 2 +- .../ciat/category/service/MenuService.java | 2 +- .../category/service/CategoryServiceTest.java | 20 +++++----- .../category/service/MenuServiceTest.java | 40 +++++++++---------- 10 files changed, 56 insertions(+), 56 deletions(-) diff --git a/backend/src/main/java/com/infp/ciat/category/controller/dto/CategoryDto.java b/backend/src/main/java/com/infp/ciat/category/controller/dto/CategoryDto.java index 8d90ef2..0a620cb 100644 --- a/backend/src/main/java/com/infp/ciat/category/controller/dto/CategoryDto.java +++ b/backend/src/main/java/com/infp/ciat/category/controller/dto/CategoryDto.java @@ -13,7 +13,7 @@ public class CategoryDto { private Long id; - private String uid; +// private String uid; private String name; private String icon; private String url; @@ -25,7 +25,7 @@ public class CategoryDto { public CategoryDto(Category category) { this.id = category.getId(); - this.uid = category.getUid(); +// this.uid = category.getUid(); this.name = category.getName(); this.icon = category.getIcon(); this.url = category.getUrl(); @@ -37,9 +37,9 @@ public CategoryDto(Category category) { } @Builder - public CategoryDto(Long id, String uid, String name, String icon, String url, Long orders, String showYn, Menu menu, Account account, Account updater) { + public CategoryDto(Long id,/* String uid,*/ String name, String icon, String url, Long orders, String showYn, Menu menu, Account account, Account updater) { this.id = id; - this.uid = uid; +// this.uid = uid; this.name = name; this.icon = icon; this.url = url; diff --git a/backend/src/main/java/com/infp/ciat/category/controller/dto/CategorySaveRequestDto.java b/backend/src/main/java/com/infp/ciat/category/controller/dto/CategorySaveRequestDto.java index 5ff3090..187443c 100644 --- a/backend/src/main/java/com/infp/ciat/category/controller/dto/CategorySaveRequestDto.java +++ b/backend/src/main/java/com/infp/ciat/category/controller/dto/CategorySaveRequestDto.java @@ -11,7 +11,7 @@ @Getter public class CategorySaveRequestDto { - private String uid; +// private String uid; private String name; private String icon; private String url; @@ -20,8 +20,8 @@ public class CategorySaveRequestDto { private Account account; @Builder - public CategorySaveRequestDto(String uid, String name, String icon, String url, Long orders, String showYn, Menu menu, Account account) { - this.uid = uid; + public CategorySaveRequestDto(/*String uid, */String name, String icon, String url, Long orders, String showYn, Menu menu, Account account) { +// this.uid = uid; this.name = name; this.icon = icon; this.url = url; @@ -32,7 +32,7 @@ public CategorySaveRequestDto(String uid, String name, String icon, String url, public Category toEntity() { return Category.builder() - .uid(uid) +// .uid(uid) .name(name) .icon(icon) .url(url) diff --git a/backend/src/main/java/com/infp/ciat/category/controller/dto/MenuDto.java b/backend/src/main/java/com/infp/ciat/category/controller/dto/MenuDto.java index a118592..4c8fee3 100644 --- a/backend/src/main/java/com/infp/ciat/category/controller/dto/MenuDto.java +++ b/backend/src/main/java/com/infp/ciat/category/controller/dto/MenuDto.java @@ -14,7 +14,7 @@ public class MenuDto { private Long id; - private String uid; +// private String uid; private String name; private String icon; private String url; @@ -26,7 +26,7 @@ public class MenuDto { public MenuDto(Menu menu) { this.id = menu.getId(); - this.uid = menu.getUid(); +// this.uid = menu.getUid(); this.name = menu.getName(); this.icon = menu.getIcon(); this.url = menu.getUrl(); @@ -38,9 +38,9 @@ public MenuDto(Menu menu) { } @Builder - public MenuDto(Long id, String uid, String name, String icon, String url, Long orders, String showYn, List categoryList, Account account, Account updater) { + public MenuDto(Long id,/* String uid,*/ String name, String icon, String url, Long orders, String showYn, List categoryList, Account account, Account updater) { this.id = id; - this.uid = uid; +// this.uid = uid; this.name = name; this.icon = icon; this.url = url; diff --git a/backend/src/main/java/com/infp/ciat/category/controller/dto/MenuSaveRequestDto.java b/backend/src/main/java/com/infp/ciat/category/controller/dto/MenuSaveRequestDto.java index fec099e..f88f1c9 100644 --- a/backend/src/main/java/com/infp/ciat/category/controller/dto/MenuSaveRequestDto.java +++ b/backend/src/main/java/com/infp/ciat/category/controller/dto/MenuSaveRequestDto.java @@ -11,7 +11,7 @@ @Getter public class MenuSaveRequestDto { - private String uid; +// private String uid; private String name; private String icon; private String url; @@ -20,8 +20,8 @@ public class MenuSaveRequestDto { private Account account; @Builder - public MenuSaveRequestDto(String uid, String name, String icon, String url, Long orders, String showYn, Account account) { - this.uid = uid; + public MenuSaveRequestDto(/*String uid,*/String name, String icon, String url, Long orders, String showYn, Account account) { +// this.uid = uid; this.name = name; this.icon = icon; this.url = url; @@ -32,7 +32,7 @@ public MenuSaveRequestDto(String uid, String name, String icon, String url, Long public Menu toEntity() { return Menu.builder() - .uid(uid) +// .uid(uid) .name(name) .icon(icon) .url(url) diff --git a/backend/src/main/java/com/infp/ciat/category/entity/Category.java b/backend/src/main/java/com/infp/ciat/category/entity/Category.java index 3112bfd..77d0f91 100644 --- a/backend/src/main/java/com/infp/ciat/category/entity/Category.java +++ b/backend/src/main/java/com/infp/ciat/category/entity/Category.java @@ -20,7 +20,7 @@ public class Category extends BaseTimeEntity { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - private String uid; +// private String uid; private String name; @@ -47,8 +47,8 @@ public class Category extends BaseTimeEntity { private Account updater; // 최근에 업데이트한 사용자 @Builder - public Category(String uid, String name, String icon, String url, Long orders, String showYn, Menu menu, Account account, Account updater) { - this.uid = uid; + public Category(/*String uid, */String name, String icon, String url, Long orders, String showYn, Menu menu, Account account, Account updater) { +// this.uid = uid; this.name = name; this.icon = icon; this.url = url; @@ -62,7 +62,7 @@ public Category(String uid, String name, String icon, String url, Long orders, S public CategoryDto fromEntity() { return CategoryDto.builder() .id(id) - .uid(uid) +// .uid(uid) .name(name) .icon(icon) .url(url) diff --git a/backend/src/main/java/com/infp/ciat/category/entity/Menu.java b/backend/src/main/java/com/infp/ciat/category/entity/Menu.java index 7d66814..2ffaa37 100644 --- a/backend/src/main/java/com/infp/ciat/category/entity/Menu.java +++ b/backend/src/main/java/com/infp/ciat/category/entity/Menu.java @@ -25,7 +25,7 @@ public class Menu extends BaseTimeEntity { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - private String uid; +// private String uid; private String name; @@ -57,8 +57,8 @@ public class Menu extends BaseTimeEntity { private Account updater; @Builder - public Menu(String uid, String name, String icon, String url, Long orders, String showYn, Account account) { - this.uid = uid; + public Menu(/*String uid, */String name, String icon, String url, Long orders, String showYn, Account account) { +// this.uid = uid; this.name = name; this.icon = icon; this.url = url; @@ -70,7 +70,7 @@ public Menu(String uid, String name, String icon, String url, Long orders, Strin public MenuDto fromEntity() { return MenuDto.builder() .id(id) - .uid(uid) +// .uid(uid) .name(name) .icon(icon) .url(url) diff --git a/backend/src/main/java/com/infp/ciat/category/service/CategoryServiceImpl.java b/backend/src/main/java/com/infp/ciat/category/service/CategoryServiceImpl.java index a0c0f2b..6c296c1 100644 --- a/backend/src/main/java/com/infp/ciat/category/service/CategoryServiceImpl.java +++ b/backend/src/main/java/com/infp/ciat/category/service/CategoryServiceImpl.java @@ -33,7 +33,7 @@ public List getList() { .stream() .map(c -> CategoryDto.builder() .id(c.getId()) - .uid(c.getUid()) +// .uid(c.getUid()) .name(c.getName()) .icon(c.getIcon()) .url(c.getUrl()) diff --git a/backend/src/main/java/com/infp/ciat/category/service/MenuService.java b/backend/src/main/java/com/infp/ciat/category/service/MenuService.java index 349b315..1d0359f 100644 --- a/backend/src/main/java/com/infp/ciat/category/service/MenuService.java +++ b/backend/src/main/java/com/infp/ciat/category/service/MenuService.java @@ -36,7 +36,7 @@ public List getList() { .stream() .map(m -> MenuDto.builder() .id(m.getId()) - .uid(m.getUid()) +// .uid(m.getUid()) .name(m.getName()) .icon(m.getIcon()) .url(m.getUrl()) diff --git a/backend/src/test/java/com/infp/ciat/category/service/CategoryServiceTest.java b/backend/src/test/java/com/infp/ciat/category/service/CategoryServiceTest.java index 040cca3..547c90e 100644 --- a/backend/src/test/java/com/infp/ciat/category/service/CategoryServiceTest.java +++ b/backend/src/test/java/com/infp/ciat/category/service/CategoryServiceTest.java @@ -34,7 +34,7 @@ class CategoryServiceTest { @BeforeEach void createMenu() { MenuSaveRequestDto menuSaveRequestDto = MenuSaveRequestDto.builder() - .uid("M001") +// .uid("M001") .name("test menu") .icon("test") .url("https://www.naver.com") @@ -61,7 +61,7 @@ public void createCategory() { Menu menu = menuRepository.findAll().get(0); CategorySaveRequestDto requestDto = CategorySaveRequestDto.builder() - .uid(uid) +// .uid(uid) .name(name) .icon(icon) .url(url) @@ -75,7 +75,7 @@ public void createCategory() { // then List all = categoryRepository.findAll(); - assertThat(all.get(0).getUid()).isEqualTo(uid); +// assertThat(all.get(0).getUid()).isEqualTo(uid); assertThat(all.get(0).getName()).isEqualTo(name); assertThat(all.get(0).getIcon()).isEqualTo(icon); assertThat(all.get(0).getUrl()).isEqualTo(url); @@ -88,7 +88,7 @@ public void createCategory() { public void getCategoryList() { // given CategorySaveRequestDto requestDto = CategorySaveRequestDto.builder() - .uid("M001C001") +// .uid("M001C001") .name("테스트1") .icon("test") .url("/test") @@ -96,7 +96,7 @@ public void getCategoryList() { .menu(menuRepository.findAll().get(0)) .build(); CategorySaveRequestDto requestDto2 = CategorySaveRequestDto.builder() - .uid("M001C002") +// .uid("M001C002") .name("테스트2") .icon("test2") .url("/test2") @@ -127,7 +127,7 @@ public void getOneCategory() { Menu menu = menuRepository.findAll().get(0); Category savedCat = categoryRepository.save(Category.builder() - .uid(uid) +// .uid(uid) .name(name) .icon(icon) .url(url) @@ -140,7 +140,7 @@ public void getOneCategory() { CategoryDto detail = categoryService.getDetail(savedCat.getId()); // then - assertThat(detail.getUid()).isEqualTo(uid); +// assertThat(detail.getUid()).isEqualTo(uid); assertThat(detail.getName()).isEqualTo(name); assertThat(detail.getIcon()).isEqualTo(icon); assertThat(detail.getUrl()).isEqualTo(url); @@ -153,7 +153,7 @@ public void getOneCategory() { public void updateCategory() { // given Category savedCat = categoryRepository.save(Category.builder() - .uid("M001C001") +// .uid("M001C001") .name("테스트1") .icon("test") .url("/test") @@ -184,7 +184,7 @@ public void updateCategory() { public void deleteCategory() { // given Category savedCat1 = categoryRepository.save(Category.builder() - .uid("M001C001") +// .uid("M001C001") .name("테스트1") .icon("test") .url("/test") @@ -193,7 +193,7 @@ public void deleteCategory() { .menu(menuRepository.findAll().get(0)) .build()); Category savedCat2 = categoryRepository.save(Category.builder() - .uid("M001C002") +// .uid("M001C002") .name("테스트2") .icon("test2") .url("/test2") diff --git a/backend/src/test/java/com/infp/ciat/category/service/MenuServiceTest.java b/backend/src/test/java/com/infp/ciat/category/service/MenuServiceTest.java index 69e9608..69a9f1f 100644 --- a/backend/src/test/java/com/infp/ciat/category/service/MenuServiceTest.java +++ b/backend/src/test/java/com/infp/ciat/category/service/MenuServiceTest.java @@ -52,7 +52,7 @@ public void createMenu() { String showYn = "Y"; MenuSaveRequestDto requestDto = MenuSaveRequestDto.builder() - .uid(uid) +// .uid(uid) .name(name) .icon(icon) .url(url) @@ -67,7 +67,7 @@ public void createMenu() { // then List all = menuRepository.findAll(); - assertThat(all.get(0).getUid()).isEqualTo(uid); +// assertThat(all.get(0).getUid()).isEqualTo(uid); assertThat(all.get(0).getName()).isEqualTo(name); assertThat(all.get(0).getIcon()).isEqualTo(icon); assertThat(all.get(0).getUrl()).isEqualTo(url); @@ -80,7 +80,7 @@ public void createMenu() { public void getMenuList() { // given MenuSaveRequestDto requestDto = MenuSaveRequestDto.builder() - .uid("M001") +// .uid("M001") .name("테스트1") .icon("test") .url("/test") @@ -88,7 +88,7 @@ public void getMenuList() { .showYn("Y") .build(); MenuSaveRequestDto requestDto2 = MenuSaveRequestDto.builder() - .uid("M001") +// .uid("M001") .name("테스트2") .icon("test2") .url("/test2") @@ -118,7 +118,7 @@ public void getOneMenu() { String showYn = "Y"; Menu savedMenu = menuRepository.save(Menu.builder() - .uid(uid) +// .uid(uid) .name(name) .icon(icon) .url(url) @@ -130,7 +130,7 @@ public void getOneMenu() { MenuDto detail = menuService.getDetail(savedMenu.getId()); // then - assertThat(detail.getUid()).isEqualTo(uid); +// assertThat(detail.getUid()).isEqualTo(uid); assertThat(detail.getName()).isEqualTo(name); assertThat(detail.getIcon()).isEqualTo(icon); assertThat(detail.getUrl()).isEqualTo(url); @@ -143,7 +143,7 @@ public void getOneMenu() { public void updateMenu() { // given Menu savedMenu = menuRepository.save(Menu.builder() - .uid("M001") +// .uid("M001") .name("테스트1") .icon("test") .url("/test") @@ -177,7 +177,7 @@ public void updateMenu() { public void deleteMenu() { // given Menu savedMenu1 = menuRepository.save(Menu.builder() - .uid("M001") +// .uid("M001") .name("테스트1") .icon("test") .url("/test") @@ -185,7 +185,7 @@ public void deleteMenu() { .showYn("Y") .build()); Menu savedMenu2 = menuRepository.save(Menu.builder() - .uid("M002") +// .uid("M002") .name("테스트2") .icon("test2") .url("/test2") @@ -209,7 +209,7 @@ public void deleteMenu() { public void getMenuAndCatInOrder() { // given MenuSaveRequestDto requestDto = MenuSaveRequestDto.builder() - .uid("M001") +// .uid("M001") .name("hello") .icon("icon") .url("/url") @@ -217,7 +217,7 @@ public void getMenuAndCatInOrder() { .showYn("Y") .build(); MenuSaveRequestDto requestDto2 = MenuSaveRequestDto.builder() - .uid("M002") +// .uid("M002") .name("hello") .icon("icon") .url("/url") @@ -230,7 +230,7 @@ public void getMenuAndCatInOrder() { Menu menu = menuRepository.findAll().get(0); CategorySaveRequestDto catRequestDto = CategorySaveRequestDto.builder() - .uid("M001C001") +// .uid("M001C001") .name("테스트1") .icon("test") .url("/test") @@ -239,7 +239,7 @@ public void getMenuAndCatInOrder() { .menu(menu) .build(); CategorySaveRequestDto catRequestDto2 = CategorySaveRequestDto.builder() - .uid("M001C002") +// .uid("M001C002") .name("테스트2") .icon("test2") .url("/test2") @@ -248,7 +248,7 @@ public void getMenuAndCatInOrder() { .menu(menu) .build(); CategorySaveRequestDto catRequestDto3 = CategorySaveRequestDto.builder() - .uid("M001C003") +// .uid("M001C003") .name("테스트2") .icon("test2") .url("/test2") @@ -266,11 +266,11 @@ public void getMenuAndCatInOrder() { List categoryList = list.get(1).getCategoryList(); // then - assertThat(list.get(0).getUid()).isEqualTo("M002"); - assertThat(list.get(1).getUid()).isEqualTo("M001"); - - assertThat(categoryList.get(0).getUid()).isEqualTo("M001C003"); - assertThat(categoryList.get(1).getUid()).isEqualTo("M001C001"); - assertThat(categoryList.get(2).getUid()).isEqualTo("M001C002"); +// assertThat(list.get(0).getUid()).isEqualTo("M002"); +// assertThat(list.get(1).getUid()).isEqualTo("M001"); +// +// assertThat(categoryList.get(0).getUid()).isEqualTo("M001C003"); +// assertThat(categoryList.get(1).getUid()).isEqualTo("M001C001"); +// assertThat(categoryList.get(2).getUid()).isEqualTo("M001C002"); } }