Skip to content

Commit

Permalink
style(bill): 코드 컨벤션에 맞게 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ehBeak committed Dec 26, 2023
1 parent ff54f93 commit 2005fd3
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public ResponseEntity deleteBills(@AuthenticationPrincipal UserDetails userDetai
@RequestParam("bill_id_list") List<Long> billIds) {

String userEmail = userDetails.getUsername();

deleteBillsUseCase.deleteBills(userEmail, billIds);
return ResponseEntity.ok(SuccessResponse.create204NoContentResponse());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ public class GetBillController {
private final GetBillUseCase getBillUseCase;

@GetMapping("/bill/{bill_id}")
public ResponseEntity getBillsUseCase(
@AuthenticationPrincipal UserDetails userDetails,
@PathVariable("bill_id") Long billId) {
public ResponseEntity getBillsUseCase(@AuthenticationPrincipal UserDetails userDetails,
@PathVariable("bill_id") Long billId) {

Bill bill = getBillUseCase.getBill(billId);

GetBillResponse response = new GetBillResponse(bill);
return ResponseEntity.ok(SuccessResponse.create200SuccessResponse(response));
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ public class GetBillsController {
private final GetBillsUseCase getBillsUseCase;

@GetMapping("/bills/{bill-category}")
public ResponseEntity getBillsUseCase(
@AuthenticationPrincipal UserDetails userDetails,
@PathVariable("bill-category") BillCategory billCategory) {
public ResponseEntity getBillsUseCase(@AuthenticationPrincipal UserDetails userDetails,
@PathVariable("bill-category") BillCategory billCategory) {

String userEmail = userDetails.getUsername();
List<BillCommand> commands = getBillsUseCase.getBills(userEmail, billCategory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ public class RegisterBillController {
private final FcmNotificationUseCase fcmNotificationUseCase;

@PostMapping("")
public ResponseEntity registerBill(
@AuthenticationPrincipal UserDetails userDetails,
@RequestBody RegisterBillRequest request) {
public ResponseEntity registerBill(@AuthenticationPrincipal UserDetails userDetails,
@RequestBody RegisterBillRequest request) {

String userEmail = userDetails.getUsername();
Long billId = registerBillUseCase.registerBill(userEmail, request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GetBillResponse {

public GetBillResponse(Bill bill) {
this.billCategory = bill.getBillCategory().getTitle();
this.billPaymentAmount = bill.getBillPayment().setScale(0, RoundingMode.FLOOR);
this.billPaymentAmount = bill.getBillPayment().setScale(0, RoundingMode.FLOOR); // todo 모든 BigDecimal은 내림으로 소수점 없이
this.billImageUrl = bill.getBillCategory().getImgUrl();
this.billPaymentDate = bill.getBillPaymentDate();
this.billMemo = bill.getBillMemo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,4 @@ public BillResponse(BillCommand command) {
this.billPaymentAmount = command.getBillPaymentAmount().setScale(0, RoundingMode.FLOOR);
}
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public class RecentBillCategoriesResponse {
@JsonProperty("recent_bill_category")
private List<RecentBillCategoryResponse> recentBillCategories;

public RecentBillCategoriesResponse(
List<RecentBillCategoryCommand> recentBillCategories) {
public RecentBillCategoriesResponse(List<RecentBillCategoryCommand> recentBillCategories) {
this.recentBillCategories =
recentBillCategories.stream().map(RecentBillCategoryResponse::new).toList();
}
Expand All @@ -40,6 +39,4 @@ public RecentBillCategoryResponse(RecentBillCategoryCommand command) {
this.billPaymentAmount = command.getBillPaymentAmount().setScale(0, RoundingMode.FLOOR);
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,5 @@ public Bill saveBill(Bill newBill) {
public void deleteBills(List<Long> billIds) {
billJpaRepository.deleteAllById(billIds);
}
//
// public void deleteBill(Long billIds) {
// billJpaRepository.deleteAll(billIds);
// }

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,4 @@ public RecentBillCategoryCommand findRecentBillCategory(Long householdId, BillCa

}



}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class RegisterBillService implements RegisterBillUseCase {

private final GetUserPort getUserPort;
private final SaveBillPort saveBillPort;
// private final FindBillPort findBillPort;
private final SaveVirtualAccountPort saveVirtualAccountPort;


Expand Down

0 comments on commit 2005fd3

Please sign in to comment.