Skip to content

Commit

Permalink
Merge pull request #68 from Clubber2024/refactor/#67-clubclubinfo-con…
Browse files Browse the repository at this point in the history
…tent-필드값-수정

refactor : clubclubinfo content 필드값 수정
  • Loading branch information
sseongeun authored May 14, 2024
2 parents 7b550a1 + 9086367 commit 6a9bf22
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@ public class ClubController {
// 중앙동아리 - 분과별 동아리 조회
@GetMapping(params="division")
public DivisionCenterDto getCentersByDivision(@RequestParam("division")String division){
DivisionCenterDto clubs=clubService.getClubDivision(division);
return clubs;

return clubService.getClubDivision(division);
}


// 소모임 - 학과별 소모임 조회
@GetMapping(params="department")
public DepartmentSmallDto getSmallsByDepartment(@RequestParam("department")String department){
DepartmentSmallDto clubs=clubService.getOneDepartmentClubs(department);
return clubs;
return clubService.getOneDepartmentClubs(department);
}


Expand All @@ -43,10 +40,7 @@ public DepartmentSmallDto getSmallsByDepartment(@RequestParam("department")Strin
// 개별 동아리 및 소모임 페이지 조회
@GetMapping("/{clubId}") //중앙동아리 및 소모임 개별 페이지 조회
public OneClubDto getOneClubInfo(@PathVariable("clubId")Long clubId){
OneClubDto club=clubService.getIndividualPage(clubId);
return club;
return clubService.getIndividualPage(clubId);
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class PopularSortController {
private final ClubService clubService;
@GetMapping("/v1/popular")
public List<PopularClubDto> getTop10PopularClubs(){
List<PopularClubDto> top10=clubService.getPopularClubs();
return top10;
return clubService.getPopularClubs();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ public class SearchController {
// hashtag 기반 검색
@GetMapping(params="hashtag")
public HashtagDto searchByHashtag(@RequestParam("hashtag")String hashtag){
HashtagDto clubs=clubService.getClubHashtag(hashtag);
return clubs;
return clubService.getClubHashtag(hashtag);

}

// 동아리명 or 소모임명 기반 검색
@GetMapping(params="clubName")
public OneClubDto searchByClubName(@RequestParam("clubName")String clubName){
OneClubDto club=clubService.getClubByName(clubName);
return club;
return clubService.getClubByName(clubName);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Club extends BaseEntity {
@NotNull
private String clubType;

private String content;
private String introduction;

private String hashtag;

Expand All @@ -42,11 +42,11 @@ public class Club extends BaseEntity {
private ClubInfo clubInfo;

@Builder
private Club(Long id, String name, String clubType,String content,String hashtag,String division, String college, String department,ClubInfo clubInfo) {
private Club(Long id, String name, String clubType,String introduction,String hashtag,String division, String college, String department,ClubInfo clubInfo) {
this.id = id;
this.name=name;
this.clubType=clubType;
this.content=content;
this.introduction=introduction;
this.hashtag=hashtag;
this.division = division;
this.college = college;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ public class OneClubDto {
private Long clubId;
private String clubName;
private String clubType;
private String content;
private String introduction;
private String hashTag;
private String division;
private String college;
private String department;
private OneClubInfoDto clubInfo;

@Builder
public OneClubDto(Long clubId,String clubName,String clubType,String content,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,OneClubInfoDto clubInfo)
{
this.clubId=clubId;
this.clubName=clubName;
this.clubType=clubType;
this.content=content;
this.introduction=introduction;
this.hashTag=hashTag;
this.division=division;
this.college=college;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
public class SimpleCenterDto { //clubId,clubName을 반환함
private Long clubId;
private String clubName;
private String clubContent; //동아리에 대한 설명도 들처가야함
private String introdution; //동아리에 대한 설명도 들처가야함

@Builder
public SimpleCenterDto(Long clubId,String clubName,String clubContent){
public SimpleCenterDto(Long clubId,String clubName,String introduction){
this.clubId=clubId;
this.clubName=clubName;
this.clubContent=clubContent;
this.introdution=introduction;
}

}
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.getContent()))
.map(club -> new SimpleCenterDto(club.getId(), 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.getContent()))
.map(club -> new SimpleCenterDto(club.getId(), club.getName(),club.getIntroduction()))
.collect(Collectors.toList());
return new DepartmentSmallDto(department, clubDtos);

Expand All @@ -93,7 +93,7 @@ private OneClubDto convertToClubDto(Club club){
club.getId(),
club.getName(),
club.getClubType(),
club.getContent(),
club.getIntroduction(),
club.getHashtag(),
club.getDivision(),
club.getCollege(),
Expand All @@ -117,7 +117,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.getContent()))
.map(club -> new SimpleCenterDto(club.getId(), club.getName(),club.getIntroduction()))
.collect(Collectors.toList());
return new HashtagDto(hashtag,clubDtos);

Expand Down

0 comments on commit 6a9bf22

Please sign in to comment.