package com.common.commonlib.net.interceptor

import okhttp3.Interceptor
import okhttp3.Response

/**
 * 响应头部拦截器
 *
 * @author wangym
 * @since 2021/7/28
 */
class ResponseHeadInterceptor(private var callBack: ResponseCallBack?) : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        // 获取响应
        val response = chain.proceed(chain.request())
        callBack?.onResult(response)
        return response
    }

    interface ResponseCallBack {
        fun onResult(response: Response)
    }
}