All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.boommanpro.wechat.WeChatAutoConfiguration Maven / Gradle / Ivy

package cn.boommanpro.wechat;


import cn.boommanpro.wechat.annotation.EnableWechat;
import cn.boommanpro.wechat.bean.WeChatProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportAware;
import org.springframework.core.type.AnnotationMetadata;

import java.util.Map;

/**
 * @author BoomMan
 */
@Configuration
@ConditionalOnClass(WeChatService.class)
@EnableConfigurationProperties(WeChatProperties.class)
public class WeChatAutoConfiguration implements ImportAware {


    @Bean
    @ConditionalOnMissingBean
    WeChatService weChatService() {
        return new WeChatService();
    }

    @Override
    public void setImportMetadata(AnnotationMetadata importMetadata) {
        Map attributeMap = importMetadata.getAnnotationAttributes(EnableWechat.class.getName());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy