From a3e15771410f6c0fbdfdfdd814068975521c6be7 Mon Sep 17 00:00:00 2001 From: wnd01jun Date: Fri, 16 Aug 2024 16:39:12 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[fix]=20UserController=20URL=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../budgetbuddies/domain/user/controller/UserController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbteam/budgetbuddies/domain/user/controller/UserController.java b/src/main/java/com/bbteam/budgetbuddies/domain/user/controller/UserController.java index 0fa1e210..6d49ba8b 100644 --- a/src/main/java/com/bbteam/budgetbuddies/domain/user/controller/UserController.java +++ b/src/main/java/com/bbteam/budgetbuddies/domain/user/controller/UserController.java @@ -31,7 +31,7 @@ public ApiResponse registerUser(@RequestBody UserDto.Re return ApiResponse.onSuccess(userService.saveUser(dto)); } - @GetMapping("/find/{userid}") + @GetMapping("/find/{userId}") public ApiResponse findOne(@PathVariable("userId") @ExistUser Long userId) { return ApiResponse.onSuccess(userService.findUser(userId)); } From eadca0a37a6ca5e5ebbc272a7106e301f7b0bc7a Mon Sep 17 00:00:00 2001 From: JunRain Date: Sat, 17 Aug 2024 15:30:43 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[feat]=20CompactExpenseReponseDto=EC=97=90?= =?UTF-8?q?=20categoryId=20=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/expense/dto/CompactExpenseResponseDto.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/bbteam/budgetbuddies/domain/expense/dto/CompactExpenseResponseDto.java b/src/main/java/com/bbteam/budgetbuddies/domain/expense/dto/CompactExpenseResponseDto.java index f40b7c24..0983666e 100644 --- a/src/main/java/com/bbteam/budgetbuddies/domain/expense/dto/CompactExpenseResponseDto.java +++ b/src/main/java/com/bbteam/budgetbuddies/domain/expense/dto/CompactExpenseResponseDto.java @@ -18,6 +18,7 @@ public class CompactExpenseResponseDto { private Long expenseId; private String description; private Long amount; + private Long categoryId; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Seoul") private LocalDateTime expenseDate; From 8f55597b8f07e1a2a19a2699335f023f4d69c965 Mon Sep 17 00:00:00 2001 From: JunRain Date: Sat, 17 Aug 2024 15:34:01 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[fix]=20categoryId=20=ED=95=84=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20toExpenseCom?= =?UTF-8?q?pactResponseDto=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../budgetbuddies/domain/expense/converter/ExpenseConverter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/bbteam/budgetbuddies/domain/expense/converter/ExpenseConverter.java b/src/main/java/com/bbteam/budgetbuddies/domain/expense/converter/ExpenseConverter.java index 23b1790e..d4353d6d 100644 --- a/src/main/java/com/bbteam/budgetbuddies/domain/expense/converter/ExpenseConverter.java +++ b/src/main/java/com/bbteam/budgetbuddies/domain/expense/converter/ExpenseConverter.java @@ -59,6 +59,7 @@ private CompactExpenseResponseDto toExpenseCompactResponseDto(Expense expense) { .description(expense.getDescription()) .amount(expense.getAmount()) .expenseDate(expense.getExpenseDate()) + .categoryId(expense.getCategory().getId()) .build(); } } From 1a879d8e2dfc3f6c0680eb94ee7dcc3eb096bfa8 Mon Sep 17 00:00:00 2001 From: JunRain Date: Sat, 17 Aug 2024 15:37:05 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[fix]=20ExpenseServiceTest=20getMonthlyExpe?= =?UTF-8?q?nse=20=EB=A9=94=EC=84=9C=EB=93=9C=20categoryId=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=EC=97=90=20=EB=8C=80=ED=95=9C=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/expense/service/ExpenseServiceImplTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/com/bbteam/budgetbuddies/domain/expense/service/ExpenseServiceImplTest.java b/src/test/java/com/bbteam/budgetbuddies/domain/expense/service/ExpenseServiceImplTest.java index 11ecbf07..f0f5c05f 100644 --- a/src/test/java/com/bbteam/budgetbuddies/domain/expense/service/ExpenseServiceImplTest.java +++ b/src/test/java/com/bbteam/budgetbuddies/domain/expense/service/ExpenseServiceImplTest.java @@ -66,6 +66,7 @@ void getMonthlyExpense_Success() { given(userRepository.findById(user.getId())).willReturn(Optional.of(user)); Category userCategory = Mockito.spy(Category.builder().build()); + given(userCategory.getId()).willReturn(-1L); LocalDate requestMonth = LocalDate.of(2024, 07, 8); Pageable requestPage = PageRequest.of(0, pageSize); @@ -120,6 +121,7 @@ private List generateCompactExpenseResponseList(Local .expenseId((long)-i) .expenseDate(month.withDayOfMonth(i).atStartOfDay()) .amount(i * 100000L) + .categoryId(-1L) .build()); } return compactExpenses;