Skip to content

Commit

Permalink
Merge pull request #108 from Hanaro-trip-together-bank/feature/dues-req
Browse files Browse the repository at this point in the history
refactor: 사용자 별 입금액 조회 api 수정
  • Loading branch information
ny2060 authored Jun 4, 2024
2 parents 4d0f500 + d6a18fa commit 81a6293
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public BaseResponse getDuesRule(@PathVariable(value ="teamIdx" ) Long teamIdx) {
return BaseResponse.res(ResponseStatus.SUCCESS,ResponseStatus.SUCCESS.getMessage(),duesService.getDuesRule(teamIdx));
}

@GetMapping("/details/amount")
public BaseResponse getDuesAllAmount(@RequestBody DuesDetailRequestDto duesDetailRequestDto){
return BaseResponse.res(ResponseStatus.SUCCESS,ResponseStatus.SUCCESS.getMessage(),duesService.getDuesDetailTotalAmount(duesDetailRequestDto));
@GetMapping("/details/{accIdx}/total-amount")
public BaseResponse getDuesAllAmount(@PathVariable("accIdx") Long accIdx, @RequestParam("memberIdx") Long memberIdx){
return BaseResponse.res(ResponseStatus.SUCCESS,ResponseStatus.SUCCESS.getMessage(),duesService.getDuesDetailTotalAmount(accIdx,memberIdx));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.hanaro.triptogether.account.domain.AccountTransactionDetailsRepository;
import com.hanaro.triptogether.dues.domain.entity.Dues;
import com.hanaro.triptogether.dues.domain.repository.DuesRepository;
import com.hanaro.triptogether.dues.dto.request.DuesDetailRequestDto;
import com.hanaro.triptogether.dues.dto.request.DuesRuleRequestDto;
import com.hanaro.triptogether.dues.dto.response.*;
import com.hanaro.triptogether.teamMember.domain.TeamMember;
Expand All @@ -13,7 +12,6 @@

import java.math.BigDecimal;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -26,8 +24,8 @@ public class DuesService {
private final TeamMemberRepository teamMemberRepository;


public DuesDetailTotalAmountResponseDto getDuesDetailTotalAmount(DuesDetailRequestDto duesDetailRequestDto) {
return accountTransactionDetailsRepository.findSumOfTransAmountByMemberIdx(duesDetailRequestDto.getAccIdx(),duesDetailRequestDto.getMemberIdx());
public DuesDetailTotalAmountResponseDto getDuesDetailTotalAmount(Long accIdx, Long memberIdx) {
return accountTransactionDetailsRepository.findSumOfTransAmountByMemberIdx(accIdx,memberIdx);
}

public List<DuesDetailYearTotalAmountResponseDto> getDuesDetailByMonthAmount(Long accIdx, Long memberIdx, String duesYear){
Expand Down

0 comments on commit 81a6293

Please sign in to comment.