Skip to content

Commit

Permalink
Merge pull request #88 from Clubber2024/#87-refactor-imageurl-관련-api-수정
Browse files Browse the repository at this point in the history
refactor : imageurl 관련 api 수정
  • Loading branch information
sseongeun authored May 20, 2024
2 parents 369f193 + cb8283a commit ef92a53
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ public class OneClubDto {
private String division;
private String college;
private String department;
private String imageUrl;
private OneClubInfoDto clubInfo;

@Builder
public OneClubDto(Long clubId,String clubName,String clubType,String introduction,String hashTag,String division,String college,String department,OneClubInfoDto clubInfo)
public OneClubDto(Long clubId,String clubName,String clubType,String introduction,String hashTag,String division,String college,String department,String imageUrl,OneClubInfoDto clubInfo)
{
this.clubId=clubId;
this.clubName=clubName;
Expand All @@ -26,6 +27,7 @@ public OneClubDto(Long clubId,String clubName,String clubType,String introductio
this.division=division;
this.college=college;
this.department=department;
this.imageUrl=imageUrl;
this.clubInfo=clubInfo;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
@Data
public class SimpleCenterDto { //clubId,clubName을 반환함
private Long clubId;
private String imageUrl;
private String clubName;
private String introduction; //동아리에 대한 설명도 들처가야함

@Builder
public SimpleCenterDto(Long clubId,String clubName,String introduction){
public SimpleCenterDto(Long clubId,String imageUrl,String clubName,String introduction){
this.clubId=clubId;
this.imageUrl=imageUrl;
this.clubName=clubName;
this.introduction=introduction;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ClubService {
public DivisionCenterDto getClubDivision(String division){
List<Club> clubs = clubRepository.findByClubTypeAndDivision("center", division);
List<SimpleCenterDto> clubDtos = clubs.stream()
.map(club -> new SimpleCenterDto(club.getId(), club.getName(),club.getIntroduction()))
.map(club -> new SimpleCenterDto(club.getId(), club.getImageUrl(),club.getName(),club.getIntroduction()))
.collect(Collectors.toList());
return new DivisionCenterDto(division, clubDtos);

Expand All @@ -68,7 +68,7 @@ public DivisionCenterDto getClubDivision(String division){
public DepartmentSmallDto getOneDepartmentClubs(String department){
List<Club> clubs=clubRepository.findByDepartment(department);
List<SimpleCenterDto> clubDtos = clubs.stream()
.map(club -> new SimpleCenterDto(club.getId(), club.getName(),club.getIntroduction()))
.map(club -> new SimpleCenterDto(club.getId(), club.getImageUrl(),club.getName(),club.getIntroduction()))
.collect(Collectors.toList());
return new DepartmentSmallDto(department, clubDtos);

Expand Down Expand Up @@ -98,6 +98,7 @@ private OneClubDto convertToClubDto(Club club){
club.getDivision(),
club.getCollege(),
club.getDepartment(),
club.getImageUrl(),
oneClubInfo
);
}
Expand All @@ -117,7 +118,7 @@ public OneClubDto getClubByName(String clubName) {
public HashtagDto getClubHashtag(String hashtag){
List<Club> clubs = clubRepository.findByHashtag(hashtag);
List<SimpleCenterDto> clubDtos = clubs.stream()
.map(club -> new SimpleCenterDto(club.getId(), club.getName(),club.getIntroduction()))
.map(club -> new SimpleCenterDto(club.getId(),club.getImageUrl(), club.getName(),club.getIntroduction()))
.collect(Collectors.toList());
return new HashtagDto(hashtag,clubDtos);

Expand Down

0 comments on commit ef92a53

Please sign in to comment.