From 6b3a09a925bcc7fa954c5123c53ccd15d48a60a0 Mon Sep 17 00:00:00 2001 From: S Date: Sun, 19 Jan 2020 11:30:35 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20#1384=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E8=80=85=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81=EF=BC=8C=E5=90=8C=E6=97=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96WxOpenStorageAutoConfiguration=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0keyPrefix=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :sparkles: 增加自助核销接口 * :bug: 修改接口路径 * :sparkles: 增加错误码 * :sparkles: 优化 * :sparkles: starter config增加keyPrefix * :sparkles: 修改支付返回结果判断 --- .../WxOpenStorageAutoConfiguration.java | 20 +++++++++---------- .../open/properties/WxOpenProperties.java | 2 ++ .../weixin/common/error/WxMaErrorMsgEnum.java | 11 ++++++++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/WxOpenStorageAutoConfiguration.java b/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/WxOpenStorageAutoConfiguration.java index b7afd532..a92b3483 100644 --- a/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/WxOpenStorageAutoConfiguration.java +++ b/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/WxOpenStorageAutoConfiguration.java @@ -49,11 +49,11 @@ public class WxOpenStorageAutoConfiguration { return getWxOpenInRedisConfigStorage(); } - if (type == WxOpenProperties.StorageType.jedis){ + if (type == WxOpenProperties.StorageType.jedis) { return getWxOpenInRedisConfigStorage(); } - if (type == WxOpenProperties.StorageType.redisson){ + if (type == WxOpenProperties.StorageType.redisson) { return getWxOpenInRedissonConfigStorage(); } return getWxOpenInMemoryConfigStorage(); @@ -61,7 +61,7 @@ public class WxOpenStorageAutoConfiguration { private WxOpenInMemoryConfigStorage getWxOpenInMemoryConfigStorage() { WxOpenInMemoryConfigStorage config = new WxOpenInMemoryConfigStorage(); - config.setWxOpenInfo(properties.getAppId(),properties.getSecret(), properties.getToken(), properties.getAesKey()); + config.setWxOpenInfo(properties.getAppId(), properties.getSecret(), properties.getToken(), properties.getAesKey()); return config; } @@ -70,18 +70,18 @@ public class WxOpenStorageAutoConfiguration { if (jedisPool == null || StringUtils.isNotEmpty(redisHost)) { poolToUse = getJedisPool(); } - WxOpenInRedisConfigStorage config = new WxOpenInRedisConfigStorage(poolToUse); - config.setWxOpenInfo(properties.getAppId(),properties.getSecret(), properties.getToken(), properties.getAesKey()); + WxOpenInRedisConfigStorage config = new WxOpenInRedisConfigStorage(poolToUse, properties.getConfigStorage().getKeyPrefix()); + config.setWxOpenInfo(properties.getAppId(), properties.getSecret(), properties.getToken(), properties.getAesKey()); return config; } - private WxOpenInRedissonConfigStorage getWxOpenInRedissonConfigStorage(){ + private WxOpenInRedissonConfigStorage getWxOpenInRedissonConfigStorage() { RedissonClient redissonClientToUse = this.redissonClient; - if(redissonClient == null){ + if (redissonClient == null) { redissonClientToUse = getRedissonClient(); } - WxOpenInRedissonConfigStorage config = new WxOpenInRedissonConfigStorage(redissonClientToUse); - config.setWxOpenInfo(properties.getAppId(),properties.getSecret(), properties.getToken(), properties.getAesKey()); + WxOpenInRedissonConfigStorage config = new WxOpenInRedissonConfigStorage(redissonClientToUse, properties.getConfigStorage().getKeyPrefix()); + config.setWxOpenInfo(properties.getAppId(), properties.getSecret(), properties.getToken(), properties.getAesKey()); return config; } @@ -111,7 +111,7 @@ public class WxOpenStorageAutoConfiguration { return pool; } - private RedissonClient getRedissonClient(){ + private RedissonClient getRedissonClient() { WxOpenProperties.ConfigStorage storage = properties.getConfigStorage(); RedisProperties redis = storage.getRedis(); diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenProperties.java b/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenProperties.java index 03e3427e..77aabad5 100644 --- a/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenProperties.java +++ b/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/properties/WxOpenProperties.java @@ -53,6 +53,8 @@ public class WxOpenProperties { private RedisProperties redis = new RedisProperties(); + private String keyPrefix; + } public enum StorageType { diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java index f1ced3fd..a6fbe052 100644 --- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxMaErrorMsgEnum.java @@ -452,6 +452,17 @@ public enum WxMaErrorMsgEnum { CODE_43101(43101, "用户拒绝接受消息,如果用户之前曾经订阅过,则表示用户取消了订阅关系"), CODE_47003(47003, "模板参数不准确,可能为空或者不满足规则,errmsg会提示具体是哪个字段出错"), + + /** + * 小程序绑定体验者 + */ + CODE_85001(85001, "微信号不存在或微信号设置为不可搜索"), + + CODE_85002(85002, "小程序绑定的体验者数量达到上限"), + + CODE_85003(85003, "微信号绑定的小程序体验者达到上限"), + + CODE_85004(85004, "微信号已经绑定"), ; private int code;