mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-06-28 13:16:19 +08:00
30 lines
807 B
Java
30 lines
807 B
Java
package chanjarster.weixin.api;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import javax.xml.bind.JAXBException;
|
|
|
|
import chanjarster.weixin.api.WxBaseAPITest.WxXmlConfigStorage;
|
|
import chanjarster.weixin.util.xml.XmlTransformer;
|
|
|
|
import com.google.inject.Binder;
|
|
import com.google.inject.Module;
|
|
|
|
public class ApiTestModule implements Module {
|
|
|
|
@Override
|
|
public void configure(Binder binder) {
|
|
try {
|
|
InputStream is1 = ClassLoader.getSystemResourceAsStream("test-config.xml");
|
|
WxXmlConfigStorage config = XmlTransformer.fromXml(WxXmlConfigStorage.class, is1);
|
|
WxServiceImpl wxService = new WxServiceImpl();
|
|
wxService.setWxConfigStorage(config);
|
|
|
|
binder.bind(WxServiceImpl.class).toInstance(wxService);
|
|
} catch (JAXBException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
|
|
}
|