-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from everymeals/feature/store-get-detail
feature : Store 조회 s3 경로 추가, Store 상세 조회, Store 식당 분류 조회 추가
- Loading branch information
Showing
45 changed files
with
964 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/everymeal/server/meal/service/MealCommServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package everymeal.server.meal.service; | ||
|
||
|
||
import everymeal.server.meal.entity.Meal; | ||
import everymeal.server.meal.repository.MealDao; | ||
import everymeal.server.meal.repository.MealMapper; | ||
import java.util.List; | ||
import java.util.Map; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
@Service | ||
public class MealCommServiceImpl { | ||
|
||
private final MealDao mealDao; // JPQL DAO | ||
private final MealMapper mealMapper; // MyBatis DAO | ||
|
||
public List<Meal> getMealAllByOfferedAtOnDateAndMealType( | ||
String offeredAt, String mealType, Long restaurantIdx) { | ||
return mealMapper.findAllByOfferedAtOnDateAndMealType(offeredAt, mealType, restaurantIdx); | ||
} | ||
|
||
@Transactional | ||
public void saveAll(List<Meal> mealList) { | ||
mealDao.saveAll(mealList); | ||
} | ||
|
||
public List<Map<String, Object>> getDayList( | ||
String offeredAt, String universityName, String campusName) { | ||
return mealMapper.findDayList(offeredAt, universityName, campusName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/everymeal/server/meal/service/RestaurantCommServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package everymeal.server.meal.service; | ||
|
||
import static everymeal.server.global.exception.ExceptionList.RESTAURANT_NOT_FOUND; | ||
|
||
import everymeal.server.global.exception.ApplicationException; | ||
import everymeal.server.meal.entity.Restaurant; | ||
import everymeal.server.meal.repository.RestaurantRepository; | ||
import everymeal.server.university.entity.University; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
@Service | ||
public class RestaurantCommServiceImpl { | ||
|
||
private final RestaurantRepository restaurantRepository; | ||
|
||
public Optional<Restaurant> getRestaurantOptionalEntity(Long restaurantIdx) { | ||
return restaurantRepository.findById(restaurantIdx); | ||
} | ||
|
||
public Restaurant getRestaurantEntity(Long restaurantIdx) { | ||
return restaurantRepository | ||
.findById(restaurantIdx) | ||
.orElseThrow(() -> new ApplicationException(RESTAURANT_NOT_FOUND)); | ||
} | ||
|
||
@Transactional | ||
public Restaurant save(Restaurant restaurant) { | ||
return restaurantRepository.save(restaurant); | ||
} | ||
|
||
public List<Restaurant> getAllByUniversityAndIsDeletedFalse(University university) { | ||
return restaurantRepository.findAllByUniversityAndIsDeletedFalse(university); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.