Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: 🐛 Bug Report
about: 버그를 보고합니다
title: "[Bug] "
labels: bug
assignees: ''
---

## 🐞 버그 설명
- 버그에 대해 간단히 설명해주세요.

## ✅ 재현 방법
- 버그를 재현하려면 다음 단계를 따르세요:
1. [예: 페이지 이동 경로]
2. [예: 특정 버튼 클릭]
3. [예: 기대되는 결과]

## 🖥 환경 정보
- OS: [Windows, macOS, Linux 등]
- Browser: [Chrome, Firefox 등]
- Version: [앱/브라우저 버전]

## 📸 스크린샷
- 버그를 보여주는 스크린샷을 추가해주세요 (필요한 경우).
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: ✨ Feature Request
about: 새로운 기능을 요청합니다
title: "[Feature] "
labels: enhancement
assignees: ''
---

## 🌟 기능 설명
- 추가하고 싶은 기능이나 변경 사항을 간략히 설명해주세요.

## 🤔 이유
- 이 기능이 왜 필요한지, 어떤 문제를 해결하는지 설명해주세요.

## 📋 추가 정보
- 기능과 관련된 참고 자료나 추가 정보를 포함해주세요.
34 changes: 34 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## 📋 요약
- 이 Pull Request의 목적과 주요 변경 사항을 간략히 설명해주세요.

## 🛠 변경 사항
- 이번 Pull Request에서 작업한 주요 변경 사항은 다음과 같습니다:
- [x] 새로운 기능 추가 또는 버그 수정
- [x] 코드 리팩토링 또는 최적화
- [x] 문서 업데이트

## 🔗 관련 이슈
- 이 PR로 해결되는 이슈: #[이슈 번호]
- 관련된 이슈: #[이슈 번호]

## 📸 스크린샷 또는 GIF (해당되는 경우)
- UI 변경이 있는 경우 변경 사항을 보여주는 스크린샷이나 GIF를 추가해주세요.

## ✅ 체크리스트
- [ ] 코드가 정상적으로 동작하는지 테스트했습니다.
- [ ] 관련 문서를 작성하거나 업데이트했습니다. (해당되는 경우)
- [ ] 변경 사항을 반영한 테스트 코드를 추가했습니다.
- [ ] 모든 테스트가 성공적으로 통과했습니다.

## 🛡 테스트 방법
- 변경 사항을 확인하기 위한 테스트 방법을 단계별로 작성해주세요:
1. 브랜치를 로컬로 가져옵니다.
2. 아래 명령어를 사용해 애플리케이션 또는 테스트를 실행합니다:
```
# 예시 명령어
./run_tests.sh
```
3. 예상 동작이나 출력 결과를 확인합니다.

## 📚 추가 참고 사항
- 이 PR과 관련해 리뷰어가 알아야 할 추가 내용이 있다면 작성해주세요.
19 changes: 16 additions & 3 deletions refrigerator/.idea/modules/refrigerator.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jakarta.persistence.*;
import lombok.Data;
import moja.refrigerator.aggregate.ingredient.IngredientManagement;
import moja.refrigerator.aggregate.ingredient.IngredientMyRefrigerator;

@Data
@Entity
Expand All @@ -19,6 +20,7 @@ public class RecipeIngredient {
@JoinColumn(name = "ingredient_management")
@ManyToOne
private IngredientManagement ingredientManagement;
// private IngredientMyRefrigerator ingredientMyRefrigerator ;

@JoinColumn(name = "recipe")
@ManyToOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import moja.refrigerator.dto.recipe.request.RecipeCreateRequest;
import moja.refrigerator.dto.recipe.request.RecipeUpdateRequest;
import moja.refrigerator.dto.recipe.response.RecipeDetailResponse;
import moja.refrigerator.dto.recipe.response.RecipeRecommendResponse;
import moja.refrigerator.dto.recipe.response.RecipeResponse;
import moja.refrigerator.service.recipe.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -52,4 +53,9 @@ public void updateRecipe(
){
recipeService.updateRecipe(request,files);
}

@GetMapping("/recommend")
public List<RecipeRecommendResponse> getRecommendedRecipes(@RequestParam Long userPk) {
return recipeService.getRecommendedRecipes(userPk);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package moja.refrigerator.dto.recipe;

import lombok.AllArgsConstructor;
import lombok.Data;
import moja.refrigerator.aggregate.recipe.Recipe;

@Data
@AllArgsConstructor
public class RecipeMatchResult {
private Recipe recipe;
private boolean matched;
private double matchRate;
private long remainExpirationDays;
private String urgentIngredientName;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package moja.refrigerator.dto.recipe.response;

import lombok.Data;

@Data
public class RecipeRecommendResponse {
private long recipePk;
private String recipeName;
private String recipeContent;
private int recipeCookingTime;
private double matchRate;
private long remainExpirationDays;
private String urgentIngredientName;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package moja.refrigerator.repository.recipe;

import moja.refrigerator.aggregate.recipe.Recipe;
import moja.refrigerator.aggregate.recipe.RecipeIngredient;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RecipeIngredientRepository extends JpaRepository<RecipeIngredient, Long> {
List<RecipeIngredient> findByRecipe(Recipe recipe);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package moja.refrigerator.repository.recipe;

import moja.refrigerator.aggregate.recipe.RecipeIngredient;
import moja.refrigerator.aggregate.recipe.ReplacableIngredient;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ReplacableIngredientRepository extends JpaRepository<ReplacableIngredient, Long> {
List<ReplacableIngredient> findByRecipeIngredient(RecipeIngredient recipeIngredient);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import moja.refrigerator.dto.recipe.request.RecipeCreateRequest;
import moja.refrigerator.dto.recipe.request.RecipeUpdateRequest;
import moja.refrigerator.dto.recipe.response.RecipeDetailResponse;
import moja.refrigerator.dto.recipe.response.RecipeRecommendResponse;
import moja.refrigerator.dto.recipe.response.RecipeResponse;
import moja.refrigerator.repository.recipe.RecipeRepository;
import org.springframework.stereotype.Service;
Expand All @@ -22,4 +23,5 @@ void updateRecipe(
RecipeUpdateRequest request
,List<MultipartFile> files
);
List<RecipeRecommendResponse> getRecommendedRecipes(Long userPk);
}
Loading