Просмотр исходного кода

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

master
BinaryWang 8 лет назад
Родитель
Сommit
9d2923edc9
6 измененных файлов: 150 добавлений и 12 удалений
  1. +23
    -0
      weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1LocationHandler.java
  2. +23
    -0
      weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1MenuHadler.java
  3. +23
    -0
      weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1MsgHadler.java
  4. +32
    -0
      weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1SubscribeHadler.java
  5. +23
    -0
      weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1UnSubscribeHadler.java
  6. +26
    -12
      weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/service/Gzh1WxService.java

+ 23
- 0
weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1LocationHandler.java Просмотреть файл

@@ -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;
}

}

+ 23
- 0
weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1MenuHadler.java Просмотреть файл

@@ -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;
}

}

+ 23
- 0
weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1MsgHadler.java Просмотреть файл

@@ -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;
}

}

+ 32
- 0
weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1SubscribeHadler.java Просмотреть файл

@@ -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;
}

}

+ 23
- 0
weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/handler/gzh1/Gzh1UnSubscribeHadler.java Просмотреть файл

@@ -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;
}

}

+ 26
- 12
weixin-java-demo-with-spring/src/main/java/com/github/binarywang/demo/spring/service/Gzh1WxService.java Просмотреть файл

@@ -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;
}



Загрузка…
Отмена
Сохранить