Skip to content

Commit

Permalink
Merge pull request #31 from jurumarble/dev
Browse files Browse the repository at this point in the history
refact : 코드 포맷팅 정리
  • Loading branch information
jonghyunhub authored Sep 4, 2023
2 parents ab27dd9 + 54eff85 commit c290dfc
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public ResponseEntity<Slice<DrinkData>> getDrinks(@RequestParam(required = false

@Operation(summary = "즐긴 술 리스트 조회", description = "파라미터에 keyeword, sortBy, page, size, category 보내주시면 됩니다. 검색이 아니면 keyword = 에 값 없이 보내주시고, 필터로 지역을 추가해서 조회 가능하고 지역없이 조회하면 전체 전통주 이름순으로 나옵니다.")
@GetMapping("/enjoys")
public ResponseEntity<Slice<DrinkData>> getEnjoyDrinks(@RequestAttribute Long userId ,@RequestParam int page, @RequestParam int size) {
public ResponseEntity<Slice<DrinkData>> getEnjoyDrinks(@RequestAttribute Long userId, @RequestParam int page, @RequestParam int size) {
Slice<DrinkData> drinkList = drinkService.getEnjoyDrinks(userId, page, size);
return ResponseEntity.status(HttpStatus.OK)
.body(drinkList);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package co.kr.jurumarble.drink.controller.request;

import co.kr.jurumarble.drink.domain.entity.Drink;
import lombok.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import co.kr.jurumarble.drink.controller.request.DrinkData;
import co.kr.jurumarble.drink.repository.dto.HotDrinkData;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
Expand All @@ -15,5 +14,5 @@ public interface DrinkEntityRepository {

List<HotDrinkData> findDrinksByPopular(int pageNo, int pageSize);

List<DrinkData> getDrinks(String keyword,String region, int pageNo, int pageSize);
List<DrinkData> getDrinks(String keyword, String region, int pageNo, int pageSize);
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public List<Vote> findByTitleContains(String keyword) {
.on(vote.id.eq(voteContent.voteId))
.innerJoin(voteResult)
.on(vote.id.eq(voteResult.voteId))
.where(vote.title.like( "%" + keyword + "%"))
.where(vote.title.like("%" + keyword + "%"))
.groupBy(vote.id)
.orderBy(voteResult.id.count().desc())
.limit(5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.annotation.Import;
import org.springframework.data.domain.PageRequest;
import org.springframework.test.context.TestPropertySource;

import javax.persistence.EntityManager;
Expand Down Expand Up @@ -40,7 +39,7 @@ void getHotDrinks1() {
LocalDateTime testTime = LocalDateTime.of(2023, 8, 10, 7, 15);

// when
List<HotDrinkData> hotDrinks = drinkEntityRepository.getHotDrinks(0,3, testTime);
List<HotDrinkData> hotDrinks = drinkEntityRepository.getHotDrinks(0, 3, testTime);

// then
assertThat(hotDrinks).hasSize(3)
Expand All @@ -59,7 +58,7 @@ void getHotDrinks2() {
LocalDateTime testTime = LocalDateTime.of(2023, 8, 3, 7, 15);

// when
List<HotDrinkData> hotDrinks = drinkEntityRepository.getHotDrinks(0,3, testTime);
List<HotDrinkData> hotDrinks = drinkEntityRepository.getHotDrinks(0, 3, testTime);

// then
assertThat(hotDrinks).hasSize(3)
Expand All @@ -78,7 +77,7 @@ void getHotDrinks3() {
LocalDateTime testTime = LocalDateTime.of(2023, 9, 20, 7, 15);

// when
List<HotDrinkData> hotDrinks = drinkEntityRepository.getHotDrinks(0,3, testTime);
List<HotDrinkData> hotDrinks = drinkEntityRepository.getHotDrinks(0, 3, testTime);

// then
assertThat(hotDrinks).hasSize(0);
Expand All @@ -88,7 +87,7 @@ void getHotDrinks3() {
@Test
void findDrinksByPopular() {
// given // when
List<HotDrinkData> actual = drinkEntityRepository.findDrinksByPopular(0,5);
List<HotDrinkData> actual = drinkEntityRepository.findDrinksByPopular(0, 5);

// then
assertThat(actual).hasSize(5)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package co.kr.jurumarble.vote.repository;

import co.kr.jurumarble.config.JpaAuditionConfig;
import co.kr.jurumarble.exception.vote.VoteNotFoundException;
import co.kr.jurumarble.user.enums.AgeType;
import co.kr.jurumarble.user.enums.GenderType;
import co.kr.jurumarble.user.enums.MbtiType;
import co.kr.jurumarble.vote.dto.VoteData;
import co.kr.jurumarble.vote.repository.dto.HotDrinkVoteData;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand All @@ -17,10 +12,8 @@

import javax.persistence.EntityManager;
import java.time.LocalDateTime;
import java.util.Collections;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.groups.Tuple.tuple;

@DataJpaTest
@Import(JpaAuditionConfig.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@

import co.kr.jurumarble.bookmark.repository.BookmarkRepository;
import co.kr.jurumarble.drink.domain.DrinkFinder;
import co.kr.jurumarble.drink.domain.dto.DrinkIdsUsedForVote;
import co.kr.jurumarble.drink.domain.dto.DrinksUsedForVote;
import co.kr.jurumarble.drink.domain.entity.Drink;
import co.kr.jurumarble.user.domain.User;
import co.kr.jurumarble.user.repository.UserRepository;
import co.kr.jurumarble.vote.domain.Vote;
import co.kr.jurumarble.vote.domain.VoteContent;
import co.kr.jurumarble.vote.domain.VoteDrinkContent;
import co.kr.jurumarble.vote.domain.VoteGenerator;
import co.kr.jurumarble.vote.enums.VoteType;
import co.kr.jurumarble.vote.repository.VoteRepository;
import co.kr.jurumarble.vote.repository.VoteResultRepository;
import co.kr.jurumarble.vote.service.request.CreateDrinkVoteServiceRequest;
import co.kr.jurumarble.vote.service.request.CreateNormalVoteServiceRequest;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand All @@ -25,7 +20,6 @@

import java.util.Optional;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;

@ExtendWith(MockitoExtension.class)
Expand Down

0 comments on commit c290dfc

Please sign in to comment.