-
Notifications
You must be signed in to change notification settings - Fork 14
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
김태영 API 구축 코드 #1
base: main
Are you sure you want to change the base?
Conversation
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,20 @@ | |||
<!DOCTYPE HTML> |
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 java.util.*; | ||
|
||
@Repository | ||
public class MemoryUserRepository implements UserRepository { |
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 String loginId; | ||
private String password; | ||
|
||
public String getName() { |
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.
헉! 사용하지 않는 게터 세터를 모두 둔다면 객체가 외부에서 쉽게 보여지고, 수정될 수 있는 위험이 있기도 합니다~
public class UserController { | ||
private final UserService userService; | ||
|
||
@Autowired |
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.
LGTM 고생하셨습니다! 결과물도 노션으로 링크 남겨주시면 확인해볼 수 있도록 하겠습니다~!
public class Fortune { | ||
private String fortune; | ||
String[] list = { | ||
"매우 좋음", |
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,5 @@ | |||
package com.example.GDSC.model; | |||
|
|||
public enum Grade { |
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 String password; | ||
private Grade grade; | ||
|
||
public 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.
기본 생성자가 필요한 이유, 그리고 해당 코드에서 명시해야하는 이유가 무엇일까요? 세찬님 PR에도 남겨뒀으니 참고해보셔도 좋을 듯 합니다. 답변 남겨주시면 확인하겠습니다~!
private String loginId; | ||
private String password; | ||
|
||
public String getName() { |
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 java.util.Optional; | ||
import java.util.List; | ||
public interface UserRepository { |
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.
인터페이스를 활용해주셨네요~👍
깃허브에 노션 링크를 남기는 거였군요.. 하단에 해당 노션 링크 남겨놨습니다! |
UserController를 통해 회원 가입 및 조회, 전체 회원 조회 구현
FortuneController를 통해 GET 요청 시 그날의 운세 전달