Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public interface JectalkApiSpec {
)
Page<JectalkResponse> findJectalks(
@PageableDefault(size = 12) Pageable pageable,
@Parameter(description = "기수 (SEMESTER_1, SEMESTER_2, SEMESTER_3)", example = "SEMESTER_1")
@Parameter(description = "기수 (SEMESTER_1, SEMESTER_2, SEMESTER_3, SEMESTER_4)", example = "SEMESTER_1")
@RequestParam(required = false) Project.Category category);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public record ProjectDetailResponse(
List<String> badges,
String description,
String serviceUrl,
String githubUrl,
ProjectIntroResponse bannerImageUrl,
List<ProjectIntroResponse> sampleImageUrls,
List<ProjectIntroResponse> descriptionImageUrls
Expand All @@ -41,6 +42,7 @@ public static ProjectDetailResponse toResponse(Project project,
.badges(project.getBadges())
.description(project.getDescription())
.serviceUrl(project.getServiceUrl())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

의도하신 대로라면 두 url의 동시 존재 여부를 서비스 로직에서 검증하는게 안전해 보입니다! 다만 메인 로직이나 도메인은 아니라서 당장은 이정도도 충분해보이는데 검증 로직이 없다면 주석으로라도 현재 정책을 남겨두면 추후 개선이나 파악할 때 좋을 것 같습니다!

.githubUrl(project.getGithubUrl())
.bannerImageUrl(bannerImageUrl)
.sampleImageUrls(sampleImageUrls)
.descriptionImageUrls(descriptionImageUrls)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class Project extends BaseTimeEntity {
@Column(length = 2083)
private String serviceUrl;

@Column(length = 2083)
private String githubUrl;

@Column(length = 50, nullable = false)
private String serviceType;

Expand All @@ -90,7 +93,8 @@ public enum Category {

SEMESTER_1(1, "1기"),
SEMESTER_2(2, "2기"),
SEMESTER_3(3, "3기");
SEMESTER_3(3, "3기"),
SEMESTER_4(4, "4기");

private final int order;
private final String displayName;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE project
ADD COLUMN github_url VARCHAR(2083) NULL AFTER service_url;
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ void setUp() {
.description("description")
.thumbnailUrl("thumbnail.png")
.serviceUrl("service.com")
.githubUrl("https://github.com/JECT-Study/project")
.team(Team.builder().id(1L).name("team").semesterId(1L).build())
.projectIntros(List.of(serviceIntro1, serviceIntro2, serviceIntro3, devIntro1))
.build();
Expand All @@ -82,6 +83,7 @@ void setUp() {
assertThat(result.endDate()).isEqualTo(project.getEndDate());
assertThat(result.description()).isEqualTo(project.getDescription());
assertThat(result.serviceUrl()).isEqualTo(project.getServiceUrl());
assertThat(result.githubUrl()).isEqualTo(project.getGithubUrl());
assertThat(result.sampleImageUrls()).hasSize(3);
assertThat(result.descriptionImageUrls()).hasSize(1);
}
Expand Down Expand Up @@ -148,6 +150,9 @@ void setUp() {

assertThat(summary.categorySummaries().get(3).categoryName()).isEqualTo(Project.Category.SEMESTER_3.name());
assertThat(summary.categorySummaries().get(3).count()).isEqualTo(0L);

assertThat(summary.categorySummaries().get(4).categoryName()).isEqualTo(Project.Category.SEMESTER_4.name());
assertThat(summary.categorySummaries().get(4).count()).isEqualTo(0L);
}

private ProjectIntro createProjectIntro(Long id, String imageUrl, Category category, int sequence) {
Expand Down
Loading