Browse Source

优化方法名

master
Binary Wang 5 years ago
parent
commit
cab663629a
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java
  2. +1
    -1
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java
  3. +2
    -2
      weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImplTest.java

+ 1
- 1
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java View File

@@ -347,7 +347,7 @@ public interface WxMpService {
* @param mpId 公众号标识
* @return 切换成功,则返回当前对象,方便链式调用,否则抛出异常
*/
WxMpService switchover1(String mpId);
WxMpService switchoverTo(String mpId);

/**
* 返回客服接口方法实现类,以方便调用其各个接口.


+ 1
- 1
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java View File

@@ -377,7 +377,7 @@ public abstract class BaseWxMpServiceImpl<H, P> implements WxMpService, RequestH
}

@Override
public WxMpService switchover1(String mpId) {
public WxMpService switchoverTo(String mpId) {
if (this.configStorageMap.containsKey(mpId)) {
WxMpConfigStorageHolder.set(mpId);
return this;


+ 2
- 2
weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImplTest.java View File

@@ -33,8 +33,8 @@ public class BaseWxMpServiceImplTest {
}

@Test
public void testSwitchover1() throws WxErrorException {
assertThat(this.wxService.switchover1("another").getAccessToken()).isNotEmpty();
public void testSwitchoverTo() throws WxErrorException {
assertThat(this.wxService.switchoverTo("another").getAccessToken()).isNotEmpty();
assertThat(WxMpConfigStorageHolder.get()).isEqualTo("another");
}
}

Loading…
Cancel
Save