diff --git a/BE/error/src/main/java/com/example/demo/filter/application/service/FilterService.java b/BE/error/src/main/java/com/example/demo/filter/application/service/FilterService.java index f3e1784..7d5d589 100644 --- a/BE/error/src/main/java/com/example/demo/filter/application/service/FilterService.java +++ b/BE/error/src/main/java/com/example/demo/filter/application/service/FilterService.java @@ -37,9 +37,9 @@ public class FilterService implements private final FilterResponseConverter responseConverter; - @Override + @Transactional - public CreateFilterResponse createFilter(final CreateFilterRequest request) { + public CreateFilterResponse createFilter(final CreateFilterRequest request, final Long memberId) { FilterModel model = requestConverter.from(request); FilterEntity entity = entityConverter.toEntity(model); FilterEntity save = filterRepository.save(entity); @@ -48,6 +48,7 @@ public CreateFilterResponse createFilter(final CreateFilterRequest request) { @Override public List getFilter() { + // 필터를 조회할 때, 모든 데이터에서 param memberId와 같은 데이터만 조회하자 List model = filterEntitiesByAll(); return responseConverter.toAllModel(model); } diff --git a/BE/error/src/main/java/com/example/demo/filter/application/usecase/CreateFilterUsecase.java b/BE/error/src/main/java/com/example/demo/filter/application/usecase/CreateFilterUsecase.java index 5161f3b..0c4d566 100644 --- a/BE/error/src/main/java/com/example/demo/filter/application/usecase/CreateFilterUsecase.java +++ b/BE/error/src/main/java/com/example/demo/filter/application/usecase/CreateFilterUsecase.java @@ -4,5 +4,5 @@ import com.example.demo.filter.application.dto.CreateFilterResponse; public interface CreateFilterUsecase { - CreateFilterResponse createFilter(CreateFilterRequest request); + CreateFilterResponse createFilter(CreateFilterRequest request, Long memberId); } diff --git a/BE/error/src/main/java/com/example/demo/filter/presentation/FilterController.java b/BE/error/src/main/java/com/example/demo/filter/presentation/FilterController.java index f2b6dec..8dbe3e4 100644 --- a/BE/error/src/main/java/com/example/demo/filter/presentation/FilterController.java +++ b/BE/error/src/main/java/com/example/demo/filter/presentation/FilterController.java @@ -1,5 +1,6 @@ package com.example.demo.filter.presentation; +import com.example.demo.auth.application.support.Member; import com.example.demo.common.presentation.response.ApiResponse; import com.example.demo.common.presentation.response.ApiResponseBody; import com.example.demo.common.presentation.response.ApiResponseGenerator; @@ -30,8 +31,9 @@ public class FilterController { @PostMapping public ApiResponse> createFilter( - @RequestBody CreateFilterRequest request) { - CreateFilterResponse response = createFilterUsecase.createFilter(request); + @RequestBody CreateFilterRequest request, + Long memberId) { + CreateFilterResponse response = createFilterUsecase.createFilter(request, memberId); return ApiResponseGenerator.success(response, HttpStatus.OK, MessageCode.CREATE); }