//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.chushang.common.feign.interceptor;

import com.chushang.common.core.constant.CommonConstants;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;

@Slf4j
public class MdcInterceptor implements RequestInterceptor {
    public MdcInterceptor() {
    }

    public void apply(RequestTemplate template) {
        log.info("TRACE_ID : -------- {}",  MDC.get(CommonConstants.TRACE_ID));
        template.header(CommonConstants.TRACE_ID, MDC.get(CommonConstants.TRACE_ID));
        template.header(CommonConstants.SPAN, MDC.get(CommonConstants.SPAN));
    }
}
