package com.xiaojinzi.componentdemo;

import android.util.Log;

import com.xiaojinzi.component.anno.ConditionalAnno;
import com.xiaojinzi.component.anno.GlobalInterceptorAnno;
import com.xiaojinzi.component.api.Condition;
import com.xiaojinzi.component.impl.RouterInterceptor;

/**
 * 全局的一个监测的拦截器
 * time   : 2019/02/19
 *
 * @author : xiaojinzi 30212
 */
@GlobalInterceptorAnno
@ConditionalAnno(conditions = MonitorInterceptor.OnCondition.class)
public class MonitorInterceptor implements RouterInterceptor {

    @Override
    public void intercept(Chain chain) throws Exception {
        String uriStr = chain.request().uri.toString();
        Log.d("全局监控拦截器", "uri = " + uriStr);
        chain.proceed(chain.request());
    }

    public static class OnCondition implements Condition {

        @Override
        public boolean matches() {
            return BuildConfig.DEBUG;
        }

    }

}

@@ -290,16 +290,48 @@
 %E4%B8%AA%E7%9B%91%E6%B5%8B%E7%9A%84%E6%8B%A6%E6%88%AA%E5%99%A8%0A
+ * %E4%BD%BF%E7%94%A8%E6%9D%A1%E4%BB%B6%E6%B3%A8%E8%A7%A3%E5%8F%AF%E4%BB%A5%E8%AE%A9%E8%BF%99%E4%B8%AA%E6%8B%A6%E6%88%AA%E5%99%A8%E5%8F%AA%E5%9C%A8 debug %E7%9A%84%E6%97%B6%E5%80%99%E7%94%9F%E6%95%88%0A
  * time 

add doc