Skip to content

Commit

Permalink
Merge pull request #93 from depromeet/hotfix/22.06.26.01
Browse files Browse the repository at this point in the history
Hotfix/22.06.26.01
  • Loading branch information
SDB016 authored Jun 26, 2022
2 parents 6ea3193 + 3c9f624 commit 1691496
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
8 changes: 2 additions & 6 deletions src/main/java/com/depromeet/fairer/api/MemberController.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,18 @@ public class MemberController {

@Tag(name = "members")
@GetMapping("/me")
@ApiOperation(value = "내 정보 조회")
public ResponseEntity<MemberResponseDto> getMe(@ApiIgnore @RequestMemberId Long memberId) {
return ResponseEntity.ok(MemberResponseDto.from(memberService.find(memberId)));
}

@Tag(name = "members")
@PutMapping("/me")
public ResponseEntity<MemberResponseDto> updateMe(@Valid MemberUpdateRequestDto request, @ApiIgnore @RequestMemberId Long memberId) {
return ResponseEntity.ok(MemberResponseDto.from(memberService.updateMember(memberId, request.getMemberName(), request.getProfilePath(), request.getStatusMessage())));
}

/***
* 기본적으로 제공해주는 프로필 이미지는 profileImageDefaultPath 하위에 보관
* 추후에 유저가 업로드 하는 프로필 이미지는 각 유저 폴더에 보관
*/
@Tag(name = "members")
@GetMapping("/profile-image")
@ApiOperation(value = "기본 프로필 이미지 리스트 조회")
public ResponseEntity<MemberProfileImageResponseDto> getDefaultProfileImageList() {
return ResponseEntity.ok(
MemberProfileImageResponseDto.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

@Data
@Builder
@ApiModel(value="멤버 정보 업데이트 요청 객체", description = "멤버 정보 업데이트 요청 객체")
@AllArgsConstructor @NoArgsConstructor
public class MemberUpdateRequestDto {
@NotBlank
@ApiModelProperty(value = "프로필 이미지 경로")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.depromeet.fairer.global.exception.handler;

import com.depromeet.fairer.global.exception.BadRequestException;
import com.depromeet.fairer.global.exception.CannotJoinTeamException;
import com.depromeet.fairer.global.exception.PermissionDeniedException;
import com.depromeet.fairer.global.exception.*;
import com.depromeet.fairer.global.exception.dto.ErrorResponseDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -92,6 +90,12 @@ protected ResponseEntity<ErrorResponseDto> handlePermissionDeniedException(
return exceptionResponseEntity(e.getMessage(), HttpStatus.FORBIDDEN, request.getRequestURI());
}

@ExceptionHandler(NoSuchMemberException.class)
protected ResponseEntity<ErrorResponseDto> handleNoSuchMemberException(NoSuchMemberException e, HttpServletRequest request) {
log.error("NoSuchMemberException", e);
return exceptionResponseEntity(e.getMessage(), HttpStatus.NOT_FOUND, request.getRequestURI());
}

/**
* 어떤 객체를 생성하지 못할 경우 발생
*/
Expand All @@ -101,6 +105,20 @@ protected ResponseEntity<ErrorResponseDto> handleCannotJoinTeamException(CannotJ
return exceptionResponseEntity(e.getMessage(), HttpStatus.NOT_ACCEPTABLE, request.getRequestURI());
}

@ExceptionHandler(FeignClientException.class)
protected ResponseEntity<ErrorResponseDto> handleFeignClientException(FeignClientException e, HttpServletRequest request) {
log.error("FeignClientException", e);
return exceptionResponseEntity(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR, request.getRequestURI());
}

@ExceptionHandler(MemberTokenNotFoundException.class)
protected ResponseEntity<ErrorResponseDto> handleMemberTokenNotFoundException(MemberTokenNotFoundException e, HttpServletRequest request) {
log.error("MemberTokenNotFoundException", e);
return exceptionResponseEntity(e.getMessage(), HttpStatus.NOT_FOUND, request.getRequestURI());
}



/**
* exception 발생사 ResponseEntity 로 변환 후 반환
*
Expand Down

0 comments on commit 1691496

Please sign in to comment.