-
Notifications
You must be signed in to change notification settings - Fork 1
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
16 changed files
with
489 additions
and
65 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
2 changes: 2 additions & 0 deletions
2
...ion-server/src/main/java/de/tum/in/www1/hephaestus/gitprovider/label/LabelRepository.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,8 +1,10 @@ | ||
package de.tum.in.www1.hephaestus.gitprovider.label; | ||
|
||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface LabelRepository extends JpaRepository<Label, Long> { | ||
Optional<Label> findByName(String name); | ||
} |
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
19 changes: 17 additions & 2 deletions
19
...lication-server/src/main/java/de/tum/in/www1/hephaestus/gitprovider/team/TeamInfoDTO.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,9 +1,24 @@ | ||
package de.tum.in.www1.hephaestus.gitprovider.team; | ||
|
||
import de.tum.in.www1.hephaestus.gitprovider.label.LabelInfoDTO; | ||
import de.tum.in.www1.hephaestus.gitprovider.repository.RepositoryInfoDTO; | ||
import java.util.List; | ||
import org.springframework.lang.NonNull; | ||
|
||
public record TeamInfoDTO(@NonNull Long id, @NonNull String name, @NonNull String color) { | ||
public record TeamInfoDTO( | ||
@NonNull Long id, | ||
@NonNull String name, | ||
@NonNull String color, | ||
@NonNull List<RepositoryInfoDTO> repositories, | ||
@NonNull List<LabelInfoDTO> labels | ||
) { | ||
public static TeamInfoDTO fromTeam(Team team) { | ||
return new TeamInfoDTO(team.getId(), team.getName(), team.getColor()); | ||
return new TeamInfoDTO( | ||
team.getId(), | ||
team.getName(), | ||
team.getColor(), | ||
team.getRepositories().stream().map(RepositoryInfoDTO::fromRepository).toList(), | ||
team.getLabels().stream().map(LabelInfoDTO::fromLabel).toList() | ||
); | ||
} | ||
} |
Oops, something went wrong.