完善Demo,保证其中一个公众号可以正常使用,close #7

This commit is contained in:
BinaryWang 2016-07-08 09:48:59 +08:00
parent 62988c11e3
commit 9d2923edc9
6 changed files with 150 additions and 12 deletions

View File

@ -0,0 +1,23 @@
package com.github.binarywang.demo.spring.handler.gzh1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.github.binarywang.demo.spring.config.WxConfig;
import com.github.binarywang.demo.spring.config.WxGzh1Config;
import com.github.binarywang.demo.spring.handler.LocationHandler;
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class Gzh1LocationHandler extends LocationHandler {
@Autowired
private WxGzh1Config wxConfig;
@Override
protected WxConfig getWxConfig() {
return this.wxConfig;
}
}

View File

@ -0,0 +1,23 @@
package com.github.binarywang.demo.spring.handler.gzh1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.github.binarywang.demo.spring.config.WxConfig;
import com.github.binarywang.demo.spring.config.WxGzh1Config;
import com.github.binarywang.demo.spring.handler.MenuHandler;
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class Gzh1MenuHadler extends MenuHandler {
@Autowired
private WxGzh1Config wxConfig;
@Override
protected WxConfig getWxConfig() {
return this.wxConfig;
}
}

View File

@ -0,0 +1,23 @@
package com.github.binarywang.demo.spring.handler.gzh1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.github.binarywang.demo.spring.config.WxConfig;
import com.github.binarywang.demo.spring.config.WxGzh1Config;
import com.github.binarywang.demo.spring.handler.MsgHandler;
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class Gzh1MsgHadler extends MsgHandler {
@Autowired
private WxGzh1Config wxConfig;
@Override
protected WxConfig getWxConfig() {
return this.wxConfig;
}
}

View File

@ -0,0 +1,32 @@
package com.github.binarywang.demo.spring.handler.gzh1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.github.binarywang.demo.spring.config.WxConfig;
import com.github.binarywang.demo.spring.config.WxGzh1Config;
import com.github.binarywang.demo.spring.handler.SubscribeHandler;
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class Gzh1SubscribeHadler extends SubscribeHandler {
@Autowired
private WxGzh1Config wxConfig;
@Override
protected WxConfig getWxConfig() {
return this.wxConfig;
}
@Override
protected WxMpXmlOutMessage handleSpecial(WxMpXmlMessage wxMessage)
throws Exception {
return null;
}
}

View File

@ -0,0 +1,23 @@
package com.github.binarywang.demo.spring.handler.gzh1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.github.binarywang.demo.spring.config.WxConfig;
import com.github.binarywang.demo.spring.config.WxGzh1Config;
import com.github.binarywang.demo.spring.handler.UnsubscribeHandler;
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class Gzh1UnSubscribeHadler extends UnsubscribeHandler {
@Autowired
private WxGzh1Config wxConfig;
@Override
protected WxConfig getWxConfig() {
return this.wxConfig;
}
}

View File

@ -10,6 +10,11 @@ import com.github.binarywang.demo.spring.handler.MenuHandler;
import com.github.binarywang.demo.spring.handler.MsgHandler;
import com.github.binarywang.demo.spring.handler.SubscribeHandler;
import com.github.binarywang.demo.spring.handler.UnsubscribeHandler;
import com.github.binarywang.demo.spring.handler.gzh1.Gzh1LocationHandler;
import com.github.binarywang.demo.spring.handler.gzh1.Gzh1MenuHadler;
import com.github.binarywang.demo.spring.handler.gzh1.Gzh1MsgHadler;
import com.github.binarywang.demo.spring.handler.gzh1.Gzh1SubscribeHadler;
import com.github.binarywang.demo.spring.handler.gzh1.Gzh1UnSubscribeHadler;
/**
*
@ -19,8 +24,23 @@ import com.github.binarywang.demo.spring.handler.UnsubscribeHandler;
@Service
public class Gzh1WxService extends BaseWxService {
@Autowired
private WxGzh1Config wxConfig;
private WxGzh1Config wxConfig;
@Autowired
private Gzh1LocationHandler locationHandler;
@Autowired
private Gzh1MenuHadler menuHadler;
@Autowired
private Gzh1MsgHadler msgHadler;
@Autowired
private Gzh1UnSubscribeHadler unSubscribeHadler;
@Autowired
private Gzh1SubscribeHadler subscribeHadler;
@Override
protected WxConfig getServerConfig() {
return this.wxConfig;
@ -28,37 +48,31 @@ public class Gzh1WxService extends BaseWxService {
@Override
protected MenuHandler getMenuHandler() {
// TODO Auto-generated method stub
return null;
return this.menuHadler;
}
@Override
protected SubscribeHandler getSubscribeHandler() {
// TODO Auto-generated method stub
return null;
return this.subscribeHadler;
}
@Override
protected UnsubscribeHandler getUnsubscribeHandler() {
// TODO Auto-generated method stub
return null;
return this.unSubscribeHadler;
}
@Override
protected AbstractHandler getLocationHandler() {
// TODO Auto-generated method stub
return null;
return this.locationHandler;
}
@Override
protected MsgHandler getMsgHandler() {
// TODO Auto-generated method stub
return null;
return this.msgHadler;
}
@Override
protected AbstractHandler getScanHandler() {
// TODO Auto-generated method stub
return null;
}