Skip to content

Commit

Permalink
[Feat]: 코드 린트 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed Jun 2, 2024
1 parent c7bfc3a commit 4f9b714
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ public ApiResponse<PagingResponse<ChallengeReviewRes.ChallengeReviewDto>> getCha

@Operation(summary = "챌린지 그룹 리뷰 페이징", description = "챌린지 그룹 하위의 모든 챌린지 리뷰 페이징 조회.")
@GetMapping("/api/challengeGroups/{challengeGroupId}/reviews")
public ApiResponse<PagingResponse<ChallengeReviewRes.ChallengeReviewWithChalengeDto>> getChallengeReviewsPaging(
public ApiResponse<PagingResponse<ChallengeReviewRes.ChallengeReviewWithChallengeDto>> getChallengeReviewsPaging(
@PathVariable Long challengeGroupId,
@Valid PagingRequest pagingRequest
//TODO SORTING
) {
Page<ChallengeReviewWithChallenge> page = challengeService.getChallengeReviewsByGroupId(
challengeGroupId, pagingRequest.toPageable());

PagingResponse<ChallengeReviewRes.ChallengeReviewWithChalengeDto> response = PagingResponse.from(
page, ChallengeReviewRes.ChallengeReviewWithChalengeDto::from
PagingResponse<ChallengeReviewRes.ChallengeReviewWithChallengeDto> response = PagingResponse.from(
page, ChallengeReviewRes.ChallengeReviewWithChallengeDto::from
);

return ApiResponse.success(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static ChallengeReviewDto from(
}

@Builder
public record ChallengeReviewWithChalengeDto(
public record ChallengeReviewWithChallengeDto(
Long challengeId,
String challengeTitle,
Integer challengeDifficulty,
Expand All @@ -43,10 +43,10 @@ public record ChallengeReviewWithChalengeDto(
Integer rating
) {

public static ChallengeReviewWithChalengeDto from(
public static ChallengeReviewWithChallengeDto from(
ChallengeReviewWithChallenge challengeReviewWithChallenge) {
var user = UserRes.UserDto.from(challengeReviewWithChallenge.user());
return ChallengeReviewWithChalengeDto.builder()
return ChallengeReviewWithChallengeDto.builder()
.challengeId(challengeReviewWithChallenge.challengeId())
.challengeTitle(challengeReviewWithChallenge.challengeTitle())
.challengeDifficulty(challengeReviewWithChallenge.challengeDifficulty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public String upload(MultipartFile imageFile) {
: "";

// 고유한 파일 이름을 생성합니다.
String uniqueFilename = UUID.randomUUID().toString() + extension;
String uniqueFilename = UUID.randomUUID() + extension;

// 파일의 InputStream을 가져옵니다. try-with-resources 문을 사용하여 InputStream을 자동으로 닫습니다.
try (InputStream inputStream = imageFile.getInputStream()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,5 @@

public interface ChallengeRepository extends JpaRepository<Challenge, Long> {

// /**
// * userId로 현재 진행중인 챌린지 조회 <br> userId로 챌린지를 가져온다.
// */
// @Query(
// "SELECT new org.haedal.zzansuni.infrastructure.challengegroup.challenge.dto.ChallengeCurrentDto("
// + "c.id, c.title, ,"
// + " c.startDate, c.endDate,"
// + " c.participantCount, c.participantLimit, c.status, c.user.id, c.user.nickname, c.user.profileImage) "
// + "FROM Challenge c WHERE c.user.id = :userId")
// Page<ChallengeCurrentDto> findAllChallengeCurrent(Long userId, Pageable pageable);

}

0 comments on commit 4f9b714

Please sign in to comment.