-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from BudgetBuddiesTeam/dev
[v4] consumptionGoal 공통 응답 처리
- Loading branch information
Showing
12 changed files
with
139 additions
and
74 deletions.
There are no files selected for viewing
44 changes: 30 additions & 14 deletions
44
...n/java/com/bbteam/budgetbuddies/domain/consumptiongoal/controller/ConsumptionGoalApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,86 @@ | ||
package com.bbteam.budgetbuddies.domain.consumptiongoal.controller; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
|
||
import com.bbteam.budgetbuddies.apiPayload.ApiResponse; | ||
import com.bbteam.budgetbuddies.domain.consumptiongoal.dto.AllConsumptionCategoryResponseDto; | ||
import com.bbteam.budgetbuddies.domain.consumptiongoal.dto.ConsumptionAnalysisResponseDto; | ||
import com.bbteam.budgetbuddies.domain.consumptiongoal.dto.ConsumptionGoalListRequestDto; | ||
import com.bbteam.budgetbuddies.domain.consumptiongoal.dto.ConsumptionGoalResponseListDto; | ||
import com.bbteam.budgetbuddies.domain.consumptiongoal.dto.PeerInfoResponseDto; | ||
import com.bbteam.budgetbuddies.domain.consumptiongoal.dto.TopCategoryConsumptionDto; | ||
import com.bbteam.budgetbuddies.domain.consumptiongoal.dto.TopGoalCategoryResponseDto; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.Parameters; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
|
||
public interface ConsumptionGoalApi { | ||
|
||
@Operation(summary = "또래들이 가장 큰 계획을 세운 카테고리 조회 Top4 API", description = "특정 사용자의 소비 목표 카테고리별 소비 목표 금액을 조회하는 API 입니다.") | ||
@ApiResponses(value = {@ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@ApiResponses(value = { | ||
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@Parameters({@Parameter(name = "userId", description = "로그인 한 유저 아이디"), | ||
@Parameter(name = "peerAgeStart", description = "또래나이 시작 범위"), | ||
@Parameter(name = "peerAgeEnd", description = "또래나이 끝 범위"), | ||
@Parameter(name = "peerGender", description = "또래 성별")}) | ||
ResponseEntity<?> getTopConsumptionGoalCategories(Long userId, int peerAgeStart, int peerAgeEnd, String peerGender); | ||
ApiResponse<List<TopGoalCategoryResponseDto>> getTopConsumptionGoalCategories( | ||
Long userId, int peerAgeStart, int peerAgeEnd, String peerGender); | ||
|
||
@Operation(summary = "또래들이 가장 많이 계획한 카테고리와 평균 금액 및 내 목표금액 차이 조회 API", description = "특정 사용자의 또래 소비 카테고리별 평균 목표 금액을 조회하는 API 입니다.") | ||
@ApiResponses(value = {@ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@ApiResponses(value = { | ||
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@Parameters({@Parameter(name = "userId", description = "로그인 한 유저 아이디"), | ||
@Parameter(name = "peerAgeStart", description = "또래나이 시작 범위"), | ||
@Parameter(name = "peerAgeEnd", description = "또래나이 끝 범위"), | ||
@Parameter(name = "peerGender", description = "또래 성별")}) | ||
ResponseEntity<?> getAllConsumptionGoalCategories(Long userId, int peerAgeStart, int peerAgeEnd, String peerGender); | ||
ApiResponse<List<AllConsumptionCategoryResponseDto>> getAllConsumptionGoalCategories(Long userId, int peerAgeStart, | ||
int peerAgeEnd, String peerGender); | ||
|
||
@Operation(summary = "또래나이와 성별 조회 API", description = "또래나이와 성별을 조회하는 API 입니다.") | ||
@ApiResponses(value = {@ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@ApiResponses(value = { | ||
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@Parameters({@Parameter(name = "userId", description = "로그인 한 유저 아이디"), | ||
@Parameter(name = "peerAgeStart", description = "또래나이 시작 범위"), | ||
@Parameter(name = "peerAgeEnd", description = "또래나이 끝 범위"), | ||
@Parameter(name = "peerGender", description = "또래 성별")}) | ||
ResponseEntity<?> getPeerInfo(Long userId, int peerAgeStart, int peerAgeEnd, String peerGender); | ||
ApiResponse<PeerInfoResponseDto> getPeerInfo(Long userId, int peerAgeStart, int peerAgeEnd, String peerGender); | ||
|
||
@Operation(summary = "소비 목표 조회 API", description = "date={yyyy-MM-dd} 형식의 query string을 통해서 사용자의 목표 달을 조회하는 API 입니다.") | ||
@Parameters({@Parameter(name = "date", description = "yyyy-MM-dd 형식으로 목표 달의 소비를 조회")}) | ||
ResponseEntity<ConsumptionGoalResponseListDto> findUserConsumptionGoal(LocalDate date, Long userId); | ||
ApiResponse<ConsumptionGoalResponseListDto> findUserConsumptionGoal(LocalDate date, Long userId); | ||
|
||
@Operation(summary = "이번 달 소비 목표 수정 API", description = "다른 달의 소비 목표를 업데이트하는 것은 불가능하고 오직 이번 달의 소비 목표만 업데이트 하는 API 입니다.") | ||
ResponseEntity<ConsumptionGoalResponseListDto> updateOrElseGenerateConsumptionGoal(Long userId, | ||
ConsumptionGoalListRequestDto consumptionGoalListRequestDto); | ||
|
||
@Operation(summary = "또래들이 가장 많이한 소비 카테고리 조회 Top3 API", description = "특정 사용자의 또래 소비 카테고리별 소비 건 수을 조회하는 API 입니다.") | ||
@ApiResponses(value = {@ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@ApiResponses(value = { | ||
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@Parameters({@Parameter(name = "userId", description = "로그인 한 유저 아이디"), | ||
@Parameter(name = "peerAgeStart", description = "또래나이 시작 범위"), | ||
@Parameter(name = "peerAgeEnd", description = "또래나이 끝 범위"), | ||
@Parameter(name = "peerGender", description = "또래 성별")}) | ||
ResponseEntity<?> getTopConsumptionCategories(Long userId, int peerAgeStart, int peerAgeEnd, String peerGender); | ||
ApiResponse<List<TopCategoryConsumptionDto>> getTopConsumptionCategories(Long userId, int peerAgeStart, | ||
int peerAgeEnd, String peerGender); | ||
|
||
@Operation(summary = "또래들이 가장 많이한 소비 카테고리와 평균 금액 및 내 소비금액 차이 조회 API", description = "특정 사용자의 또래 소비 카테고리별 평균 소비 금액을 조회하는 API 입니다.") | ||
@ApiResponses(value = {@ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@ApiResponses(value = { | ||
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
@Parameters({@Parameter(name = "userId", description = "로그인 한 유저 아이디"), | ||
@Parameter(name = "peerAgeStart", description = "또래나이 시작 범위"), | ||
@Parameter(name = "peerAgeEnd", description = "또래나이 끝 범위"), | ||
@Parameter(name = "peerGender", description = "또래 성별")}) | ||
ResponseEntity<?> getAllConsumptionCategories(Long userId, int peerAgeStart, int peerAgeEnd, String peerGender); | ||
ApiResponse<List<AllConsumptionCategoryResponseDto>> getAllConsumptionCategories(Long userId, int peerAgeStart, | ||
int peerAgeEnd, String peerGender); | ||
|
||
@Operation(summary = "또래들이 가장 큰 목표로 세운 카테고리와 그 카테고리에서 이번주 사용한 금액 조회 API", description = "특정 사용자의 또래 소비 카테고리별 이번주 소비 금액을 조회하는 API 입니다.") | ||
@ApiResponses(value = {@ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
ResponseEntity<?> getTopCategoryAndConsumptionAmount(@PathVariable Long userId); | ||
@ApiResponses(value = { | ||
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "OK, 성공")}) | ||
ApiResponse<ConsumptionAnalysisResponseDto> getTopCategoryAndConsumptionAmount(@PathVariable Long userId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 11 additions & 7 deletions
18
src/main/java/com/bbteam/budgetbuddies/domain/expense/dto/ExpenseRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
package com.bbteam.budgetbuddies.domain.expense.dto; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ExpenseRequestDto { | ||
private Long userId; | ||
private Long categoryId; | ||
private Long amount; | ||
private String description; | ||
private LocalDateTime expenseDate; | ||
private Long userId; | ||
private Long categoryId; | ||
private Long amount; | ||
private String description; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") | ||
private LocalDateTime expenseDate; | ||
} |
Oops, something went wrong.