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

fix: update consumer options #236

Merged
merged 46 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ed02bec
feat: set gradle project
210-reverof Jan 18, 2024
19aafce
feat: create createUser interface
210-reverof Jan 18, 2024
c06a26c
feat: add generated ignore
210-reverof Jan 18, 2024
132a6df
feat: send_email_auth.proto, update_user_auth-status.proto
K-Diger Jan 23, 2024
b86f73c
refactor : GUpdateUserAuthStatusRequest 필드 수정
K-Diger Jan 24, 2024
b3de9d3
refactor : GSendEmailAuthRequest Protobuf 필드 수정
K-Diger Jan 24, 2024
8ce45ed
refactor : protobuf 파일 네이밍 변경
K-Diger Jan 26, 2024
968cfb1
feat : Passport protobuf 추가
K-Diger Jan 26, 2024
35f9055
feat : Passport 추가
K-Diger Jan 29, 2024
6485a10
feat: Add getFollowers rpc function to GSocialService
doxxx93 Jan 29, 2024
7d4273e
fix: update build.gradle
doxxx93 Jan 29, 2024
0ff12b1
refactor : Passport 추출 방식 수정
K-Diger Jan 29, 2024
62a8e0e
refactor : 프로토버퍼 수정 (message -> isSuccess, JWTValidateDTO)
K-Diger Jan 29, 2024
b638f72
feat : UserService Proto LoadById
K-Diger Jan 29, 2024
02d3181
refactor : Passport 관련 클래스 빈 환경설정 등록
K-Diger Jan 29, 2024
1962e86
feat: user spring's ObjectMapper
210-reverof Jan 29, 2024
fdb5138
refactor : 로그인 gRPC 응답값 변경
K-Diger Jan 30, 2024
9f68094
Merge remote-tracking branch 'origin/common' into common
K-Diger Jan 30, 2024
c690e61
feat : 패스프트로 유저 팔로잉, 팔로워 수를 조회하는 protobuf 추가
K-Diger Jan 31, 2024
85e4f2f
feat : Passport Extract AOP 로직 추가
K-Diger Jan 31, 2024
844de4e
feat : Passport Extract AOP 로직 추가
K-Diger Jan 31, 2024
ba15e6a
refactor : EaselAuthenticationContext 삽입 필드 변경
K-Diger Jan 31, 2024
aa7f462
refactor : PassportExtractor decode구문 추가
K-Diger Jan 31, 2024
8c7c44f
Merge remote-tracking branch 'origin/common' into common
K-Diger Jan 31, 2024
0f5bec4
refactor : Aspect 내 예외처리 제거
K-Diger Feb 2, 2024
4c85db9
Merge branch 'common' of https://github.com/sgdevcamp2023/palette int…
K-Diger Feb 2, 2024
edbe38d
feat : Kafka, RabbitMQ 공통 모듈 추가
K-Diger Feb 6, 2024
d9f4621
feat : Detail Event 추가
K-Diger Feb 6, 2024
13f4380
refactor : typo
K-Diger Feb 8, 2024
7f2574f
feat: add getter in constants
doxxx93 Feb 8, 2024
5c0b180
feat: update PaintCreatedEvent by adding missing fields
210-reverof Feb 8, 2024
a787984
Merge remote-tracking branch 'origin/common' into common
210-reverof Feb 8, 2024
b13875d
feat: add mention record
210-reverof Feb 8, 2024
6e73f88
feat: update mentionrecord
doxxx93 Feb 8, 2024
77a10ac
fix: add trust-package config
210-reverof Feb 12, 2024
8b85dac
refactor : exception integration
K-Diger Feb 13, 2024
75f2233
refactor : exception response builder access identifier
K-Diger Feb 13, 2024
0c99d9c
refactor : remove gateway exceptiontype
K-Diger Feb 13, 2024
7e753d5
feat: add gRPC paint response interface
210-reverof Feb 14, 2024
fa55cda
feat: gRPC version change 1.60 -> 1.58
210-reverof Feb 15, 2024
7c96ecc
feat: add baseException
210-reverof Feb 15, 2024
f6be77d
feat: update common module
210-reverof Feb 15, 2024
a2fea9d
fix: update event consumer config
210-reverof Feb 15, 2024
6bd967c
fix: config objectMapper by options
210-reverof Feb 15, 2024
a6e617c
fix: config objectMapper by options
210-reverof Feb 15, 2024
fa700c5
fix: config objectMapper by options
210-reverof Feb 15, 2024
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
2 changes: 1 addition & 1 deletion src/common-module/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ buildscript {
ext {
protobufVersion = '3.14.0'
protobufPluginVersion = '0.9.4'
grpcVersion = '1.60.0'
grpcVersion = '1.58.0'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public ConsumerFactory<String, EaselEvent> consumerFactory() {
config.put(ConsumerConfig.GROUP_ID_CONFIG, groupId);
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, JsonDeserializer.class);
config.put(JsonDeserializer.TRUSTED_PACKAGES, "org.palette");
return new DefaultKafkaConsumerFactory<>(config, new StringDeserializer(),
new JsonDeserializer<>(EaselEvent.class));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package org.palette.exception;

import lombok.AccessLevel;
import lombok.Builder;

@Builder(access = AccessLevel.PROTECTED)
@Builder
public record ExceptionResponse(
String code,
String message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,265 @@ public enum ExceptionType {
HttpStatus.INTERNAL_SERVER_ERROR
),

// 400
USER_400_000001(
"USER_400_000001",
"INCORRECT_PARAMETER",
"요청 파라미터가 올바르지 않습니다.",
HttpStatus.BAD_REQUEST
),

USER_400_000002(
"USER_400_000002",
"INCORRECT_EMAIL_PASSWORD",
"이메일 혹은 비밀번호가 올바르지 않습니다.",
HttpStatus.BAD_REQUEST
),

// 401
USER_401_000001(
"USER_401_000001",
"MISSED AUTHENTICATION",
"해당 요청은 인증이 필요합니다.",
HttpStatus.UNAUTHORIZED
),

// 403
USER_403_000001(
"USER_403_000001",
"NOT ALLOWED PERMISSION",
"해당 요청에 대한 권한이 없습니다.",
HttpStatus.FORBIDDEN
),

// 404
USER_404_000001(
"USER_404_000001",
"NOT FOUNDED",
"해당 리소스가 존재하지 않습니다.",
HttpStatus.NOT_FOUND
),

// 405
USER_405_000001(
"USER_403_000005",
"NOT ALLOWED METHOD",
"올바르지 않은 요청 메서드입니다.",
HttpStatus.METHOD_NOT_ALLOWED
),

// 409
USER_409_000001(
"USER_409_000001",
"DUPLICATED",
"중복된 리소스가 있습니다.",
HttpStatus.CONFLICT
),

// 500
USER_500_000001(
"AUTH_500_000001",
"INTERNAL SERVER ERROR",
"서버 간 통신 중 예기치 못한 오류가 발생했습니다.",
HttpStatus.INTERNAL_SERVER_ERROR
),

// 400
AUTH_400_000001(
"AUTH_400_000001",
"INCORRECT_PARAMETER",
"요청 파라미터가 올바르지 않습니다.",
HttpStatus.BAD_REQUEST
),

AUTH_400_000002(
"AUTH_400_000002",
"BROKEN_TOKEN",
"요청 토큰이 올바르지 않습니다.",
HttpStatus.BAD_REQUEST
),

AUTH_400_000003(
"AUTH_400_000003",
"BROKEN_ATTEMPT",
"인증번호 입력 횟수를 초과했습니다.",
HttpStatus.BAD_REQUEST
),

AUTH_400_000004(
"AUTH_400_000002",
"BROKEN_PAYLOAD",
"인증번호가 올바르지 않습니다.",
HttpStatus.BAD_REQUEST
),

// 401
AUTH_401_000001(
"AUTH_401_000001",
"MISSED AUTHENTICATION",
"해당 요청은 인증이 필요합니다.",
HttpStatus.UNAUTHORIZED
),

// 403
AUTH_403_000001(
"AUTH_403_000001",
"NOT ALLOWED PERMISSION",
"해당 요청에 대한 권한이 없습니다.",
HttpStatus.FORBIDDEN
),

AUTH_403_000002(
"AUTH_403_000002",
"EXPIRED_PAYLOAD",
"요청한 인증번호가 만료되었습니다.",
HttpStatus.FORBIDDEN
),

AUTH_403_000003(
"AUTH_403_000003",
"EXPIRED_PAYLOAD",
"토큰이 만료되었습니다. 다시 로그인해주세요",
HttpStatus.FORBIDDEN
),

// 404
AUTH_404_000001(
"AUTH_404_000001",
"NOT FOUNDED",
"해당 리소스가 존재하지 않습니다.",
HttpStatus.NOT_FOUND
),

// 405
AUTH_405_000001(
"AUTH_403_000005",
"NOT ALLOWED METHOD",
"올바르지 않은 요청 메서드입니다.",
HttpStatus.METHOD_NOT_ALLOWED
),

// 409
AUTH_409_000001(
"AUTH_409_000001",
"DUPLICATED",
"중복된 리소스가 있습니다.",
HttpStatus.CONFLICT
),

// 500
AUTH_500_000001(
"AUTH_500_000001",
"INTERNAL SERVER ERROR",
"서버 간 통신 중 예기치 못한 오류가 발생했습니다.",
HttpStatus.INTERNAL_SERVER_ERROR
),

// 400
NOTIFICATION_400_000001(
"NOTIFICATION_400_000001",
"INCORRECT_PARAMETER",
"요청 파라미터가 올바르지 않습니다.",
HttpStatus.BAD_REQUEST
),

// 401
NOTIFICATION_401_000001(
"NOTIFICATION_401_000001",
"MISSED AUTHENTICATION",
"해당 요청은 인증이 필요합니다.",
HttpStatus.UNAUTHORIZED
),

// 403
NOTIFICATION_403_000001(
"NOTIFICATION_403_000001",
"NOT ALLOWED PERMISSION",
"해당 요청에 대한 권한이 없습니다.",
HttpStatus.FORBIDDEN
),

// 404
NOTIFICATION_404_000001(
"NOTIFICATION_404_000001",
"NOT FOUNDED",
"해당 리소스가 존재하지 않습니다.",
HttpStatus.NOT_FOUND
),

// 405
NOTIFICATION_405_000001(
"NOTIFICATION_403_000005",
"NOT ALLOWED METHOD",
"올바르지 않은 요청 메서드입니다.",
HttpStatus.METHOD_NOT_ALLOWED
),

// 409
NOTIFICATION_409_000001(
"NOTIFICATION_409_000001",
"DUPLICATED",
"중복된 리소스가 있습니다.",
HttpStatus.CONFLICT
),

// 500
NOTIFICATION_500_000001(
"AUTH_500_000001",
"INTERNAL SERVER ERROR",
"서버 간 통신 중 예기치 못한 오류가 발생했습니다.",
HttpStatus.INTERNAL_SERVER_ERROR
),

NOTIFICATION_500_000002(
"AUTH_500_000002",
"INTERNAL SERVER ERROR",
"푸쉬 알림 전송 중 예기치 못한 오류가 발생했습니다.",
HttpStatus.INTERNAL_SERVER_ERROR
),

SOCIAL_400_000001(
"SOCIAL_400_000001",
"NOT_FOUND_USER",
"존재하지 않는 사용자입니다",
HttpStatus.BAD_REQUEST
),

SOCIAL_400_000002(
"SOCIAL_400_000002",
"NOT_FOUND_PAINT",
"존재하지 않는 Paint입니다",
HttpStatus.BAD_REQUEST
),

SOCIAL_400_000003(
"SOCIAL_400_000003",
"DUPLICATE_USER",
"이미 존재하는 사용자입니다.",
HttpStatus.BAD_REQUEST
),

SOCIAL_400_000004(
"SOCIAL_400_000004",
"DUPLICATE_REPAINT",
"이미 재게시 있는 게시글 입니다",
HttpStatus.BAD_REQUEST
),

SOCIAL_400_000005(
"SOCIAL_400_000005",
"DUPLICATE_LIKE",
"이미 좋아요 있는 게시글 입니다",
HttpStatus.BAD_REQUEST
),

SOCIAL_400_000006(
"SOCIAL_400_000006",
"DUPLICATE_MARK",
"이미 보관 있는 게시글 입니다",
HttpStatus.BAD_REQUEST
);

;

private final String code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
@ControllerAdvice
public class GlobalExceptionHandler {

private static void logException(ExceptionResponse exceptionResponse) {
log.error(
"code : {}, message : {}, description : {}",
exceptionResponse.code(),
exceptionResponse.description(),
exceptionResponse.message()
);
}

@ExceptionHandler(value = {
MethodArgumentNotValidException.class,
MethodArgumentTypeMismatchException.class,
Expand Down Expand Up @@ -66,10 +57,23 @@ public ResponseEntity<ExceptionResponse> handleException(Exception e) {
.description(e.getLocalizedMessage())
.build();

logException(exceptionResponse);
logInternalException(e);

return ResponseEntity
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(exceptionResponse);
}

private static void logException(ExceptionResponse exceptionResponse) {
log.error(
"code : {}, message : {}, description : {}",
exceptionResponse.code(),
exceptionResponse.description(),
exceptionResponse.message()
);
}

private static void logInternalException(Exception e) {
log.error(e.getLocalizedMessage());
}
}
Loading