Skip to content

Commit

Permalink
fix: 스페이스 커스텀 폼 조회 응답에 폼아이디 추가 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
clean2001 authored Aug 4, 2024
1 parent f4344d2 commit 19dd56f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
@Builder
@Schema(name = "DefaultFormGetResponse", description = "커스텀 템플릿 조회 간단 정보 응답 Dto")
public record CustomTemplateResponse(
@NotNull
@Schema(description = "회고폼 ID", example = "1")
Long id,
@NotNull
@Schema(description = "회고폼 이름", example = "Mad Sad Glad 커스텀 템플릿")
String title,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
package org.layer.domain.form.service;

import static org.layer.common.exception.FormExceptionType.*;
import static org.layer.domain.form.entity.FormType.*;

import java.util.List;
import java.util.Optional;
import java.util.Random;

import lombok.RequiredArgsConstructor;
import org.layer.domain.form.controller.dto.request.FormNameUpdateRequest;
import org.layer.domain.form.controller.dto.request.RecommendFormQueryDto;
import org.layer.domain.form.controller.dto.response.CustomTemplateListResponse;
import org.layer.domain.form.controller.dto.response.CustomTemplateResponse;
import org.layer.domain.form.controller.dto.response.FormGetResponse;
import org.layer.domain.form.controller.dto.response.QuestionGetResponse;
import org.layer.domain.form.controller.dto.response.RecommendFormResponseDto;
import org.layer.domain.form.controller.dto.response.*;
import org.layer.domain.form.entity.Form;
import org.layer.domain.form.exception.FormException;
import org.layer.domain.form.repository.FormRepository;
Expand All @@ -31,7 +21,12 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import lombok.RequiredArgsConstructor;
import java.util.List;
import java.util.Optional;
import java.util.Random;

import static org.layer.common.exception.FormExceptionType.UNAUTHORIZED_GET_FORM;
import static org.layer.domain.form.entity.FormType.CUSTOM;

@Service
@RequiredArgsConstructor
Expand Down Expand Up @@ -111,7 +106,7 @@ public CustomTemplateListResponse getCustomTemplateList(Pageable pageable, Long

Page<Form> customFormList = formRepository.findAllByFormTypeOrderByIdDesc(pageable, CUSTOM);

Page<CustomTemplateResponse> customFormResList = customFormList.map(form -> new CustomTemplateResponse(form.getTitle(), form.getFormTag().getTag(), form.getCreatedAt()));
Page<CustomTemplateResponse> customFormResList = customFormList.map(form -> new CustomTemplateResponse(form.getId(), form.getTitle(), form.getFormTag().getTag(), form.getCreatedAt()));

return CustomTemplateListResponse.builder()
.customTemplateList(customFormResList)
Expand Down

0 comments on commit 19dd56f

Please sign in to comment.