Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BE 환경에 배포 #552

Merged
merged 13 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.EatCeedStaticMessage;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.auth.LoginExceptionDocs;
import com.gaebaljip.exceed.common.docs.auth.ReissueTokenExceptionDocs;
import com.gaebaljip.exceed.common.dto.HttpRequestDTO;
Expand All @@ -36,7 +37,7 @@
@RequiredArgsConstructor
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[인증]")
@Tag(name = SwaggerTag.AUTH)
public class AuthController {

private final AuthUsecase authUsecase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import com.gaebaljip.exceed.common.ApiResponse.CustomBody;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
Expand All @@ -25,10 +27,11 @@
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/v1")
@Tag(name = "[음식 등록]")
@Tag(name = SwaggerTag.FOOD)
public class CreateFoodController {
private final CreateFoodUseCase createFoodUseCase;

@Operation(summary = "내 음식 추가", description = "내 음식 추가")
@PostMapping("/food")
public ApiResponse<CustomBody<Void>> createFood(
@RequestBody @Valid CreateFoodRequest request, @AuthenticationMemberId Long memberId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.food.DeleteFoodExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;

Expand All @@ -25,12 +26,12 @@
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/v1")
@Tag(name = "[음식 삭제]")
@Tag(name = SwaggerTag.FOOD)
public class DeleteFoodController {

private final DeleteFoodUseCase deleteFoodUseCase;

@Operation(description = "내가 등록한 음식 삭제하기")
@Operation(summary = "내가 등록한 음식 삭제", description = "내가 등록한 음식 삭제하기")
@DeleteMapping("/food/{foodId}")
@ApiErrorExceptionsExample(DeleteFoodExceptionDocs.class)
public ApiResponse<ApiResponse.CustomBody<Void>> deleteFood(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.gaebaljip.exceed.application.port.in.food.GetFoodQuery;
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.docs.SwaggerTag;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
Expand All @@ -20,7 +21,7 @@
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/v1")
@Tag(name = "[음식 조회]")
@Tag(name = SwaggerTag.FOOD)
public class GetFoodController {

private final GetFoodQuery getFoodQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand All @@ -25,7 +26,7 @@
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/v1")
@Tag(name = "[내가 추가한 음식 조회]")
@Tag(name = SwaggerTag.FOOD)
public class GetOwnFoodController {
private final GetOwnFoodUseCase getOwnFoodUseCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.gaebaljip.exceed.common.ApiResponse.CustomBody;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.meal.EatMealExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;

Expand All @@ -31,7 +32,7 @@
@RequiredArgsConstructor
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[식사 등록]")
@Tag(name = SwaggerTag.MEAL)
public class EatMealController {

private final EatMealUsecase eatMealUsecase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.meal.GetMealExceptionDocs;
import com.gaebaljip.exceed.common.docs.meal.GetMealFoodExceptionDocs;
import com.gaebaljip.exceed.common.dto.*;
Expand All @@ -42,7 +43,7 @@
@Slf4j
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[식사 조회]")
@Tag(name = SwaggerTag.MEAL)
public class GetMealController {

private final GetMaintainNutritionUsecase getMaintainNutritionUsecase;
Expand All @@ -54,7 +55,7 @@ public class GetMealController {
private final GetWeightUseCase getWeightUseCase;

/** 오늘 먹은 식사 정보(단,탄,지 및 칼로리) 조회 */
@Operation(summary = "오늘 먹은 식사 정보 조회", description = "오늘 먹은 식사 정보(단,탄,지 및 칼로리)를 조회한다.")
@Operation(summary = "오늘 먹은 식사 정보 조회 (홈 화면)", description = "오늘 먹은 식사 정보(단,탄,지 및 칼로리)를 조회한다.")
@GetMapping("/meal")
@ApiErrorExceptionsExample(GetMealExceptionDocs.class)
public ApiResponse<ApiResponse.CustomBody<GetMealAndWeightResponse>> getMeal(
Expand All @@ -70,7 +71,9 @@ public ApiResponse<ApiResponse.CustomBody<GetMealAndWeightResponse>> getMeal(
}

/** 특정 날짜의 식사 정보(단,탄,지 및 칼로지) 조회 */
@Operation(summary = "특정 날짜의 식사 정보 조회", description = "특정 날짜의 식사 정보(단,탄,지 및 칼로리)를 조회한다.")
@Operation(
summary = "특정 날짜의 식사 정보 조회 (켈린더 상세 화면)",
description = "특정 날짜의 식사 정보(단,탄,지 및 칼로리)를 조회한다.")
@GetMapping("/meal/{date}")
@ApiErrorExceptionsExample(GetMealFoodExceptionDocs.class)
public ApiResponse<ApiResponse.CustomBody<GetMealFoodResponse>> getMealFood(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.gaebaljip.exceed.application.port.in.member.UpdateCheckedUsecase;
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.member.CheckMemberEmailExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;

Expand All @@ -23,7 +24,7 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1")
@Tag(name = "[이메일 인증]")
@Tag(name = SwaggerTag.SIGN_UP)
public class CheckMemberEmailController {

private final CheckCodeUsecase checkCodeUsecase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand All @@ -19,10 +21,11 @@
@RequiredArgsConstructor
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[회원탈퇴]")
@Tag(name = SwaggerTag.MEMBER_MANAGEMENT)
public class DeleteMemberController {
private final DeleteMemberUseCase deleteMemberUseCase;

@Operation(summary = "회원 탈퇴", description = "회원 탈퇴 한다.")
@DeleteMapping("/members")
public ApiResponse<ApiResponse.CustomBody<Void>> deleteMember(
@Parameter(hidden = true) @AuthenticationMemberId Long memberId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponse.CustomBody;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.member.FindPassword_updatePasswordExceptionDocs;
import com.gaebaljip.exceed.common.docs.member.FindPassword_validateEmailExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;
Expand All @@ -27,7 +28,7 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1")
@Tag(name = "[비밀번호 찾기]")
@Tag(name = SwaggerTag.ACCOUNT_MANAGEMENT)
public class FindPasswordController {

private final PasswordValidationUsecase passwordValidationUsecase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.gaebaljip.exceed.common.ApiResponse.CustomBody;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.member.OnBoardingMemberExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;

Expand All @@ -26,7 +27,7 @@
@RequiredArgsConstructor
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[온보딩]")
@Tag(name = SwaggerTag.ONBOARDING)
public class OnBoardingController {

private final OnBoardingMemberUsecase onBoardingMemberUsecase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponse.CustomBody;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.member.SignUpMemberExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;

Expand All @@ -22,7 +23,7 @@
@RequiredArgsConstructor
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[회원가입]")
@Tag(name = SwaggerTag.SIGN_UP)
public class SignUpMemberController {

private final ValidateSignUpUsecase validateSignUpUsecase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.member.UpdateMemberExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;

Expand All @@ -24,7 +25,7 @@
@RequiredArgsConstructor
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[회원수정]")
@Tag(name = SwaggerTag.MEMBER_MANAGEMENT)
public class UpdateMemberController {
private final UpdateMemberUsecase updateMemberUsecase;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.gaebaljip.exceed.adapter.in.member;

import javax.validation.Valid;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.gaebaljip.exceed.adapter.in.member.request.UpdatePasswordRequest;
import com.gaebaljip.exceed.application.port.in.member.UpdatePasswordUsecase;
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponse.CustomBody;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.member.UpdatePasswordExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
@RequestMapping("/v1")
@Tag(name = SwaggerTag.ACCOUNT_MANAGEMENT)
public class UpdatePasswordController {

private final UpdatePasswordUsecase updatePasswordUsecase;

@Operation(summary = "비밀번호 변경", description = "비밀번호를 변경할 때 사용한다. 해당 API는 로그인 후에 사용하는 API이다.")
@PatchMapping("/members/password")
@ApiErrorExceptionsExample(UpdatePasswordExceptionDocs.class)
public ApiResponse<CustomBody<Void>> updatePassword(
@Parameter(hidden = true) @AuthenticationMemberId Long memberId,
@RequestBody @Valid UpdatePasswordRequest request) {
updatePasswordUsecase.execute(memberId, request.oldPassword(), request.newPassword());
return ApiResponseGenerator.success(HttpStatus.OK);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
Expand All @@ -25,7 +26,7 @@
@RequiredArgsConstructor
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[몸무게 수정]")
@Tag(name = SwaggerTag.MEMBER_MANAGEMENT)
public class UpdateWeightController {
private final UpdateWeightUsecase updateWeightUsecase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.gaebaljip.exceed.application.port.in.member.VerifyEmailCheckedUsecase;
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.docs.SwaggerTag;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
Expand All @@ -19,7 +20,7 @@
@RequiredArgsConstructor
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[회원가입]")
@Tag(name = SwaggerTag.SIGN_UP)
public class VerifyEmailCheckedController {

private final VerifyEmailCheckedUsecase verifyEmailCheckedUsecase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.gaebaljip.exceed.adapter.in.member.request;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.gaebaljip.exceed.application.domain.member.Activity;
Expand All @@ -21,4 +20,4 @@ public record UpdateMemberRequest(
@Min(value = 0, message = "나이는 " + ValidationMessage.MIN_0)
Integer age,
@Enum(enumClass = Activity.class) String activity,
@NotBlank(message = "기타사항을 " + ValidationMessage.NOT_BLANK) String etc) {}
String etc) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.gaebaljip.exceed.adapter.in.member.request;

import com.gaebaljip.exceed.common.ValidationMessage;
import com.gaebaljip.exceed.common.annotation.Password;

import lombok.Builder;

public record UpdatePasswordRequest(
@Password(message = ValidationMessage.INVALID_PASSWORD) String oldPassword,
@Password(message = ValidationMessage.INVALID_PASSWORD) String newPassword) {
@Builder
public UpdatePasswordRequest {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.gaebaljip.exceed.common.ApiResponse;
import com.gaebaljip.exceed.common.ApiResponseGenerator;
import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId;
import com.gaebaljip.exceed.common.docs.SwaggerTag;
import com.gaebaljip.exceed.common.docs.nutritionist.GetAnalysisExceptionDocs;
import com.gaebaljip.exceed.common.swagger.ApiErrorExceptionsExample;

Expand All @@ -31,7 +32,7 @@
@Slf4j
@RequestMapping("/v1")
@SecurityRequirement(name = "access-token")
@Tag(name = "[분석 조회]")
@Tag(name = SwaggerTag.MEAL)
public class GetAnalysisController {

private final ValidateSignUpBeforeMonthUsecase validateSignUpBeforeMonthUsecase;
Expand All @@ -42,7 +43,7 @@ public class GetAnalysisController {
* @param memberId
* @return
*/
@Operation(summary = "월별 식사 정보 분석", description = "월별 식사 정보를 분석한다.")
@Operation(summary = "월별 식사 정보 분석 (켈린더 분석 화면)", description = "월별 식사 정보를 분석한다.")
@GetMapping("/achieve/{date}")
@ApiErrorExceptionsExample(GetAnalysisExceptionDocs.class)
public ApiResponse<ApiResponse.CustomBody<GetMonthlyAnalysisResponse>> getAnalysis(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
@UseCase
public interface UpdatePasswordUsecase {
void execute(String email, String password);

void execute(Long memberId, String oldPassword, String newPassword);
}
Loading
Loading