package com.upyuns.platform.rs.gtdata;

import cn.hutool.core.util.StrUtil;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class GtdataCondition implements Condition {
    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        Environment environment = conditionContext.getEnvironment();
       String sign = environment.getProperty("gtdata.use");
        if(StrUtil.isNotBlank(sign) && "true".equals(sign)){
            return true;
        }
        return false;
    }
}