-
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.
- Loading branch information
Showing
6 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...a/com/moneygement/lyf/jarvis/recommendation/controller/GroupRecommendationController.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,30 @@ | ||
package com.moneygement.lyf.jarvis.recommendation.controller; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.moneygement.lyf.jarvis.recommendation.domain.Recommendation; | ||
import com.moneygement.lyf.jarvis.recommendation.service.RecommendationService; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequestMapping("/api/recommend") | ||
@RequiredArgsConstructor | ||
@Tag(name = "Recommend", description = "추천 관련 정보를 호출하고, 저장하고, 조회할 수 있습니다.") | ||
public class GroupRecommendationController { | ||
private final RecommendationService recommendationService; | ||
|
||
@GetMapping("group/{groupId}") | ||
@Operation(summary = "History 조회", description = "GroupId 기준의 추천 장소 목록 정보를 제공 합니다.") | ||
public List<Recommendation> getRecommendationsByGroupId(@PathVariable Long groupId) { | ||
return recommendationService.getRecommendationsByGroupId(groupId); | ||
} | ||
|
||
} |
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
10 changes: 10 additions & 0 deletions
10
.../com/moneygement/lyf/jarvis/recommendation/persistence/GroupRecommendationRepository.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,10 @@ | ||
package com.moneygement.lyf.jarvis.recommendation.persistence; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import com.moneygement.lyf.jarvis.recommendation.domain.GroupRecommendation; | ||
|
||
@Repository | ||
public interface GroupRecommendationRepository extends JpaRepository<GroupRecommendation, Long> { | ||
} |
12 changes: 12 additions & 0 deletions
12
.../java/com/moneygement/lyf/jarvis/recommendation/persistence/RecommendationRepository.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,12 @@ | ||
package com.moneygement.lyf.jarvis.recommendation.persistence; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
import java.util.List; | ||
|
||
import com.moneygement.lyf.jarvis.recommendation.domain.Recommendation; | ||
|
||
@Repository | ||
public interface RecommendationRepository extends JpaRepository<Recommendation, Long> { | ||
List<Recommendation> findByGroupId(Long groupId); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/moneygement/lyf/jarvis/recommendation/service/RecommendationService.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,9 @@ | ||
package com.moneygement.lyf.jarvis.recommendation.service; | ||
|
||
import java.util.List; | ||
|
||
import com.moneygement.lyf.jarvis.recommendation.domain.Recommendation; | ||
|
||
public interface RecommendationService { | ||
List<Recommendation> getRecommendationsByGroupId(Long groupId); | ||
} |
21 changes: 21 additions & 0 deletions
21
...ain/java/com/moneygement/lyf/jarvis/recommendation/service/RecommendationServiceImpl.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,21 @@ | ||
package com.moneygement.lyf.jarvis.recommendation.service; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
import com.moneygement.lyf.jarvis.recommendation.domain.Recommendation; | ||
import com.moneygement.lyf.jarvis.recommendation.persistence.RecommendationRepository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class RecommendationServiceImpl implements RecommendationService{ | ||
private final RecommendationRepository recommendationRepository; | ||
|
||
public List<Recommendation> getRecommendationsByGroupId(Long groupId) { | ||
return recommendationRepository.findByGroupId(groupId); | ||
} | ||
|
||
} |