diff options
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds')
-rw-r--r-- | ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt index 1f01d1ce3..3973f3620 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt @@ -89,9 +89,11 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint fun allBlueprintModel( @RequestParam(defaultValue = "20") limit: Int, @RequestParam(defaultValue = "0") offset: Int, - @RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption + @RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption, + @RequestParam(defaultValue = "ASC") sortType: String ): Page<BlueprintModelSearch> { - val pageRequest = PageRequest.of(offset, limit, Sort.Direction.ASC, sort.columnName) + val pageRequest = PageRequest.of(offset, limit, + Sort.Direction.fromString(sortType), sort.columnName) return this.bluePrintModelHandler.allBlueprintModel(pageRequest) } @@ -110,9 +112,11 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint @NotNull @PathVariable(value = "keyword") keyWord: String, @RequestParam(defaultValue = "20") limit: Int, @RequestParam(defaultValue = "0") offset: Int, - @RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption + @RequestParam(defaultValue = "DATE") sort: BlueprintSortByOption, + @RequestParam(defaultValue = "ASC") sortType: String ): Page<BlueprintModelSearch> { - val pageRequest = PageRequest.of(offset, limit, Sort.Direction.ASC, sort.columnName) + val pageRequest = PageRequest.of(offset, limit, + Sort.Direction.fromString(sortType), sort.columnName) return this.bluePrintModelHandler.searchBluePrintModelsByKeyWordPaged(keyWord, pageRequest) } |