-
Notifications
You must be signed in to change notification settings - Fork 0
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
[3주차] 기본 과제 제출 (#7) #9
base: develop
Are you sure you want to change the base?
Conversation
*/ | ||
@ResponseStatus(HttpStatus.BAD_REQUEST) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ErrorStatus에서 Bad Request를 보내주는 것으로 보입니다. 따라서 위에 어노테이션으로 두지 않아도 괜찮습니다:)
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class User { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Protected를 하신 이유를 여쭈어봐도 될까요
/* | ||
BAD_REQUEST | ||
*/ | ||
VALIDATION_EXCEPTION(HttpStatus.BAD_REQUEST, "잘못된 요청입니다."), | ||
VALIDATION_REQUEST_MISSING_EXCEPTION(HttpStatus.BAD_REQUEST, "요청값이 입력되지 않았습니다."), | ||
|
||
|
||
/* | ||
CONFLICT | ||
*/ | ||
CONFLICT_EMAIL_EXCEPTION(HttpStatus.CONFLICT, "이미 등록된 이메일입니다."), | ||
CONFLICT_NICKNAME_EXCEPTION(HttpStatus.CONFLICT, "이미 등록된 닉네임입니다."), | ||
|
||
/* | ||
SERVER_ERROR | ||
*/ | ||
INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "예상치 못한 서버 에러가 발생했습니다."), | ||
BAD_GATEWAY_EXCEPTION(HttpStatus.BAD_GATEWAY, "일시적인 에러가 발생하였습니다.\n잠시 후 다시 시도해주세요!"), | ||
SERVICE_UNAVAILABLE_EXCEPTION(HttpStatus.SERVICE_UNAVAILABLE, "현재 점검 중입니다.\n잠시 후 다시 시도해주세요!"), | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문서화 지립니다.
@Transactional | ||
public UserResponseDto create(UserRequestDto request) { | ||
User user = User.builder() | ||
.email(request.getEmail()) | ||
.nickname(request.getNickname()) | ||
.password(request.getPassword()) | ||
.build(); | ||
userRepository.save(user); | ||
return UserResponseDto.of(user.getId(), user.getNickname()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
트랜잭션 처리해주신 이유를 여쭈어봐도 될까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
재미있겠다 허허허허ㅓ
private final String nickname; | ||
|
||
@NotBlank | ||
@Pattern(regexp="(?=.*[0-9])(?=.*[a-zA-Z])(?=.*\\W)(?=\\S+$).{8,20}",message = "비밀번호는 영문 대,소문자와 숫자, 특수기호가 적어도 1개 이상씩 포함된 8자 ~ 20자의 비밀번호여야 합니다.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
규식이다
import sopt.org.ThirdSeminar.exception.SuccessStatus; | ||
|
||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 엑세스 레벨도 정해줄수 있구나.. 싱기 ㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아요이경민
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 슬슬 달 수 있는 게 없어진다 . . .
@@ -0,0 +1,37 @@ | |||
HELP.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헤업 ~
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
|
||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
// mysql --version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
줄맞춤 좀 해주지 ...
@SpringBootApplication | ||
public class ThirdSeminarApplication { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Application 클래스가 뭐에요 ?
// | ||
//@Getter | ||
//@RequiredArgsConstructor(access = AccessLevel.PRIVATE) | ||
//@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
//public class ApiResponseDto<T> { | ||
// | ||
// private final int code; | ||
// private final String message; | ||
// private T data; | ||
// | ||
// public static ApiResponseDto success(SuccessStatus successStatus) { | ||
// return new ApiResponseDto<>(successStatus.getHttpStatus().value(), successStatus.getMessage()); | ||
// } | ||
// | ||
// public static <T> ApiResponseDto<T> success(SuccessStatus successStatus, T data) { | ||
// return new ApiResponseDto<T>(successStatus.getHttpStatus().value(), successStatus.getMessage(), data); | ||
// } | ||
// | ||
// public static ApiResponseDto error(ErrorStatus errorStatus) { | ||
// return new ApiResponseDto<>(errorStatus.getHttpStatus().value(), errorStatus.getMessage()); | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
불필요한 주석은 제거합시다.
SERVER PR
closed #7
미 안 !!!! 피알나중에쓸게.. ㅜ.ㅜ
🐕 과제 구현 명세
✅ 기본 과제
✅ 심화 과제
🐥 이런 점이 새로웠어요 / 어려웠어요