com.api.wx.WxAutowireConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wx-spring-boot-starter Show documentation
Show all versions of wx-spring-boot-starter Show documentation
Demo project for Spring Boot
The newest version!
package com.api.wx;
import com.github.wx.api.WxRest;
import com.github.wx.api.WxRestAdapterImpl;
import org.springframework.beans.factory.annotation.Autowired;
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;
@Configuration
@ConditionalOnClass(WxRest.class)
@EnableConfigurationProperties(WxProperties.class)
public class WxAutowireConfiguration {
@Autowired
WxProperties wxProperties;
@ConditionalOnMissingBean(WxRest.class)
@Bean
public WxRest wxApi() {
return new WxRestAdapterImpl(wxProperties.getId(), wxProperties.getSecurity());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy