Skip to content

Feature/game feat : 게임, 리뷰 기능 구현#25

Merged
sumyeom merged 21 commits intodevelopfrom
feature/game
Jan 13, 2025
Merged

Feature/game feat : 게임, 리뷰 기능 구현#25
sumyeom merged 21 commits intodevelopfrom
feature/game

Conversation

@89JHoon
Copy link
Contributor

@89JHoon 89JHoon commented Jan 13, 2025

#️⃣연관된 이슈

게임,리뷰 관련 전체적 기능

📝작업 내용

게임 CRUD
리뷰 CRUD

스크린샷 (선택)

💬리뷰 요구사항(선택)

�TODO> 권한 및 인증 부분 미 구현
�TODO> 첨부파일 수정 및 삭제 기능 추가 및 수정 필요

89JHoon added 13 commits January 8, 2025 09:40
1. 커밋 테스트
1. 게임 등록 기능(기본)
2. 게임 조회(다건/단건) 기능(기본)
3. 게임 수정 기능(기본)
4. 게임 삭제 기능(기본)
1. 게임 검색 기능
1. 리뷰 생성 기능(기본)
2. 리뷰 수정 기능(기본)
3. 리뷰 삭제 기능(기본)
1. 게임 단건 조회시 리뷰 리스트 페이징으로 불러오기 구현
2. 게임 다건(검샘포함) 평균별점, 리뷰 수 불러오기 구현
1. 게임등록 요청
2. 게임등록 요청 삭제
3. 게임등록 요청 수정
4. 게임등록 요청 조회
1. 도메인.game 패키지 추가로 인한 파일 이동
1. 도메인.review 패키지 추가로 인한 파일 이동
1. 게임 전체 조회 , 검색 코드 통합 /games 로 통합하여 사용
1. 게임 등록시 이미지 첨부 파일  기능 구현
2. 게임 삭제시 이미지 데이터 삭제 기능 구현
1. PR 전 간단한 코드 정리
1. 게임 등록 첨부 파일 등록 기능
@89JHoon 89JHoon self-assigned this Jan 13, 2025
Copy link
Contributor

@Newbiekk-kkh Newbiekk-kkh left a comment

Choose a reason for hiding this comment

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

확인부탁드립니다

public class GameController {
private final GameService gameService;

@Autowired
Copy link
Contributor

Choose a reason for hiding this comment

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

@ AutoWired 말고 @ RequiredArgsConstructor 로 통일하면 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

}

GameCreateResponseDto responseDto = gameService.createGame(requestDto, file);
return ResponseEntity.status(HttpStatus.CREATED).body(responseDto);
Copy link
Contributor

Choose a reason for hiding this comment

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

return 값을 new ResponseEntity<>(); 로 통일하기로 코드 컨벤션에 적혀있어서 통일하면 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다!

* @return
*/
@PatchMapping("/{id}")
public ResponseEntity<GameUpdateResponseDto> updateGame(@PathVariable Long id,
Copy link
Contributor

Choose a reason for hiding this comment

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

반환 타입 void 로 고치면 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

public class GameEnrollRequestController {
private final GameEnrollRequestService gameEnrollRequestService;

@Autowired
Copy link
Contributor

Choose a reason for hiding this comment

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

@ AutoWired 말고 @ RequiredArgsConstructor 로 통일하면 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

* @return
*/
@PatchMapping("/{id}")
public ResponseEntity<GameEnrollRequestResponseDto> updateGameEnroll(@PathVariable Long id, @RequestBody GameEnrollRequestUpdateRequestDto requestDto) {
Copy link
Contributor

Choose a reason for hiding this comment

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

반환타입 void 로 고치면 좋을것같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

this.gameImageRepository=gameImageRepository;
}

public GameCreateResponseDto createGame(GameCreateRequestDto gameCreateRequestDto , MultipartFile file) {
Copy link
Contributor

Choose a reason for hiding this comment

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

트랜잭션 처리해주시면 좋을것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

* @param requestDto
* @return
*/
@PatchMapping("/{id}")
Copy link
Contributor

Choose a reason for hiding this comment

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

반환타입 void로 바꾸면 좋을것같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

@Getter
@NoArgsConstructor
@Table(name = "review")
public class Review extends com.example.gamemate.global.common.BaseEntity {
Copy link
Contributor

Choose a reason for hiding this comment

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

경로 설정으로 되어있어서 깔끔하게 써주시면 좋을것같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

this.gameRepository = gameRepository;
}

public ReviewCreateResponseDto createReview(Long gameId, ReviewCreateRequestDto requestDto) {
Copy link
Contributor

Choose a reason for hiding this comment

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

트랜잭션 처리하면 좋을것같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

return new ReviewCreateResponseDto(saveReview);
}

public ReviewUpdateResponseDto updateReview(Long gameId, Long id, ReviewUpdateRequestDto requestDto) {
Copy link
Contributor

Choose a reason for hiding this comment

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

반환 void로 하면 좋을것같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

* @return
*/
@PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ResponseStatus(HttpStatus.CREATED)
Copy link
Contributor

Choose a reason for hiding this comment

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

아래 return에서 명시되어있어서 빼도 될 것 같아요~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

* 게임 전체 조회
*
* @param page
* @param szie
Copy link
Contributor

Choose a reason for hiding this comment

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

여기 오타가 있네용
szie -> size 로 수정 부탁드립니다~!
혹시 @param을 일부만 적으신 이유가 있을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아직 자바독을 완성하지 못했습니다! ㅠㅠ

* 게임 정보 수정
*
* @param id
* @param requestDto
Copy link
Contributor

Choose a reason for hiding this comment

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

이 부분 수정이 필요할 것 같습니다~!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하겟습니다!

public ResponseEntity<Page<GameEnrollRequestResponseDto>> findAllGameEnrollRequest() {

Page<GameEnrollRequestResponseDto> gameEnrollRequestAll = gameEnrollRequestService.findAllGameEnrollRequest();
return ResponseEntity.ok(gameEnrollRequestAll);
Copy link
Contributor

Choose a reason for hiding this comment

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

return 값을 new ResponseEntity<>(); 로 수정 부탁드립니다~!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 수정하였습니다!

@PathVariable Long id) {

GameEnrollRequestResponseDto gameEnrollRequestById = gameEnrollRequestService.findGameEnrollRequestById(id);
return ResponseEntity.ok(gameEnrollRequestById);
Copy link
Contributor

Choose a reason for hiding this comment

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

return 값을 new ResponseEntity<>(); 로 수정 부탁드립니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 수정하였습니다!

private String description;


public GameUpdateRequestDto(String title, String genre, String platform , String description) {
Copy link
Contributor

Choose a reason for hiding this comment

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

public GameUpdateRequestDto(String title, String genre, String platform, String description) {
띄어쓰기 수정 부탁드립니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 수정하였습니다!

@Entity
@Getter
@Table(name = "game")
@AllArgsConstructor
Copy link
Contributor

Choose a reason for hiding this comment

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

@AllArgsConstructor를 제한없이 사용하는 것에 대해 같이 고민해보면 좋을 것 같아요
(access = AccessLevel.PRIVATE)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네! 확인해보고 수정하겟습니다!

@Entity
@Getter
@Table(name = "game_enroll_request")
@AllArgsConstructor
Copy link
Contributor

Choose a reason for hiding this comment

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

@AllArgsConstructor를 제한없이 사용하는 것에 대해 같이 고민해보면 좋을 것 같아요
(access = AccessLevel.PRIVATE)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네! 확인해보고 수정하겟습니다!


private final ReviewService reviewService;

@Autowired
Copy link
Contributor

Choose a reason for hiding this comment

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

@Autowired 대신 @requiredargsconstructor 로 통일하면 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 수정하였습니다

@RequestBody ReviewCreateRequestDto requestDto) {

ReviewCreateResponseDto responseDto = reviewService.createReview(gameId, requestDto);
return ResponseEntity.status(HttpStatus.CREATED).body(responseDto);
Copy link
Contributor

Choose a reason for hiding this comment

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

return 값을 new ResponseEntity<>(); 로 수정 부탁드립니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 수정하겟습니다!

1. @Autowired 말고 @ RequiredArgsConstructor 로 통일
2. 오타 및 줄간격 경로설정 수정
3. return 값을 new ResponseEntity<>(); 로 통일
4. 반환 타입 void 로 수정
5. 트랜잭션 처리
6. @AllArgsConstructor를 제한없이 사용하는 것 > 삭제
}


return ResponseEntity.ok(games);
Copy link
Contributor

Choose a reason for hiding this comment

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

이 부분도return new ResponseEntity<>(games, HttpStatus.OK);
이렇게 해야될 것 같아요!

@PathVariable Long id) {

GameFindByIdResponseDto gameById = gameService.findGameById(id);
return ResponseEntity.ok(gameById);
Copy link
Contributor

Choose a reason for hiding this comment

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

이 부분도 return new ResponseEntity<>(gameById, HttpStatus.OK);
이렇게 해야될 것 같아요!

@RequestBody GameEnrollRequestCreateRequestDto requestDto) {

GameEnrollRequestResponseDto responseDto = gameEnrollRequestService.createGameEnrollRequest(requestDto);
return ResponseEntity.status(HttpStatus.CREATED).body(responseDto);
Copy link
Contributor

Choose a reason for hiding this comment

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

이 부분도 return new ResponseEntity<>( ) 로 수정되어야할 것 같습니다

1. return 값을 new ResponseEntity<>(); 로 통일
@sumyeom sumyeom merged commit 61cb489 into develop Jan 13, 2025
yeji-world pushed a commit that referenced this pull request Jan 14, 2025
1. @Autowired 말고 @ RequiredArgsConstructor 로 통일
2. 오타 및 줄간격 경로설정 수정
3. return 값을 new ResponseEntity<>(); 로 통일
4. 반환 타입 void 로 수정
5. 트랜잭션 처리
6. @AllArgsConstructor를 제한없이 사용하는 것 > 삭제
yeji-world pushed a commit that referenced this pull request Jan 14, 2025
1. return 값을 new ResponseEntity<>(); 로 통일
yeji-world pushed a commit that referenced this pull request Jan 14, 2025
Feature/game feat : 게임, 리뷰 기능 구현
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.

4 participants