Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

โ™ป๏ธ ๐Ÿ”จ Refactor/321 ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์šด์˜ ์ฝ”๋“œ์— ์ ์šฉ, ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ๋ถ„๋ฆฌ #322

Merged
merged 1 commit into from
Feb 23, 2024
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
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ dependencies {
//FCM ์˜์กด์„ฑ
implementation 'com.google.firebase:firebase-admin:9.1.1'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version : '4.2.2'
testImplementation 'org.projectlombok:lombok:1.18.22'
testImplementation 'org.projectlombok:lombok:1.18.22'

annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jpa"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
Expand Down
333 changes: 26 additions & 307 deletions src/main/java/zipdabang/server/converter/RecipeConverter.java

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/main/java/zipdabang/server/domain/recipe/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ public Recipe updateView(){
return this;
}

public Recipe updateInfo(RecipeRequestDto.UpdateRecipeDto request) {
public Recipe updateInfo(RecipeRequestDto.SetRecipeWithImageUrlDto request) {
this.name = request.getName();
this.intro = request.getIntro();
this.recipeTip = request.getRecipeTip();
this.time = request.getTime();
this.thumbnailUrl = request.getThumbnailUrl();

return this;
}
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/zipdabang/server/domain/recipe/TempRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,12 @@ public class TempRecipe extends BaseEntity {
private List<TempIngredient> ingredientList;


public TempRecipe setThumbnail(String imageUrl) {
log.info("setThumbnail ํ˜ธ์ถœ๋จ");
this.thumbnailUrl = imageUrl;
return this;
}

public TempRecipe updateInfo(RecipeRequestDto.TempRecipeDto request) {
public TempRecipe updateInfo(RecipeRequestDto.SetRecipeWithImageUrlDto request) {
this.name = request.getName();
this.intro = request.getIntro();
this.recipeTip = request.getRecipeTip();
this.time = request.getTime();
this.thumbnailUrl =request.getThumbnailUrl();

return this;
}
Expand Down
22 changes: 5 additions & 17 deletions src/main/java/zipdabang/server/service/RecipeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.springframework.web.multipart.MultipartFile;
import zipdabang.server.domain.member.Member;
import zipdabang.server.domain.recipe.*;
import zipdabang.server.domain.test.TestRecipe;
import zipdabang.server.web.dto.requestDto.RecipeRequestDto;
import zipdabang.server.web.dto.responseDto.RecipeResponseDto;

Expand Down Expand Up @@ -39,9 +38,6 @@ public interface RecipeService {

List<List<Recipe>> searchRecipePreview(String keyword, Member member);


boolean checkRecipeCategoryExist(Long categoryId);

Boolean deleteRecipe(Long recipeId, Member member);

Comment createComment(String content, Long recipeId, Member member);
Expand All @@ -56,9 +52,9 @@ public interface RecipeService {

Long reportRecipe(Long recipeId, Long reportId, Member member);

TempRecipe tempCreate(RecipeRequestDto.TempRecipeDto request, MultipartFile thumbnail, List<MultipartFile> stepImages, Member member) throws IOException;
TempRecipe tempCreate(RecipeRequestDto.SetRecipeWithImageUrlDto request, Member member);

TempRecipe tempUpdate(Long tempId, RecipeRequestDto.TempRecipeDto request, MultipartFile thumbnail, List<MultipartFile> stepImages, Member member) throws IOException;
TempRecipe tempUpdate(Long tempId, RecipeRequestDto.SetRecipeWithImageUrlDto request);

List<Recipe> getTop5RecipePerCategory(Long categoryId);

Expand All @@ -79,8 +75,6 @@ public interface RecipeService {

Page<TempRecipe> getTempRecipeList(Integer pageIndex, Member member);

Recipe update(Long recipeId, RecipeRequestDto.UpdateRecipeDto request, MultipartFile thumbnail, List<MultipartFile> stepImages, Member member) throws IOException;

List<Recipe> getMyRecipePreview(Member member);

Page<Recipe> getMyRecipeList(Integer pageIndex, Member member);
Expand All @@ -97,19 +91,13 @@ public interface RecipeService {

Long searchRecipeCounting(Long categoryId, String keyword, Member member);

Long getrecipeListByCategoryCounting(Long categoryId, Member member);
Long getRecipeListByCategoryCounting(Long categoryId, Member member);

Long getWrittenByRecipeCounting(String writtenby, Member member);

Long getCommentCount(Recipe recipe, Member member);

TestRecipe testCreate(RecipeRequestDto.CreateRecipeDto request, MultipartFile thumbnail, List<MultipartFile> stepImages) throws IOException;

TestRecipe getTestRecipe(Long recipeId);

Page<TestRecipe> testRecipeListByCategory(Long categoryId, Integer pageIndex, String order);

Boolean deleteTestRecipe();
Recipe createWithImageUrl(RecipeRequestDto.SetRecipeWithImageUrlDto request, Member member);

TestRecipe testCreateWithImageUrl(RecipeRequestDto.CreateRecipeWithImageUrlDto request);
Recipe update(Long recipeId, RecipeRequestDto.SetRecipeWithImageUrlDto request, Member member);
}
Loading
Loading