-
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.
feat(JAQPOT-128): update model organizations endpoint (#27)
* feat(JAQPOT-128): update-model-organizations endpoint * feat: add get models paginated
- Loading branch information
Showing
9 changed files
with
164 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.jaqpot.api.mapper | ||
|
||
import org.jaqpot.api.entity.Model | ||
import org.jaqpot.api.model.GetModels200ResponseDto | ||
import org.jaqpot.api.model.UserDto | ||
import org.springframework.data.domain.Page | ||
|
||
fun Page<Model>.toGetModels200ResponseDto(creatorDto: UserDto): GetModels200ResponseDto { | ||
return GetModels200ResponseDto( | ||
this.content.map { it.toDto(creatorDto) }, | ||
this.totalElements.toInt(), | ||
this.totalPages, | ||
this.pageable.pageSize, | ||
this.pageable.pageNumber | ||
) | ||
} |
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,6 +1,11 @@ | ||
package org.jaqpot.api.repository | ||
|
||
import org.jaqpot.api.entity.Model | ||
import org.springframework.data.domain.Page | ||
import org.springframework.data.domain.Pageable | ||
import org.springframework.data.repository.CrudRepository | ||
import org.springframework.data.repository.PagingAndSortingRepository | ||
|
||
interface ModelRepository : CrudRepository<Model, Long> | ||
interface ModelRepository : PagingAndSortingRepository<Model, Long>, CrudRepository<Model, Long> { | ||
fun findAllByCreatorId(creatorId: String, pageable: Pageable): Page<Model> | ||
} |
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