diff --git a/src/main/java/inha/how/Domain/dto/Excercise/ImgUrlMapping.java b/src/main/java/inha/how/Domain/dto/Excercise/ImgUrlMapping.java index db988bf..22921ed 100644 --- a/src/main/java/inha/how/Domain/dto/Excercise/ImgUrlMapping.java +++ b/src/main/java/inha/how/Domain/dto/Excercise/ImgUrlMapping.java @@ -1,5 +1,8 @@ package inha.how.Domain.dto.Excercise; +import com.fasterxml.jackson.annotation.JsonProperty; + public interface ImgUrlMapping { + @JsonProperty("img") String getExImgIdImgUrl(); } diff --git a/src/main/java/inha/how/Domain/dto/routine/RoutinneDetailResult.java b/src/main/java/inha/how/Domain/dto/routine/RoutinneDetailResult.java index 23bbf7e..2946203 100644 --- a/src/main/java/inha/how/Domain/dto/routine/RoutinneDetailResult.java +++ b/src/main/java/inha/how/Domain/dto/routine/RoutinneDetailResult.java @@ -1,6 +1,7 @@ package inha.how.Domain.dto.routine; import inha.how.Domain.dto.Excercise.CateInfoMapping; +import inha.how.Domain.dto.Excercise.ImgUrlMapping; import inha.how.Domain.entity.Excersise; import lombok.AllArgsConstructor; import lombok.Getter; @@ -18,7 +19,7 @@ public class RoutinneDetailResult { private Long count; private Long rest; private Long order; - //private List img; + private List img; private List cate; } diff --git a/src/main/java/inha/how/Service/RoutineService.java b/src/main/java/inha/how/Service/RoutineService.java index cbb43ef..c86f170 100644 --- a/src/main/java/inha/how/Service/RoutineService.java +++ b/src/main/java/inha/how/Service/RoutineService.java @@ -1,10 +1,13 @@ package inha.how.Service; import inha.how.Domain.dto.Excercise.CateInfoMapping; +import inha.how.Domain.dto.Excercise.ImgUrlMapping; import inha.how.Domain.dto.routine.*; import inha.how.Domain.entity.*; import inha.how.Repository.Ex.ExCateRepository; +import inha.how.Repository.Ex.ExImgRepository; import inha.how.Repository.Ex.ExRepository; +import inha.how.Repository.ImgRepository; import inha.how.Repository.Routine.MyRoutineReposiotry; import inha.how.Repository.Routine.RoutineDetailRepository; import inha.how.Repository.Routine.RoutineRepository; @@ -28,6 +31,9 @@ public class RoutineService { private final MyRoutineReposiotry myRoutineReposiotry; private final ExRepository exRepository; private final ExCateRepository exCateRepository; + private final ExImgRepository exImgRepository; + private final ImgRepository imgRepository; + public allRoutineRes findRountines(Boolean type){ List routineList; @@ -84,12 +90,12 @@ public RoutineDetailRes findRoutineOne(Long id){ routineDetails.forEach((detail)->{ //이미지 - + List exImgList = exImgRepository.findExImgByExImgIdEx(detail.getEx()); //운동 부위 List excersiseList=findExCate(detail); - routineDetailResults.add(new RoutinneDetailResult(detail.getId(), detail.getEx(), detail.getType(), detail.getSet(), detail.getTime(), detail.getCount(), detail.getRest(), detail.getOrder(), excersiseList)); + routineDetailResults.add(new RoutinneDetailResult(detail.getId(), detail.getEx(), detail.getType(), detail.getSet(), detail.getTime(), detail.getCount(), detail.getRest(), detail.getOrder(), exImgList, excersiseList)); });