Skip to content

Commit

Permalink
Merge pull request #47 from How-homework-out/master
Browse files Browse the repository at this point in the history
[feat] 운동 상세에  이미지 추가
  • Loading branch information
ryulkim authored Nov 21, 2023
2 parents 76bd5d1 + 9d4a86f commit 8a99690
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package inha.how.Domain.dto.Excercise;

import com.fasterxml.jackson.annotation.JsonProperty;

public interface ImgUrlMapping {
@JsonProperty("img")
String getExImgIdImgUrl();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -18,7 +19,7 @@ public class RoutinneDetailResult {
private Long count;
private Long rest;
private Long order;
//private List<String> img;
private List<ImgUrlMapping> img;
private List<CateInfoMapping> cate;

}
10 changes: 8 additions & 2 deletions src/main/java/inha/how/Service/RoutineService.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<Routine> routineList;
Expand Down Expand Up @@ -84,12 +90,12 @@ public RoutineDetailRes findRoutineOne(Long id){
routineDetails.forEach((detail)->{

//이미지

List<ImgUrlMapping> exImgList = exImgRepository.findExImgByExImgIdEx(detail.getEx());

//운동 부위
List<CateInfoMapping> 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));


});
Expand Down

0 comments on commit 8a99690

Please sign in to comment.