io.opengood.api.rest.contracts.Functions.kt Maven / Gradle / Ivy
package io.opengood.api.rest.contracts
import io.opengood.api.rest.contracts.page.PageData
import io.opengood.api.rest.contracts.record.RecordData
import io.opengood.api.rest.contracts.response.ActionResponse
import io.opengood.api.rest.contracts.response.DataByIdResponse
import io.opengood.api.rest.contracts.response.DataResponse
import io.opengood.api.rest.contracts.response.OperationState
import org.springframework.http.ResponseEntity
fun actionFailedResponse(
message: String
) =
ResponseEntity.badRequest().body(
ActionResponse(
state = OperationState.FAILED,
message = message,
data = emptyList()
)
)
fun actionSuccessResponse(
message: String = "",
data: List