diff --git a/src/main/java/com/kns/tenquest/controller/TemplateController.java b/src/main/java/com/kns/tenquest/controller/TemplateController.java index 8ab099c..55e58a8 100644 --- a/src/main/java/com/kns/tenquest/controller/TemplateController.java +++ b/src/main/java/com/kns/tenquest/controller/TemplateController.java @@ -39,7 +39,7 @@ public Response_Deprecated apiGetAllTemplates(){ @GetMapping("/templates/{memberId}") public Response_Deprecated> apiGetAllMemberTemplates(@PathVariable("memberId")String memberId){ ResponseStatus responseStatus = ResponseStatus.OK; - DtoList allMemberTemplates = templateService.getAllMemberTemplates(memberId); + DtoList allMemberTemplates = templateService.getAllTemplatesByMember(memberId); return new ResponseDto>(responseStatus,allMemberTemplates).toResponse(); } diff --git a/src/main/java/com/kns/tenquest/service/TemplateService.java b/src/main/java/com/kns/tenquest/service/TemplateService.java index 13d306c..75d95d9 100644 --- a/src/main/java/com/kns/tenquest/service/TemplateService.java +++ b/src/main/java/com/kns/tenquest/service/TemplateService.java @@ -2,10 +2,7 @@ import com.kns.tenquest.DtoList; import com.kns.tenquest.RequestWrapper.TemplateWrapper; -import com.kns.tenquest.dto.MemberDto; -import com.kns.tenquest.dto.QuestionDto; -import com.kns.tenquest.dto.TemplateDocDto; -import com.kns.tenquest.dto.TemplateDto; +import com.kns.tenquest.dto.*; import com.kns.tenquest.entity.Member; import com.kns.tenquest.entity.Question; import com.kns.tenquest.entity.Template; @@ -16,7 +13,6 @@ import com.kns.tenquest.repository.TemplateRepository; import io.micrometer.common.util.StringUtils; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.transaction.Transactional; @@ -32,11 +28,11 @@ public class TemplateService { private final MemberRepository memberRepository; private final QuestionRepository questionRepository; - public DtoList getAllTemplates(){ + public ServiceResult getAllTemplates(){ DtoList TemplateDtoList = new DtoList<>(templateRepository.findAll()); - return TemplateDtoList; + return new ServiceResult().success().data(TemplateDtoList); } - public DtoList getAllMemberTemplates(String templateOwner){ + public ServiceResult getAllTemplatesByMember(String templateOwner){ List