-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
271 additions
and
40 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/main/java/com/gongjakso/server/domain/apply/dto/response/SimpleApplyRes.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,39 @@ | ||
package com.gongjakso.server.domain.apply.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.gongjakso.server.domain.apply.entity.Apply; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public record SimpleApplyRes( | ||
@NotNull | ||
Long applyId, | ||
|
||
@NotNull | ||
Long teamId, | ||
|
||
@NotNull | ||
Long memberId, | ||
String memberName, | ||
Long portfolioId, | ||
String portfolioName, | ||
String status, | ||
String part, | ||
Boolean isViewed | ||
) { | ||
public static SimpleApplyRes of(Apply apply){ | ||
return SimpleApplyRes.builder() | ||
.applyId(apply.getId()) | ||
.teamId(apply.getTeam().getId()) | ||
.memberId(apply.getMember().getId()) | ||
.memberName(apply.getMember().getName()) | ||
.portfolioId(apply.getPortfolioInfo().getPortfolio() != null ? apply.getPortfolioInfo().getPortfolio().getId() : null) | ||
.portfolioName(apply.getPortfolioInfo().getPortfolio() != null ? apply.getPortfolioInfo().getPortfolio().getPortfolioName() : null) | ||
.status(apply.getStatus().name()) | ||
.part(apply.getPart()) | ||
.isViewed(apply.isViewed()) | ||
.build(); | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
src/main/java/com/gongjakso/server/domain/portfolio/dto/response/ExistPortfolioRes.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,15 @@ | ||
package com.gongjakso.server.domain.portfolio.dto.response; | ||
|
||
import com.gongjakso.server.domain.portfolio.entity.Portfolio; | ||
|
||
public record ExistPortfolioRes( | ||
String fileUri, | ||
String notionUri | ||
) { | ||
public static ExistPortfolioRes of(Portfolio portfolio) { | ||
return new ExistPortfolioRes( | ||
portfolio.getFileUri(), | ||
portfolio.getNotionUri() | ||
); | ||
} | ||
} |
16 changes: 11 additions & 5 deletions
16
src/main/java/com/gongjakso/server/domain/portfolio/dto/response/SimplePortfolioRes.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,19 +1,25 @@ | ||
package com.gongjakso.server.domain.portfolio.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.gongjakso.server.domain.portfolio.entity.Portfolio; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public record SimplePortfolioRes( | ||
Long PortfolioId, | ||
String PortfolioName, | ||
LocalDateTime modifiedAt | ||
LocalDateTime modifiedAt, | ||
Boolean isRegistered, | ||
Boolean isExistedPortfolio | ||
) { | ||
public static SimplePortfolioRes of(Portfolio portfolio) { | ||
public static SimplePortfolioRes of(Portfolio portfolio, Boolean isRegistered, Boolean isExistedPortfolio) { | ||
return new SimplePortfolioRes( | ||
portfolio.getId(), | ||
portfolio.getPortfolioName(), | ||
portfolio.getModifiedAt() | ||
isRegistered ? portfolio.getId() : null, | ||
isRegistered ? portfolio.getPortfolioName() : null, | ||
isRegistered ? portfolio.getModifiedAt() : null, | ||
isRegistered, | ||
isExistedPortfolio | ||
); | ||
} | ||
} |
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
5 changes: 4 additions & 1 deletion
5
src/main/java/com/gongjakso/server/domain/portfolio/repository/PortfolioRepository.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,11 +1,14 @@ | ||
package com.gongjakso.server.domain.portfolio.repository; | ||
|
||
import com.gongjakso.server.domain.member.entity.Member; | ||
import com.gongjakso.server.domain.portfolio.entity.Portfolio; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface PortfolioRepository extends JpaRepository<Portfolio, Long>, PortfolioRepositoryCustom{ | ||
Optional<Portfolio> findByIdAndDeletedAtIsNull(Long portfolioId); | ||
|
||
long countByDeletedAtIsNull(); | ||
Optional<Portfolio> findPortfolioById(Long portfolioId); | ||
} |
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
Oops, something went wrong.