-
Notifications
You must be signed in to change notification settings - Fork 74
[BE][team-10] Todo-list 1주차 PR #1 #44
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
Conversation
Member 및 Ground Rules 추가
todo_user, card, log ddl 쿼리 작성
build.gradle h2 dependency 추가 application.properties datasource 등록 schema.sql 수정
1. 디렉토리 MVC 구조로 나누기 2. JSON 데이터 요청 및 응답 mockup으로 구현 3. schema.sql 수정 column table 생성 및 foreign key 조건 할당
save, findById, findAll, delete 구현 card 객체 필드 수정
save_test(), findById 성공, 실패 test 작성 data.sql 작성, schema.sql 수정
Merge 완료
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.
안녕하세요 로니 반스😄 이번에 리뷰를 맡게된 Solar입니다.
첫 PR 고생 많으셨습니다~ 커밋 단위가 잘 나눠져 있어서 리뷰하기 좋았습니다. 👍
테스트 작성하려는 모습도 좋습니다. 😄
한 번 고민해보시면 좋을만한 내용 코멘트로 남겨드렸어요~
수고 많으셨고 남은 미션도 화이팅입니다!!
| return cardResponseEntity; | ||
| } | ||
|
|
||
| @PostMapping("/card/new") |
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.
Rest API 디자인 가이드에 대해서 학습해보시길 추천드립니다~!
링크 하나 첨부해드릴게요 :)
https://meetup.toast.com/posts/92
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.
키워드와 링크 공유해주셔서 감사합니다
참고해서 학습해보겠습니다. solar! 🙏
| public void setId(Long id) { | ||
| this.id = id; | ||
| } |
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.
Setter가 필요한가요??
| private final String author; | ||
| private final String subject; | ||
| private final String contents; | ||
| private final LocalDateTime create_time; |
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 LocalDateTime getCreate_time() { | ||
| return create_time; | ||
| } |
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.
네 수정하여 반영하도록 하겠습니다. 감사합니다.
|
|
||
| KeyHolder keyHolder = new GeneratedKeyHolder(); | ||
| namedParameterJdbcTemplate.update(sql, new BeanPropertySqlParameterSource(card), keyHolder); | ||
| card.setId(Objects.requireNonNull(keyHolder.getKey()).longValue()); |
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.
여기서 setter를 사용하시는군요!
Setter 메소드의 사용은 지양하도록 권고드리는데요.
setter는 왜 사용을 지양해야하는지 고민해보시면 좋을 것 같습니다. 😄
간단히 적어보자면
대표적인 이유로 값을 변경한 의도를 파악하기 힘들다는 점과 객체의 일관성을 유지하기 어렵다는 점이 있습니다.
setter대신 생성자나 정적 팩토리 메소드, 또는 목적과 의도가 분명히 나타낼 수 있는 메소드를 추가해주는 것도 좋은 방법입니다.
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.
setter를 제거하고 정적펙토리메서드로 바꾼다고 생각했을 때, 이렇게 메서드 구상해봤는데... 괜찮은 메서드인지 잘 모르겠습니다ㅠㅠ
public static Card instanceWithId(Long id, Card card) {
card.id = id;
return card;
}번거로우시겠지만, 한번 확인해주신다면 해당 내용 반영하도록 하겠습니다!
감사합니다!
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.
지금같은 경우는 특히 엔티티 클래스이기 때문에 변경한 의도를 파악하기 힘들다보다 객체의 일관성을 유지하기 어렵다라는 포인트에서 Setter 사용을 지양하시길 리뷰드렸습니다.
필요하다면 setter를 사용할 수도 있습니다. 하지만 지금의 경우 엔티티를 식별하는 id가 변경될 수 있는데요. 이때 문제가 발생할 여지가 있을까요? 있다면 왜 문제가 될까요?
식별자 가변성에 대해서 고민해보시길 바랍니다.
지금 요구드리는 것은 아니고 추가적으로 불변 객체에 대해서 한 번 공부해보세요 😊
|
|
||
| @Override | ||
| public boolean delete(Long id) { | ||
| String sql = "update card set deleted = false where id = :id"; |
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.
삭제요청이니 deleted = true가 되어야하지 않나요~?
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.
네 맞습니다. 수정하겠습니다. 감사합니다.
| id BIGINT AUTO_INCREMENT NOT NULL, | ||
| user_id VARCHAR(255) NOT NULL, | ||
| column_id INTEGER NOT NULL, | ||
| subject VARCHAR(255) NOT NULL, | ||
| contents VARCHAR(255) NOT NULL, | ||
| create_time TIMESTAMP NOT NULL, | ||
| update_time TIMESTAMP, | ||
| deleted boolean DEFAULT FALSE, | ||
| PRIMARY KEY (id), | ||
| FOREIGN KEY (user_id) REFERENCES `user` (id), | ||
| FOREIGN KEY (column_id) REFERENCES column (id) |
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.
공백과 들여쓰기를 적절히 사용해서 코드를 읽기 쉽게 하면 좋을 것 같아요~ 예시는 참고만 해주세요!
| id BIGINT AUTO_INCREMENT NOT NULL, | |
| user_id VARCHAR(255) NOT NULL, | |
| column_id INTEGER NOT NULL, | |
| subject VARCHAR(255) NOT NULL, | |
| contents VARCHAR(255) NOT NULL, | |
| create_time TIMESTAMP NOT NULL, | |
| update_time TIMESTAMP, | |
| deleted boolean DEFAULT FALSE, | |
| PRIMARY KEY (id), | |
| FOREIGN KEY (user_id) REFERENCES `user` (id), | |
| FOREIGN KEY (column_id) REFERENCES column (id) | |
| id BIGINT AUTO_INCREMENT NOT NULL, | |
| user_id VARCHAR(255) NOT NULL, | |
| column_id INTEGER NOT NULL, | |
| subject VARCHAR(255) NOT NULL, | |
| contents VARCHAR(255) NOT NULL, | |
| create_time TIMESTAMP NOT NULL, | |
| update_time TIMESTAMP, | |
| deleted boolean DEFAULT FALSE, | |
| PRIMARY KEY (id), | |
| FOREIGN KEY (user_id) REFERENCES `user` (id), | |
| FOREIGN KEY (column_id) REFERENCES column (id) |
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.
오 넵! 가독성이 훨씬 좋아보이네요. 수정하겠습니다. 감사합니다. !
| Card card1 = new Card(1L, "ron2", 1, "subject", "contents", LocalDateTime.now(), LocalDateTime.now(), false); | ||
| Card card2 = new Card(2L, "vans", 2, "subject", "contents", LocalDateTime.now(), LocalDateTime.now(), false); | ||
| ResponseEntity<List<Card>> cardResponseEntity = new ResponseEntity<>(List.of(card1, card2), HttpStatus.OK); | ||
| public ResponseEntity<List<CardResponse>> findOne() { |
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.
요청과 응답 DTO를 적절히 만들어주셨군요👍
* 카드 등록 - 새로운 카드 입력창 생성 기능 구현 (#36) * feature: 등록버튼을 누르면 새로운 카드, 카드 개수 렌더링 등록카드의 등록버튼으로 리스트에 새로운 카드를 추가하고 리스트의 카드 개수를 렌더링한다. * rename: todolistStore.js->todoListStore.js * feat: 새로운 카드 데이터 post 요청 등록버튼을 누르면 새로운 카드의 데이터를 post 요청하여 업데이트 * 카드 수정 - 내용 수정 기능 구현 (#37) * feat: 더블 클릭시 수정카드 전환, 수정버튼 활성화 롱클릭과 더블 클릭을 구분하고 수정카드에 기존과 다른 데이터가 입력되면 수정버튼을 활성화 * feat: 등록카드, 수정카드 데이터 fetch 요청 put 메소드로 변경된 카드 데이터를 서버에 보냄 * refactor: activationStore -> todoListStore 모델의 state를 todoListStore모듈에서 관리함 * 카드 삭제 - X 버튼 마우스 오버 이벤트 & 삭제 알럿창 구현 (#41) * design: delete alert 창 구현 * feat: task x delete button mouseover 이벤트 구현 * mouseover 시 task item 색 변화 * mouseout 시 원래대로 돌아옴 * feat: task title을 이용하여 task 를 삭제하는 함수 구현 * feat: 삭제 Alert 창 생성 기능 구현 * design: delete-button hover 이벤트 클래스로 분리 * feat: Alert 창 결과에 따른 Task 스타일 변화 기능 구현 * remove: todolistStore.js * rename: todoListStore.js * 카드 이동 - 리스트 중간에 카드 추가 기능 구현(1) (#42) * 카드 등록 - 새로운 카드 입력창 생성 기능 구현(1) (#30) * [team-19] Todo-list 1주차 #1 코드리뷰 요청 (#32) * Update issue templates * docs: Update Readme Readme 1차 업데이트 * docs: Update Readme 기술 스택 추가 * Design: reset scss 적용 * HTML, CSS 작업 - Header, Sidebar (#11) * design: header HTML markup Related to: #8 * design: header css style Related to: #8 * design: sidebar HTML markup Related to: #8 * design: sidebar css style Related to: #8 * 메뉴 - 우측 히든 레이어 생성, 애니메이션 구현 (#12) * feat: sidebar 메뉴 버튼 사이드바 메뉴 버튼 클릭시 사이드바 숨김,보임 기능 구현 Related to: #10 * design: sidebar 애니메이션 왼쪽방향으로 나타나고 오른쪽 방향으로 숨겨지는 애니메이션 구현 Related to: #10 * 메뉴 - 우측 히든 레이어 생성, 애니메이션 구현 (#13) * feat: sidebar 메뉴 버튼 사이드바 메뉴 버튼 클릭시 사이드바 숨김,보임 기능 구현 Related to: #10 * design: sidebar 애니메이션 왼쪽방향으로 나타나고 오른쪽 방향으로 숨겨지는 애니메이션 구현 Related to: #10 * feat: action분리 action에 따라 sidebar 리스트의 comment를 다르게 출력함 Related to: #10 * feat: timestamp 기능 구현 현재 시간을 기준으로 투두리스트 작성 및 변경 시간을 보여주는 timestamp 구현 Related to: #10 * feat: 을/를, 으로/로 구분 단어의 마지막 글자 종성에 따라 모음을 다르게 렌더하는 기능 구현 Related to: #10 * HTML, CSS 작업 - Card List (#14) * design: main column list html markup Related to : #9 * move: svg file move to public/svg * 기존 public 에 있던 svg 파일을 svg 폴더 내로 이동 * icon-add.svg 파일 추가 Related to : #9 * Design: font mixin 함수 추가 Related to : #9 * design: column list scss style 작성 Related to: #9 * design: column task list scss style 작성 Related to: #9 * design: task commnet padding 을 margin 으로 변경 Related to: #9 * design: sccs convert to css Related to: #9 * fix: icon svg 파일 경로 수정 Related to: #9 * chore: 빌드환경구성 (#16) babel, webpack 적용 Related to: #15 * 메뉴 - 사용자 액션 리스트 구현 (#19) * feat: sidebar 액션 리스트 히든레이어 영역을 애니메이션 효과와 함께 숨김,보임 기능 구현 Related to: #17 * design: sidebar 액션리스트 애니메이션 Related to: #17 * move: package.json, gitignore * feat: sidebar 스크롤 기능 구현 액션리스트 기록이 많아지면 스크롤을 이용하여 다음 기록을 확인할 수 있음 Related to: #17 * design: 액션리스트 스크롤 구현 Related to: #17 * feature: json server 생성 및 db.json 추가 (#21) * json server 설치하고 db.json 에 필요한 데이터들을 추가함 Related to: #18 * HTML, CSS 작업 - Card (#22) * feat: todo-list 입력창 높이 자동 조절 todo-list를 입력하거나 지울 때 입력창의 높이를 자동으로 조절하는 기능 구현 Related to: #20 * design: column button hover color 칼럼 타이틀의 +,x 버튼을 hover할 때 버튼 색상 변경 Related to: #20 * design: 수정카드 디자인 구현 Related to: #20 * 리팩토링 - 1주차 리뷰 반영 (#24) * refactor: getFinalConsonant 매직넘버 제거 Related to: #23 * refactor: calcTimeForToday 함수 리팩토링 * 매직 넘버 제거 * DayDifference 식 수정 * 몇 년전 조건 추가 Related to: #23 * refactor: writeTime -> timeStamp Related to: #23 * refactor: identifyCategory 함수 리팩토링 * 구조 분해 할당 적용 Related to: #23 * refactor: svg 파일 경로 변수로 분리 * svg 파일 경로를 constants의 imagePath에 변수로 생성해서 관리하도록 변경 Related to: #23 * feat: fetchData 함수 구현 Related to: #23 * chore: bundle.js Related to: #23 * refactor: sidebar model 리팩토링 Related to: #23 * refactor: activationStore import 방식 변경 Related to: #23 Co-authored-by: Hemdi <[email protected]> Co-authored-by: Hemudi <[email protected]> * 카드 등록 - 새로운 카드 등록 기능 구현 (#29) * feat: todolist column과 task를 스크립트로 렌더링 list view와 task view를 클래스로 생성하고 db.json의 todolist를 하나의 배열로 묶음 * feat: column add button 칼럼의 추가버튼으로 등록카드 생성,삭제 기능 구현 * feat: task cancle button 등록카드의 취소버튼을 누르면 등록카드를 삭제하는 기능 구현 * refactor: 메인 렌더링 영역을 list에서 main으로 수정 entry point에서 mainInit의 parent를 list에서 main으로 리팩토링 * refactor: input event를 메인에서 task 모듈로 분리 입력창을 autoResize하는 이벤트를 task 모듈로 분리함 * rename: index.js * feat: 등록버튼 활성화 기능 구현 등록카드에 내용을 입력하면 등록버튼을 활성화, 입력할 수 있는 최대 글자수는 500자 * refactor: registration activation을 todoListStore에서 관리 activiation관리를 task에서 todoListStore로 변경 Co-authored-by: Hemdi <[email protected]> Co-authored-by: Hemudi <[email protected]> * Revert "카드 등록 - 새로운 카드 입력창 생성 기능 구현(1) (#30)" (#31) This reverts commit 7155f85. * feat: 칼럼 사이 카드 이동 마우스 포인터를 기준으로 드래그중인 카드 아래 새로운 카드 존재 여부에 따라 해당 카드 앞 또는 가장 아래에 드래그 카드 추가 * rename: deleteMenu.js->alertDelete.js * feat: 드래그앤 드랍 적용 task 인스턴스에 드래그앤드랍 기능 적용 * refactor: export 방식 변경 Co-authored-by: Hemdi <[email protected]> Co-authored-by: Hemudi <[email protected]> * feat: task id 추가 + id를 이용한 삭제 기능 구현 (#44) * 기존 task title 을 이용해 삭제했던 기능을 id 를 이용해 삭제하는 방식으로 변경 Co-authored-by: Hemdi <[email protected]> Co-authored-by: Hemudi <[email protected]>
[Feat] (iOS) Badge 정보 업데이트 (#26)
처음에 뵙겠습니다 solar🎉
로니&반스입니다!
아직 처음이라 많은 작업을 하지는 못했지만 1차 PR을 보냅니다.
잘부탁드립니다.
구현사항
Card mockup API 구현