Skip to content

Conversation

@moto6
Copy link

@moto6 moto6 commented May 12, 2021

Intro

안녕하세요 백엔드 Dong 입니다

Done

  • 기획서에서 나와있는 표현대로 랜더링 사이드(iOS)에서 최대한 편하게 작업할 수 있도록 DTO를 구성해 API를 작성하였습니다.
  • 인프라&배포서버는 1대의 컴퓨터에 DB와 웹서버가 돌아가고 있습니다. VPC 수업을 복습하며 진행중이며 제 이해도가 부족해 아직 미진한 상태입니다.
    • 최대한 빠른 시간 내에 좀더 적절한 인프라 토폴로지를 적용하겠습니다.

can be Improved

  • OAuth는 아직 구현하지 못했습니다 (이번 프로젝트에서 꼭 도전해 볼 계획입니다)
  • 단위테스트는 적용하지 못했습니다


데이터베이스 설계

  • match와 team 이라는 두가지 어그리게이트-루트를 가지고 있는 데이터 베이스 구조입니다
    • match(경기)에는 경기중에 발생하는 데이터를 저장하는 테이블인 board(전광판)가 1:N 관계로 존재하고 있습니다.
    • team 에는 Player가 1:N 관계로 존재하고 있습니다.
      1
  • match와 team 사이에는 별도의 관계는 존재하지 않습니다.
    2


  • mySQLworkbench를 사용하지 않고 직접 DDL SQL문을 작성했습니다.
  • mySQLworkbench를 사용하지 않은 이유는 제가 RDB에 아직 익숙하지 않아서 자동화 tool을 사용하기 전에 DB이해도부터 쌓고싶다는 욕심때문에 이렇게 진행했습니다.

API 리스트

GET

번호 구분 URL 링크
1 게임목록화면 /games http://3.35.226.74/games
2 게임진행화면(공격) /games/offense/{gameId} http://3.35.226.74/games/offense/1
3 게임진행화면(수비) /games/defense/{gameId} http://3.35.226.74/games/defense/1
4 게임별 모든정보 /games/{gameId} http://3.35.226.74/games/1
5 팀별 승점 정보 /teams http://3.35.226.74/teams
6 팀 정보(숫자로) /teams/num/{teamId} http://3.35.226.74/teams/num/1
7 팀 정보(문자로) /teams/{teamName} http://3.35.226.74/teams/Tigers

POST

번호 구분 URL
1 경기 시작하기 /games/start/{gameId}
2 경기 종료하기 /games/end/{gameId}
3 경기 진행(투수 공던지기) /games/throws/{gameId}
  • POST 요청은 shell 명령어로 확인해 볼 수 있습니다!
curl -X POST http://3.35.226.74/games/start/1
curl -X POST http://3.35.226.74/games/end/1
curl -X POST http://3.35.226.74/games/throws/1



이상입니다. 감사합니다!

moto6 and others added 30 commits May 3, 2021 16:23
Copy link
Member

@ksundong ksundong left a comment

Choose a reason for hiding this comment

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

안녕하세요. Dong! 리뷰어 Dion입니다.
이번 미션은 상당히 어려운 프로젝트 중에 하나라고 개인적으로 생각하고 있습니다.

OAuth는 아직 구현하지 못했습니다 (이번 프로젝트에서 꼭 도전해 볼 계획입니다)

  • 현대 웹 애플리케이션에선 필수적인 부분이니 구현해보시기 바랍니다.

단위테스트는 적용하지 못했습니다

  • 개인적으로 꼭 해보셨으면 하는 주제중 하나입니다. 조금씩 만들어내시면 됩니다. 너무 한 번에 많이 하려고 하지마세요.

mySQLworkbench를 사용하지 않은 이유는 제가 RDB에 아직 익숙하지 않아서 자동화 tool을 사용하기 전에 DB이해도부터 쌓고싶다는 욕심때문에 이렇게 진행했습니다.

  • ERD를 그리는 것으로 충분하다고 봅니다. DDL을 직접 작성하는 것보다는 DML을 직접 작성해보세요.

리뷰 요약

  • 불필요한 주석은 바로바로 제거해주세요.
  • REST API 디자인에 조금 더 신경써주세요.(코멘트 참고해주세요.)
  • 네이밍에 있어서 조금 더 신경써주셨으면 좋겠습니다.
  • 객체로 묶는 연습을 진행해주세요. (묶은 객체를 단위테스트 해보세요.)
  • 자바 컨벤션을 지켜주세요.
  • Domain에는 최대한 getter setter를 사용하지 말아주세요.
  • Stream을 많이 활용해주세요.
  • 예외 처리에 좀 더 신경써주세요.
  • Optional을 그냥 get하는건 이제는 혼나야합니다. ㅋㅋ
  • System.out은 금지입니다. logger를 사용해주세요.
  • Comparable, Comparator의 차이를 정리해보시고, 공유해주세요.

작업하느라 고생하신게 많이 느껴졌습니다.
금요일까지 파이팅입니다! 궁금하신점이나 도움이 필요한 부분은 코멘트 남겨주세요!

@@ -0,0 +1,30 @@
plugins {
id 'org.springframework.boot' version '2.3.10.RELEASE'
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
Author

@moto6 moto6 May 12, 2021

Choose a reason for hiding this comment

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

약간의 호기심과 조금의 무심함이 2.3버전을 사용했던 이유였습니다. 제가 너무 버전에 대해 무심하고 무지했던 듯 하네요 ㅠ.. version '2.4.5' 를 사용하도록 수정하였습니다!

Comment on lines 17 to 18
//implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
//implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
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
Author

Choose a reason for hiding this comment

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

넵 시큐리티 해당 부분 주석 삭제하겠습니다!

프로젝트 초반에 신나서 spring.io에서 이것저것 많이 추가했는데 주석을 남겨뒀던 제 실수입니다!

Comment on lines 23 to 25
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
Copy link
Member

Choose a reason for hiding this comment

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

2.4버전으로 올리면 이 부분은 따로 body가 필요없어질 거에요.

Copy link
Author

@moto6 moto6 May 12, 2021

Choose a reason for hiding this comment

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

넵! version '2.4.5' 를 사용하고, 해당 body부분을 삭제하였습니다! 언젠가는 스프링 버전별 차이에 대해서도 학습해보겠습니다!

Copy link
Member

Choose a reason for hiding this comment

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

이정도는 모르셔도 상관없긴 합니다.

}

@GetMapping("/{matchId}")
public List<ProgressDTO> matchInfos(@PathVariable Long matchId) {
Copy link
Member

Choose a reason for hiding this comment

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

그냥 List를 넘겨주기 보다는, Wrapping을 하는 DTO를 생성해서 넘겨주세요.

Copy link
Author

Choose a reason for hiding this comment

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

넵 말씀해주신부분 MatchAllProgressDataDTO 라는 클래스를 따로 만들어서, 단순 리스트가 아닌 객체를 넘겨주도록 변경하겠습니다!

return gameService.matchInformations(matchId);
}

@GetMapping("/offense/{matchId}")
Copy link
Member

Choose a reason for hiding this comment

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

순서가 반대가 되어야 하지 않을까 싶네요.
matches - match - offense/defense

Copy link
Author

Choose a reason for hiding this comment

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

넵 리뷰를 듣고나니 말씀해주신 의견에 동의됩니다!

/games/{gameId}/offense 형식으로 API를 수정하겠습니다.

더해서, get뿐만 아니라 POST 요청의 URL도 수정하겠습니다!

Comment on lines 27 to 41
INSERT INTO `board`(`match`,`inning`,`turn`,`strike`,`ball`,`out`,`home_point`,`away_point`,`pitcher`,`batter`) values
(1,1,'TOP/AWAY',0,0,0,0,0,'kim','dong'),
(1,1,'TOP/AWAY',1,0,0,0,0,'kim','dong'), -- 1 스트라이크
(1,1,'TOP/AWAY',2,0,0,0,0,'kim','dong'), -- 2 스트라이크
(1,1,'TOP/AWAY',3,0,1,0,0,'kim','dong'), -- 3 스트라이크 , 삼진아웃
(1,1,'TOP/AWAY',0,0,1,0,0,'kim','hun'), -- 타자변경
(1,1,'TOP/AWAY',0,1,1,0,0,'kim','hun'), -- 1 볼
(1,1,'TOP/AWAY',0,2,1,0,0,'kim','hun'), -- 2 볼
(1,1,'TOP/AWAY',1,2,1,0,0,'kim','hun'), -- 2 볼 1스트라이크
(1,1,'TOP/AWAY',0,0,1,0,0,'kim','honux'), -- 앞에서 안타 쳐서 호눅스로 타자변경
(1,1,'TOP/AWAY',1,0,1,0,0,'kim','honux'), -- 앞에서 안타 쳐서 호눅스로 타자변경
(1,1,'TOP/AWAY',2,0,1,0,0,'kim','honux'), -- 앞에서 안타 쳐서 호눅스로 타자변경
(1,1,'TOP/AWAY',3,0,1,0,0,'kim','honux'), -- 앞에서 안타 쳐서 호눅스로 타자변경

(1,1,'BOT/HOME',0,0,0,0,0,'kim','dong'); -- */
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
Author

@moto6 moto6 May 13, 2021

Choose a reason for hiding this comment

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

넵.. 아직 SQL쿼리문으로 시작시 DB에 데이터를 넣어주는 방식인데, 조금 더 빨리 개선&& 로직추가를 해서 POST방식으로 데이터를 입력할 수 있도록 변경하겠습니다!

(1,1,'TOP/AWAY',3,0,1,0,0,'kim','honux'), -- 앞에서 안타 쳐서 호눅스로 타자변경

(1,1,'BOT/HOME',0,0,0,0,0,'kim','dong'); -- */
select * from board;
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
Author

Choose a reason for hiding this comment

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

select * from board; 쿼리문은 삭제하겠습니다!

@@ -0,0 +1,47 @@
# 설정
Copy link
Member

Choose a reason for hiding this comment

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

전에도 피드백을 드렸던 것 같지만...
sha bang에 대해서 알아보시고, 추가해주세요.

Copy link
Author

Choose a reason for hiding this comment

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

넵 sha bang 기능 학습해서 추가 완료했습니다! 감사합니다

`away` VARCHAR(45) NOT NULL
);
--
ALTER TABLE `match` CONVERT TO character SET utf8;
Copy link
Member

Choose a reason for hiding this comment

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

MySQL Charset과 Collation에 대해서 한 번 공부해보세요.
그리고 ALTER TABLE은 없어도 될 것 같네요.

`batting_average` DOUBLE DEFAULT NULL
);
--
SELECT * FROM player;
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
Author

Choose a reason for hiding this comment

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

SELECT * FROM player;
이부분도 셀렉트 쿼리 삭제하였습니다

moto6 and others added 24 commits May 13, 2021 00:51
커스텀 exception 클래스 수정
백엔드 리뷰사항 반영 1차
- 해당 쉘 스크립트가 돌아가야할 쉘 종류를 명시하는 쉐뱅 추가
백엔드 코드수정
@ksundong
Copy link
Member

Resolve Conversation은 되도록이면 하지 않는게 좋겠다는 생각이 듭니다.
일반적인 코드리뷰와는 다르게 리뷰어와 리뷰이가 핑퐁을 많이 해야해서, 리뷰이가 스스로 Resolve 하는 것은 별로 좋지 못한 것 같아요!

@moto6
Copy link
Author

moto6 commented May 14, 2021

Resolve Conversation 하지 않겠습니다! 죄송합니다!

ehgud0670 pushed a commit that referenced this pull request May 14, 2021
ehgud0670 pushed a commit that referenced this pull request May 17, 2021
- Navigate 시 animation을 true로 변경
crongro pushed a commit that referenced this pull request May 18, 2021
* Update README.md

* Update README.md

* Update README.md

* docs: FE 초기 폴더구조

* feat: 리액트 기본 환경 설정

* feat:[#3] teamSelect 폴더구성 및 Component 제작 중

* chore

* feat : [#5] teamScore 폴더 제작 및 TeamScore Component 제작 완성

* feat: [#3] TeamSelect 초기 버전 제작 완성 및 추가 설정
- Styled-components의 ThemeProvider 적용
- 디렉토리 구조 일부 변경

* chore: .DS_Store 제거

* feat: [#11] GamePlay 컴포넌트 구조 설계 완료
- GamePlay 컴포넌트 CSS 정의 (프로토타입)
- GamePlay 컴포넌트를 구성하는 모든 파일 생성
    - 기능은 없음 (파일만 생성함)
- App.js의 GlobalStyle 수정
    - 전역으로 수직 / 수평 가운데 정렬

* feat: [#12] GamePlay - GameScore 컴포넌트 완성 (프로토타입)

* feat: [#14] GamePlay - MatchScreen 컴포넌트 완성 (프로토타입)

* feat: SituationScreen 프로토타입 완성 및 router 적용
- react router dom 활용
- 존재하지 않는 페이지 임시 생성

* chore: 일부 폴더 구조 변경 (TeamScore, TeamSelect)

* refactor: [#24] 전체적인 CSS 보정 및 GamePlay 부분 전반적으로 수정

* feat: [#26] GamePlay - BattleGround 프로토타입 완성

* feat: [#30] Proxy 설정 및 TeamSelect API 적용 작업 중..

* feat: [#28] PlayerListPopup 프로토타입 완성 및 일부 네이밍 변경
- 일부 네이밍 변경
    - TeamScore -> TeamScorePopup

* style: [#28] PlayerListPopup의 Style 변경 & theme.js 일부 속성 제거
- PlayerListPopup의 StyledPlayerListPopup의 CSS 변경

* feat:[#30] API 적용

* chore

* feat: [#33] 재사용 되는 PopupFrame 생성 (초기버전 & 활용)
- 이 PopupFrame 컴포넌트를 활용하여
    PlayerListPopup & TeamScorePopup 컴포넌트 디자인 변경
    - TeamScorePopup는 테이블과 전체적 스타일 변경 필요

* feat: [#35] GamePlay BattleGround Animation 추가

* feat:[#35] 애니메이션 수정

* feat: TeamScorePopup 디자인 전체적 변경 및 임시 팝업 기능

* feat: [#40] GamePlay Component API 조작중

* feat: [#41] Popup 컴포넌트들 애니메이션 적용 및 Context 생성 & 일부 구조 변경

* feat: ([#40] 과는 거리가 먼) OAuth를 위한 Login 관련 컴포넌트 생성+
- 일부 Context에 useReducer로 적용

* feat: [#45] GameScore & MatchScreen 데이터 활용하여 표시
- 라이언 아이콘의 State도 GamePlayProvider로 이동.

* feat: Oauth Login 구현

* feat: [#45] Ball, Strike, Out Count 컨트롤 (Pitch 버튼 클릭 시)
- 초기 타입

* feat: [#45] BattleGround 컴포넌트 데이터 핸들링 (1)
- BattleGround
    - GameScore: 득점 시 점수 변화
    - Round: Round 상태 변화
    - MatchScreen: 상황에 따라 선수 데이터 변경
- 대체적으로 GamePlayProvider와 BattleGround, GamePlay가 주로 수정되었습니다

* feat: table API 적용

* feat: 안타 or 아웃에 따라 PUT 요청, 점수판 관련 API 요청은 진행중

* chore

* chore: Add background

Co-authored-by: dudn1933 <[email protected]>
Co-authored-by: leehangeul <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants