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

김태영 API 구축 코드 #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

taeyeongKims
Copy link

UserController를 통해 회원 가입 및 조회, 전체 회원 조회 구현
FortuneController를 통해 GET 요청 시 그날의 운세 전달

Copy link
Member

@mjj111 mjj111 left a 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>
Copy link
Member

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 {
Copy link
Member

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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모두 사용하는 메서드일까요?

Copy link
Contributor

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 애너테이션 없어도 돌아갈거에요 ㅎㅎㅎ

Copy link
Contributor

@coke98 coke98 left a 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 = {
"매우 좋음",
Copy link
Contributor

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 {
Copy link
Contributor

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(){
Copy link
Contributor

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() {
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

인터페이스를 활용해주셨네요~👍

@taeyeongKims
Copy link
Author

LGTM 고생하셨습니다! 결과물도 노션으로 링크 남겨주시면 확인해볼 수 있도록 하겠습니다~!

깃허브에 노션 링크를 남기는 거였군요.. 하단에 해당 노션 링크 남겨놨습니다!
https://cosmic-planet-61e.notion.site/Spring-API-df686513b6e048d287cedc61989c130d?pvs=4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants