All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.huawei.hilink.c2c.integration.helper.requestHandlers.HiLinkService.kt Maven / Gradle / Ivy

Go to download

The helper library streamlines the HiLink C2C integration and exposes a simple API.

There is a newer version: 1.3.2
Show newest version
package com.huawei.hilink.c2c.integration.helper.requestHandlers

import com.huawei.hilink.c2c.integration.helper.api.UserInfo
import com.huawei.hilink.c2c.integration.helper.dto.HiLinkResultCodes
import com.huawei.hilink.c2c.integration.helper.dto.common.HiLinkHeader
import com.huawei.hilink.c2c.integration.helper.dto.inbound.response.HiLinkResponse

internal abstract class HiLinkService(val handledRequest: String) {
    abstract suspend fun handle(requestHeader: HiLinkHeader, requestJson: String, userInfo: UserInfo): HiLinkResponse

    abstract fun prepareErrorResponse(
        requestHeader: HiLinkHeader,
        resultCode: HiLinkResultCodes,
        description: String
    ): HiLinkResponse

    fun prepareErrorResponse(
        requestHeader: HiLinkHeader,
        resultCode: HiLinkResultCodes,
    ): HiLinkResponse =
        prepareErrorResponse(requestHeader, resultCode, resultCode.description)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy