package com.composition.android.lib.ad.basic

import com.composition.android.lib.ad.bean.AdUnitBean
import java.io.Serializable


/**
 * 请求广告结果
 * @param adBean 请求广告的数据类包含广告位置、id等信息
 * @param code 请求的结果
 * @param msg 相关信息
 */
sealed class AdResult(
    open var adBean: AdUnitBean,
    @AdLoadCode open var code: Int,
    open var msg: String
) : Serializable {

    /**
     * 广告请求成功
     */
    class Success(
        var adObject: Any?,
        override var adBean: AdUnitBean,
        @AdLoadCode override var code: Int = AdLoadCode.SUCCESS,
        override var msg: String
    ) : AdResult(adBean, code, msg)

    /**
     * 广告请求失败
     */
    class Fail(
        override var adBean: AdUnitBean,
        @AdLoadCode override var code: Int = AdLoadCode.FAIL,
        override var msg: String
    ) : AdResult(adBean, code, msg)


}

