diff --git a/needeachother/src/main/java/com/neo/needeachother/category/application/CategoryVoteFilterService.java b/needeachother/src/main/java/com/neo/needeachother/category/application/CategoryVoteFilterService.java new file mode 100644 index 0000000..274b46c --- /dev/null +++ b/needeachother/src/main/java/com/neo/needeachother/category/application/CategoryVoteFilterService.java @@ -0,0 +1,37 @@ +package com.neo.needeachother.category.application; + +import com.neo.needeachother.category.domain.Category; +import com.neo.needeachother.category.domain.CategoryId; +import com.neo.needeachother.category.domain.domainservice.ConfirmCategoryChangeableAdminService; +import com.neo.needeachother.category.domain.repository.CategoryRepository; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import static com.neo.needeachother.category.application.CategoryServiceHelper.*; + +@Service +@RequiredArgsConstructor +public class CategoryVoteFilterService { + + private final CategoryRepository categoryRepository; + private final ConfirmCategoryChangeableAdminService confirmCategoryChangeableAdminService; + + @Transactional + public void modifyFilteringRate(CategoryId categoryId, String email, int changingRate){ + Category foundCategory = findExistingCategory(categoryRepository, categoryId); + foundCategory.modifyFilteringRate(confirmCategoryChangeableAdminService, email, changingRate); + } + + @Transactional + public void useFilter(CategoryId categoryId, String email){ + Category foundCategory = findExistingCategory(categoryRepository, categoryId); + foundCategory.turnOnCommentRatingFilter(confirmCategoryChangeableAdminService, email); + } + + @Transactional + public void notUseFilter(CategoryId categoryId, String email){ + Category foundCategory = findExistingCategory(categoryRepository, categoryId); + foundCategory.turnOffCommentRatingFilter(confirmCategoryChangeableAdminService, email); + } +} diff --git a/needeachother/src/main/java/com/neo/needeachother/category/application/ModifyCategoryInformationService.java b/needeachother/src/main/java/com/neo/needeachother/category/application/ModifyCategoryInformationService.java new file mode 100644 index 0000000..89e8ab2 --- /dev/null +++ b/needeachother/src/main/java/com/neo/needeachother/category/application/ModifyCategoryInformationService.java @@ -0,0 +1,25 @@ +package com.neo.needeachother.category.application; + +import com.neo.needeachother.category.domain.Category; +import com.neo.needeachother.category.domain.CategoryId; +import com.neo.needeachother.category.domain.domainservice.ConfirmCategoryChangeableAdminService; +import com.neo.needeachother.category.domain.repository.CategoryRepository; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import static com.neo.needeachother.category.application.CategoryServiceHelper.*; + +@Service +@RequiredArgsConstructor +public class ModifyCategoryInformationService { + + private final CategoryRepository categoryRepository; + private final ConfirmCategoryChangeableAdminService confirmCategoryChangeableAdminService; + + @Transactional + public void changeCategoryTitle(CategoryId categoryId, String email, String title){ + Category foundCategory = findExistingCategory(categoryRepository, categoryId); + foundCategory.modifyCategoryTitle(confirmCategoryChangeableAdminService, email, title); + } +} diff --git a/needeachother/src/main/java/com/neo/needeachother/category/application/ModifyCategoryStatusService.java b/needeachother/src/main/java/com/neo/needeachother/category/application/ModifyCategoryStatusService.java index ca0953f..eb6b758 100644 --- a/needeachother/src/main/java/com/neo/needeachother/category/application/ModifyCategoryStatusService.java +++ b/needeachother/src/main/java/com/neo/needeachother/category/application/ModifyCategoryStatusService.java @@ -29,4 +29,10 @@ public void deleteCategory(CategoryId id, String email){ foundCategory.deleteCategory(confirmCategoryChangeableAdminService, email); } + @Transactional + public void exposureCategory(CategoryId id, String email){ + Category foundCategory = findExistingCategory(categoryRepository, id); + foundCategory.exposureCategory(confirmCategoryChangeableAdminService, email); + } + }