package com.adealink.weparty.error

import com.adealink.frame.aab.util.getCompatString
import com.adealink.frame.base.IError
import com.adealink.weparty.R
import com.adealink.weparty.network.ServerCode

class CommonIllegalPictureError : IError(getCompatString(R.string.common_illegal_picture)) //违规图片
class CommonHasSensitiveWordError :
    IError(getCompatString(R.string.common_has_sensitive_word)) //存在敏感词

class CommonOperationLimitError : IError(getCompatString(R.string.common_operation_limit)) //操作次数受限

class CommonFunctionNoOpenError : IError()

class CommonUploadResourceError : IError(getCompatString(R.string.common_upload_resource_failed))

/**
 * token过期
 */
class TokenExpireError : IError(
    serverCode = ServerCode.TOKEN_EXPIRE.code,
    msg = getCompatString(R.string.common_token_expire)
)

/**
 * 用户被封号
 */
class UserBannedError(data: Any?) :
    IError(
        serverCode = ServerCode.USER_BANNED.code,
        msg = getCompatString(R.string.common_banned),
        data = data
    )

/**
 * 功能被封
 */
class CommonFunctionBlockError(data: Any?, msg: String = "") :
    IError(serverCode = ServerCode.FUNCTION_BLOCK.code, data = data, msg = msg)
