Skip to content

Commit

Permalink
fix: "불필요한 어노테이션 제거"
Browse files Browse the repository at this point in the history
  • Loading branch information
seonwoo-jung committed May 28, 2024
1 parent bb80f53 commit 8eb5814
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class MemberAuthController {
@ApiResponse(responseCode = "200", description = "사용 가능한 아이디입니다.")
})
@GetMapping("/validation/user-id")
public ResponseHandler<Boolean> validateUsernameDuplication(@RequestParam(name = "userId") String userId) {
public ResponseHandler<Boolean> validateUsernameDuplication(@RequestParam String userId) {
return ResponseHandler.<Boolean>builder()
.data(memberAuthService.validateUserIdDuplication(userId))
.message("사용할 수 있는 아이디입니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.tobe.healthy.member.domain.entity.AlarmStatus;
import com.tobe.healthy.member.domain.entity.AlarmType;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
Expand Down Expand Up @@ -95,7 +94,7 @@ public ResponseHandler<DeleteMemberProfileResult> changeProfile(@AuthenticationP
@ApiResponse(responseCode = "200", description = "이름이 변경되었습니다.")
})
@PatchMapping("/name")
public ResponseHandler<String> changeName(@Parameter(description = "변경할 이름", example = "홍길동") @RequestParam String name,
public ResponseHandler<String> changeName(@RequestParam String name,
@AuthenticationPrincipal CustomMemberDetails member) {
return ResponseHandler.<String>builder()
.data(memberCommandService.changeName(name, member.getMemberId()))
Expand Down Expand Up @@ -139,7 +138,7 @@ public ResponseHandler<Void> updateMemo(@AuthenticationPrincipal CustomMemberDet
@PostMapping("/nickname/{studentId}")
@PreAuthorize("hasAuthority('ROLE_TRAINER')")
public ResponseHandler<Boolean> assignNickname(@PathVariable Long studentId,
@Parameter(description = "등록할 닉네임", example = "홍박사") @RequestParam String nickname) {
@RequestParam String nickname) {
return ResponseHandler.<Boolean>builder()
.data(memberCommandService.assignNickname(nickname, studentId))
.message("닉네임을 지정하였습니다.")
Expand All @@ -165,8 +164,7 @@ public ResponseHandler<Boolean> changeEmail(@RequestBody @Valid CommandChangeEma
@ApiResponse(responseCode = "200", description = "스케줄 공지 보기 여부가 변경되었습니다.")
})
@PatchMapping("/schedule-notice")
public ResponseHandler<Boolean> changeScheduleNotice(@Parameter(description = "변경할 상태", example = "ENABLED")
@RequestParam AlarmStatus alarmStatus,
public ResponseHandler<Boolean> changeScheduleNotice(@RequestParam AlarmStatus alarmStatus,
@AuthenticationPrincipal CustomMemberDetails member) {
return ResponseHandler.<Boolean>builder()
.data(memberCommandService.changeScheduleNotice(alarmStatus, member.getMemberId()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
import com.tobe.healthy.workout.application.WorkoutHistoryService;
import com.tobe.healthy.workout.domain.dto.out.WorkoutHistoryDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.query.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
Expand Down Expand Up @@ -59,8 +57,7 @@ public ResponseHandler<MemberInfoResult> getMemberInfo(@AuthenticationPrincipal
@ApiResponse(responseCode = "200", description = "회원 정보가 조회되었습니다.")
})
@GetMapping("/{memberId}")
public ResponseHandler<MemberInfoResult> getMemberInfo(@Parameter(description = "조회할 회원 아이디", example = "1")
@PathVariable("memberId") Long memberId) {
public ResponseHandler<MemberInfoResult> getMemberInfo(@PathVariable Long memberId) {
return ResponseHandler.<MemberInfoResult>builder()
.data(memberService.getMemberInfo(memberId))
.message("회원정보가 조회 되었습니다.")
Expand All @@ -75,9 +72,9 @@ public ResponseHandler<MemberInfoResult> getMemberInfo(@Parameter(description =
@ApiResponse(responseCode = "200", description = "운동기록, 페이징을 반환한다.")
})
@GetMapping("/me/workout-histories")
public ResponseHandler<CustomPaging<WorkoutHistoryDto>> getWorkoutHistory(@AuthenticationPrincipal CustomMemberDetails loginMember,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
Pageable pageable) {
public ResponseHandler<CustomPaging<WorkoutHistoryDto>> getWorkoutHistory(String searchDate,
Pageable pageable,
@AuthenticationPrincipal CustomMemberDetails loginMember) {
return ResponseHandler.<CustomPaging<WorkoutHistoryDto>>builder()
.data(workoutService.getWorkoutHistory(loginMember.getMember(), loginMember.getMemberId(), pageable, searchDate))
.message("운동기록이 조회되었습니다.")
Expand All @@ -89,10 +86,7 @@ public ResponseHandler<CustomPaging<WorkoutHistoryDto>> getWorkoutHistory(@Authe
@ApiResponse(responseCode = "200", description = "운동기록, 페이징을 반환한다.")
})
@GetMapping("/{memberId}/workout-histories")
public ResponseHandler<CustomPaging<WorkoutHistoryDto>> getWorkoutHistory(@AuthenticationPrincipal CustomMemberDetails loginMember,
@Parameter(description = "학생 ID", example = "1") @PathVariable("memberId") Long memberId,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
Pageable pageable) {
public ResponseHandler<CustomPaging<WorkoutHistoryDto>> getWorkoutHistory(@PathVariable Long memberId, String searchDate, Pageable pageable, @AuthenticationPrincipal CustomMemberDetails loginMember) {
return ResponseHandler.<CustomPaging<WorkoutHistoryDto>>builder()
.data(workoutService.getWorkoutHistory(loginMember.getMember(), memberId, pageable, searchDate))
.message("운동기록이 조회되었습니다.")
Expand All @@ -111,9 +105,9 @@ public ResponseHandler<CustomPaging<WorkoutHistoryDto>> getWorkoutHistory(@Authe
@ApiResponse(responseCode = "200", description = "식단기록, 페이징을 반환한다.")
})
@GetMapping("/me/diets")
public ResponseHandler<CustomPaging<DietDto>> getDiet(@AuthenticationPrincipal CustomMemberDetails loginMember,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
Pageable pageable) {
public ResponseHandler<CustomPaging<DietDto>> getDiet(String searchDate,
Pageable pageable,
@AuthenticationPrincipal CustomMemberDetails loginMember) {
return ResponseHandler.<CustomPaging<DietDto>>builder()
.data(dietService.getDiet(loginMember.getMemberId(), pageable, searchDate))
.message("식단기록 조회되었습니다.")
Expand All @@ -125,8 +119,8 @@ public ResponseHandler<CustomPaging<DietDto>> getDiet(@AuthenticationPrincipal C
@ApiResponse(responseCode = "200", description = "식단기록, 페이징을 반환한다.")
})
@GetMapping("/{memberId}/diets")
public ResponseHandler<CustomPaging<DietDto>> getDiet(@Parameter(description = "학생 ID", example = "1") @PathVariable("memberId") Long memberId,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
public ResponseHandler<CustomPaging<DietDto>> getDiet(@PathVariable Long memberId,
String searchDate,
Pageable pageable) {
return ResponseHandler.<CustomPaging<DietDto>>builder()
.data(dietService.getDiet(memberId, pageable, searchDate))
Expand All @@ -139,9 +133,9 @@ public ResponseHandler<CustomPaging<DietDto>> getDiet(@Parameter(description = "
@ApiResponse(responseCode = "200", description = "식단기록, 페이징을 반환한다.")
})
@GetMapping("/my-trainer/diets")
public ResponseHandler<CustomPaging<DietDto>> getDietMyTrainer(@AuthenticationPrincipal CustomMemberDetails loginMember,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
Pageable pageable) {
public ResponseHandler<CustomPaging<DietDto>> getDietMyTrainer(String searchDate,
Pageable pageable,
@AuthenticationPrincipal CustomMemberDetails loginMember) {
return ResponseHandler.<CustomPaging<DietDto>>builder()
.data(dietService.getDietMyTrainer(loginMember.getMemberId(), pageable, searchDate))
.message("식단기록 조회되었습니다.")
Expand All @@ -156,9 +150,9 @@ public ResponseHandler<CustomPaging<DietDto>> getDietMyTrainer(@AuthenticationPr
@ApiResponse(responseCode = "200", description = "수강권 정보를 반환한다.")
})
@GetMapping("/course")
public ResponseHandler<CourseGetResult> getMyCourse(@AuthenticationPrincipal CustomMemberDetails customMemberDetails,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
Pageable pageable) {
public ResponseHandler<CourseGetResult> getMyCourse(String searchDate,
Pageable pageable,
@AuthenticationPrincipal CustomMemberDetails customMemberDetails) {
return ResponseHandler.<CourseGetResult>builder()
.data(courseService.getCourse(customMemberDetails.getMember(), pageable, customMemberDetails.getMemberId(), searchDate))
.message("수강권이 조회되었습니다.")
Expand All @@ -171,10 +165,10 @@ public ResponseHandler<CourseGetResult> getMyCourse(@AuthenticationPrincipal Cus
})
@GetMapping("/{memberId}/course")
@PreAuthorize("hasAuthority('ROLE_TRAINER')")
public ResponseHandler<CourseGetResult> getCourse(@Parameter(description = "학생 ID") @PathVariable("memberId") Long memberId,
@AuthenticationPrincipal CustomMemberDetails customMemberDetails,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
Pageable pageable) {
public ResponseHandler<CourseGetResult> getCourse(@PathVariable Long memberId,
String searchDate,
Pageable pageable,
@AuthenticationPrincipal CustomMemberDetails customMemberDetails) {
return ResponseHandler.<CourseGetResult>builder()
.data(courseService.getCourse(customMemberDetails.getMember(), pageable, memberId, searchDate))
.message("수강권이 조회되었습니다.")
Expand All @@ -186,9 +180,7 @@ public ResponseHandler<CourseGetResult> getCourse(@Parameter(description = "학
@ApiResponse(responseCode = "200", description = "포인트 및 히스토리를 반환한다.")
})
@GetMapping("/point")
public ResponseHandler<PointDto> getMyPoint(@AuthenticationPrincipal CustomMemberDetails customMemberDetails,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
Pageable pageable) {
public ResponseHandler<PointDto> getMyPoint(@AuthenticationPrincipal CustomMemberDetails customMemberDetails, String searchDate, Pageable pageable) {
return ResponseHandler.<PointDto>builder()
.data(pointService.getPoint(customMemberDetails.getMember().getId(), searchDate, pageable))
.message("포인트가 조회되었습니다.")
Expand All @@ -201,9 +193,7 @@ public ResponseHandler<PointDto> getMyPoint(@AuthenticationPrincipal CustomMembe
})
@GetMapping("/{memberId}/point")
@PreAuthorize("hasAuthority('ROLE_TRAINER')")
public ResponseHandler<PointDto> getPoint(@Parameter(description = "학생 ID") @PathVariable("memberId") Long memberId,
@Parameter(description = "조회할 날짜", example = "2024-12") @Param("searchDate") String searchDate,
Pageable pageable) {
public ResponseHandler<PointDto> getPoint(@PathVariable Long memberId, String searchDate, Pageable pageable) {
return ResponseHandler.<PointDto>builder()
.data(pointService.getPoint(memberId, searchDate, pageable))
.message("포인트가 조회되었습니다.")
Expand All @@ -228,7 +218,8 @@ public ResponseHandler<TrainerMappingResult> getTrainerMapping(@AuthenticationPr
@ApiResponse(responseCode = "200", description = "현재 비밀번호가 확인되었습니다.")
})
@PostMapping("/password")
public ResponseHandler<Long> validateCurrentPassword(@RequestBody ValidateCurrentPassword request, @AuthenticationPrincipal CustomMemberDetails member) {
public ResponseHandler<Long> validateCurrentPassword(@RequestBody ValidateCurrentPassword request,
@AuthenticationPrincipal CustomMemberDetails member) {
return ResponseHandler.<Long>builder()
.data(memberService.validateCurrentPassword(request, member.getMemberId()))
.message("비밀번호가 확인되었습니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class LessonHistoryController(
])
@GetMapping("/detail/{studentId}")
@PreAuthorize("hasAuthority('ROLE_TRAINER')")
fun findAllLessonHistoryByMemberId(@Parameter(description = "학생 ID", example = "1") @PathVariable studentId: Long,
fun findAllLessonHistoryByMemberId(@PathVariable studentId: Long,
@Parameter(content = [Content(schema = Schema(implementation = RetrieveLessonHistoryByDateCond::class))]) request: RetrieveLessonHistoryByDateCond,
@ParameterObject pageable: Pageable): ApiResultResponse<CustomPagingResponse<RetrieveLessonHistoryByDateCondResult>> {
return ApiResultResponse(
Expand Down

0 comments on commit 8eb5814

Please sign in to comment.