Skip to content

Commit fce81d7

Browse files
committed
给一些不认真的同学一些提示!!
1 parent 6d744a9 commit fce81d7

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/main/java/com/github/binarywang/demo/wx/mp/config/WxMpConfiguration.java

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
package com.github.binarywang.demo.wx.mp.config;
22

3-
import com.github.binarywang.demo.wx.mp.handler.*;
3+
import java.util.Map;
4+
import java.util.stream.Collectors;
5+
6+
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
8+
import org.springframework.context.annotation.Bean;
9+
import org.springframework.context.annotation.Configuration;
10+
11+
import com.github.binarywang.demo.wx.mp.handler.KfSessionHandler;
12+
import com.github.binarywang.demo.wx.mp.handler.LocationHandler;
13+
import com.github.binarywang.demo.wx.mp.handler.LogHandler;
14+
import com.github.binarywang.demo.wx.mp.handler.MenuHandler;
15+
import com.github.binarywang.demo.wx.mp.handler.MsgHandler;
16+
import com.github.binarywang.demo.wx.mp.handler.NullHandler;
17+
import com.github.binarywang.demo.wx.mp.handler.StoreCheckNotifyHandler;
18+
import com.github.binarywang.demo.wx.mp.handler.SubscribeHandler;
19+
import com.github.binarywang.demo.wx.mp.handler.UnsubscribeHandler;
420
import com.google.common.collect.Maps;
521
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
622
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
723
import me.chanjar.weixin.mp.api.WxMpService;
824
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
925
import me.chanjar.weixin.mp.constant.WxMpEventConstants;
10-
import org.springframework.beans.factory.annotation.Autowired;
11-
import org.springframework.boot.context.properties.EnableConfigurationProperties;
12-
import org.springframework.context.annotation.Bean;
13-
import org.springframework.context.annotation.Configuration;
14-
15-
import java.util.Map;
16-
import java.util.stream.Collectors;
1726

1827
import static me.chanjar.weixin.common.api.WxConsts.*;
1928

@@ -67,6 +76,7 @@ public static Map<String, WxMpService> getMpServices() {
6776

6877
@Bean
6978
public Object services() {
79+
// 代码里getConfigs()处报错的同学,请注意仔细阅读项目说明,你的IDE需要引入lombok插件!!!!
7080
mpServices = this.properties.getConfigs()
7181
.stream()
7282
.map(a -> {
@@ -76,9 +86,6 @@ public Object services() {
7686
configStorage.setToken(a.getToken());
7787
configStorage.setAesKey(a.getAesKey());
7888

79-
// WxMpService wxMpService = new me.chanjar.weixin.mp.api.impl.WxMpServiceOkHttpImpl();
80-
// WxMpService wxMpService = new me.chanjar.weixin.mp.api.impl.WxMpServiceJoddHttpImpl();
81-
// WxMpService wxMpService = new me.chanjar.weixin.mp.api.impl.WxMpServiceHttpClientImpl();
8289
WxMpService service = new WxMpServiceImpl();
8390
service.setWxMpConfigStorage(configStorage);
8491
routers.put(a.getAppId(), this.newRouter(service));

0 commit comments

Comments
 (0)