Skip to content

Commit

Permalink
[style] 줄바꿈 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryeolee committed Aug 15, 2024
1 parent 703745a commit 4381770
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public BaseResponseDto<MyVeggieDiaryCount> selectDiaryCount(@PathVariable("myVeg
}

@GetMapping(value = "/{myVeggieId}/all")
public BaseResponseDto<MyVeggieDiaryCount> selectDiaryAll(
public BaseResponseDto<?> selectDiaryAll(
@PathVariable("myVeggieId") Long myVeggieId,
@AuthenticationPrincipal CustomUser user
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,11 @@ public static AllDairy of(SortedMyLikeDiary diaryAll, String date){
diaryAll.getDiary().getDiaryLikes().size(),
diaryAll.getDiary().getDiaryComments().size(),
diaryAll.isMyLike()

);
}

public static List<AllDairy> processData(List<SortedMyLikeDiary> diaryAllList){
return diaryAllList.stream()
.map(diaryAll -> AllDairy.of(diaryAll, formatDate(diaryAll.getDiary().getCreatedDate())))
.toList();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public void verifyMyVeggie(Optional<MyVeggie> myVeggie){
throw new MyVeggieNotFoundException("존재하지 않는 채소입니다.",MyVeggieGardenErrorCode.NOT_FOUND_VEGGIE);
}
}


@Transactional
public List<FarmClubDiary> findDiaryAccordingToFarmClub(Long farmClubId, Long userId) {
List<SortedMyLikeDiary> diaryList = diaryRepository.findDiaryByFarmClub(farmClubId, userId);
Expand Down Expand Up @@ -198,45 +196,34 @@ public DiaryInteractionsDto selectComment(Long userId, Long diaryId) {
int commentCount = diaryCommentRepository.findDiaryCommentCountById(diaryId);
return DiaryInteractionsDto.of(diaryCommentContent,likeCount,commentCount);
}



public void insertComment(String content, User user, Diary diary){
DiaryComment diaryComment = DiaryComment.createDiaryComment(content, diary, user);
diary.addDiaryComment(diaryComment);
}

public void insertLike(User user, Diary diary){
DiaryLike newDiary = DiaryLike.createDiaryLike(diary, user);
diary.addDiaryLike(newDiary);
}

public void deleteLike(User user, Diary diary){
diaryRepository.deleteDiaryLikeByIdAndUser(user, diary);
}

public boolean verifyDiaryState(Diary diary){
if(diary == null){return true;}
return false;
}

public Diary selectTodayDiary(MyVeggie myVeggie){
return myVeggieRepository.findDiariesByMyVeggieAndToday(myVeggie);
}


public Diary selectDiaryById(Long diaryId){
Diary diaryData = myVeggieRepository.findDiaryById(diaryId);
checkDiaryData(diaryData);
return diaryData;
}

public void checkDiaryData(Diary diary){
if(diary == null) {
throw new DiaryNotFoundException("해당 일기는 존재하지 않습니다.", MyVeggieGardenErrorCode.NOT_FOUND_DIARY_Like);
}
}

public void checkLikeDeleteData(DiaryLike diaryLike){
if(diaryLike == null) {
throw new LikeNotFoundException("해당 좋아요 데이터는 존재하지 않습니다.", MyVeggieGardenErrorCode.NOT_FOUND_DIARY_Like);
Expand All @@ -247,7 +234,6 @@ public void validateDiaryComment(Optional<DiaryComment> diaryComment){
throw new DiaryCommentNotFoundException("해당 유저는 댓글 삭제 권한이 없습니다.");
}
}

private void addMyyVeggieDiary(
String content,
boolean isOpen,
Expand All @@ -265,7 +251,6 @@ private void addMyyVeggieDiary(
);
myVeggie.addDiary(newDiary);
}

private String getImageUrl(MultipartFile multipartFile) throws IOException {
return s3Service.uploadImage(multipartFile, "dairyimage");
}
Expand Down

0 comments on commit 4381770

Please sign in to comment.