-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from Modagbul/feat/소모임
Feat/소모임
- Loading branch information
Showing
26 changed files
with
381 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...in/java/com/moing/backend/domain/team/application/dto/response/GetTeamDetailResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.moing.backend.domain.team.application.dto.response; | ||
|
||
import com.moing.backend.domain.team.domain.constant.Category; | ||
import com.querydsl.core.annotations.QueryProjection; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
public class GetTeamDetailResponse { | ||
private Integer boardNum; //안 읽은 게시글 | ||
private TeamInfo teamInfo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/com/moing/backend/domain/team/application/dto/response/TeamInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.moing.backend.domain.team.application.dto.response; | ||
|
||
import com.moing.backend.domain.team.domain.constant.Category; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
@Builder | ||
public class TeamInfo { | ||
private Boolean isDeleted; | ||
private LocalDateTime deletionTime; | ||
private String teamName; //소모임 이름 | ||
private Integer numOfMember; //소모임원 수 | ||
private Category category; //카테고리 | ||
private String introduction; //소개 | ||
private List<TeamMemberInfo> teamMemberInfoList = new ArrayList<>(); //소모임원 정보 | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/moing/backend/domain/team/application/dto/response/TeamMemberInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.moing.backend.domain.team.application.dto.response; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Builder | ||
public class TeamMemberInfo { | ||
private Long memberId; | ||
private String nickName; | ||
private String profileImage; | ||
private String introduction; | ||
private Boolean isLeader; | ||
|
||
@QueryProjection | ||
public TeamMemberInfo(Long memberId, String nickName, String profileImage, String introduction, Long leaderId){ | ||
this.memberId=memberId; | ||
this.nickName=nickName; | ||
this.profileImage=profileImage; | ||
this.introduction=introduction; | ||
this.isLeader=memberId.equals(leaderId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/moing/backend/domain/team/application/service/GetTeamUserCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,41 @@ | ||
package com.moing.backend.domain.team.application.service; | ||
|
||
import com.moing.backend.domain.board.domain.service.BoardGetService; | ||
import com.moing.backend.domain.member.domain.entity.Member; | ||
import com.moing.backend.domain.member.domain.service.MemberGetService; | ||
import com.moing.backend.domain.team.application.dto.response.GetTeamDetailResponse; | ||
import com.moing.backend.domain.team.application.dto.response.GetTeamResponse; | ||
import com.moing.backend.domain.team.application.dto.response.TeamMemberInfo; | ||
import com.moing.backend.domain.team.application.mapper.TeamMapper; | ||
import com.moing.backend.domain.team.domain.entity.Team; | ||
import com.moing.backend.domain.team.domain.service.TeamGetService; | ||
import com.moing.backend.domain.teamMember.domain.service.TeamMemberGetService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
import javax.transaction.Transactional; | ||
import java.util.List; | ||
|
||
@Service | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class GetTeamUserCase { | ||
private final MemberGetService memberGetService; | ||
private final TeamGetService teamGetService; | ||
private final BoardGetService boardGetService; | ||
private final TeamMemberGetService teamMemberGetService; | ||
private final TeamMapper teamMapper; | ||
|
||
public GetTeamResponse getTeam(String socialId) { | ||
Member member = memberGetService.getMemberBySocialId(socialId); | ||
return teamGetService.getTeamByMember(member); | ||
} | ||
|
||
public GetTeamDetailResponse getTeamDetailResponse(String socialId, Long teamId) { | ||
Member member = memberGetService.getMemberBySocialId(socialId); | ||
Integer boardNum = boardGetService.getUnReadBoardNum(teamId, member.getMemberId()); | ||
List<TeamMemberInfo> teamMemberInfoList = teamMemberGetService.getTeamMemberInfo(teamId); | ||
Team team = teamGetService.getTeamByTeamId(teamId); | ||
return teamMapper.toTeamDetailResponse(team, boardNum, teamMemberInfoList); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.