Skip to content

Commit

Permalink
feat: 필터 생성 시 member 필드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
capDoYeonLee committed Oct 13, 2024
1 parent 445a905 commit aaeb4a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -48,6 +48,7 @@ public CreateFilterResponse createFilter(final CreateFilterRequest request) {

@Override
public List<AllFilterResponse> getFilter() {
// 필터를 조회할 때, 모든 데이터에서 param memberId와 같은 데이터만 조회하자
List<FilterModel> model = filterEntitiesByAll();
return responseConverter.toAllModel(model);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -30,8 +31,9 @@ public class FilterController {

@PostMapping
public ApiResponse<ApiResponseBody.SuccessBody<CreateFilterResponse>> 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);
}

Expand Down

0 comments on commit aaeb4a6

Please sign in to comment.