-
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.
Merge pull request #72 from team-pofo/feat/search-projects
feat: 프로젝트 검색 기능 추가
- Loading branch information
Showing
27 changed files
with
453 additions
and
2,952 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
16 changes: 0 additions & 16 deletions
16
pofo-api/src/main/kotlin/org/pofo/api/dto/CreateProjectRequest.kt
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
pofo-api/src/main/kotlin/org/pofo/api/dto/ProjectCreateRequest.kt
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 org.pofo.api.dto | ||
|
||
import org.pofo.domain.rds.domain.project.ProjectCategory | ||
|
||
data class ProjectCreateRequest( | ||
val title: String, | ||
val bio: String? = null, | ||
val urls: List<String>? = null, | ||
val keyImageIndex: Int? = null, | ||
val imageUrls: List<String>? = null, | ||
val content: String, | ||
val category: ProjectCategory? = null, | ||
val stackNames: List<String>? = null, | ||
val isApproved: Boolean = false, | ||
) |
19 changes: 19 additions & 0 deletions
19
pofo-api/src/main/kotlin/org/pofo/api/dto/ProjectListResponse.kt
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,19 @@ | ||
package org.pofo.api.dto | ||
|
||
import org.pofo.domain.rds.domain.project.Project | ||
import org.springframework.data.domain.Slice | ||
|
||
data class ProjectListResponse( | ||
val projects: List<ProjectResponse>, | ||
val hasNext: Boolean, | ||
val count: Int, | ||
) { | ||
companion object { | ||
fun from(projectSlice: Slice<Project>): ProjectListResponse = | ||
ProjectListResponse( | ||
projectSlice.content.map { ProjectResponse.from(it) }, | ||
projectSlice.hasNext(), | ||
projectSlice.count(), | ||
) | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
pofo-api/src/main/kotlin/org/pofo/api/dto/ProjectResponse.kt
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,36 @@ | ||
package org.pofo.api.dto | ||
|
||
import org.pofo.domain.rds.domain.project.Project | ||
|
||
data class ProjectResponse( | ||
val id: Long, | ||
val title: String, | ||
val bio: String?, | ||
val urls: List<String>?, | ||
val imageUrls: List<String>?, | ||
val keyImageIndex: Int, | ||
val content: String, | ||
val isApproved: Boolean, | ||
val likes: Int, | ||
val category: String?, | ||
val stacks: List<String>?, | ||
val authorName: String, | ||
) { | ||
companion object { | ||
fun from(project: Project): ProjectResponse = | ||
ProjectResponse( | ||
project.id!!, | ||
project.title, | ||
project.bio, | ||
project.urls, | ||
project.imageUrls, | ||
project.keyImageIndex, | ||
project.content, | ||
project.isApproved, | ||
project.likes, | ||
project.category?.name, | ||
project.stacks.map { it.stack.name }, | ||
project.author.email, | ||
) | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
pofo-api/src/main/kotlin/org/pofo/api/dto/ProjectSearchRequest.kt
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,11 @@ | ||
package org.pofo.api.dto | ||
|
||
import org.pofo.domain.rds.domain.project.ProjectCategory | ||
|
||
data class ProjectSearchRequest( | ||
val title: String?, | ||
val category: ProjectCategory?, | ||
val stackNames: List<String>?, | ||
val page: Int = 0, | ||
val size: Int = 30, | ||
) |
15 changes: 15 additions & 0 deletions
15
pofo-api/src/main/kotlin/org/pofo/api/dto/ProjectUpdateRequest.kt
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 org.pofo.api.dto | ||
|
||
import org.pofo.domain.rds.domain.project.ProjectCategory | ||
|
||
data class ProjectUpdateRequest( | ||
val projectId: Long, | ||
val title: String? = null, | ||
val bio: String? = null, | ||
val urls: List<String>? = null, | ||
val imageUrls: List<String>? = null, | ||
val keyImageIndex: Int? = null, | ||
val content: String? = null, | ||
val category: ProjectCategory? = null, | ||
val stackNames: List<String>? = null, | ||
) |
17 changes: 0 additions & 17 deletions
17
pofo-api/src/main/kotlin/org/pofo/api/dto/UpdateProjectRequest.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.