From b1ad2d17c7f93e819c67fe5ab5c2ca94e764e517 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 18 八月 2026 10:42:23 +0800
Subject: [PATCH] 清理配置文件
---
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java | 350 ----------------------------------------------------------
1 files changed, 0 insertions(+), 350 deletions(-)
diff --git a/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java b/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java
index 7450c9b..a7d53f5 100644
--- a/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java
+++ b/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/social/SocialClientServiceImpl.java
@@ -1,53 +1,23 @@
package cn.iocoder.yudao.module.system.service.social;
-import cn.binarywang.wx.miniapp.api.WxMaService;
-import cn.binarywang.wx.miniapp.api.WxMaSubscribeService;
-import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
-import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
-import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
-import cn.binarywang.wx.miniapp.bean.shop.request.shipping.*;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
-import cn.binarywang.wx.miniapp.config.impl.WxMaRedisBetterConfigImpl;
-import cn.binarywang.wx.miniapp.constant.WxMaConstants;
import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
-import cn.hutool.core.thread.ThreadUtil;
-import cn.hutool.core.util.DesensitizedUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.util.cache.CacheUtils;
import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
-import cn.iocoder.yudao.module.system.api.social.dto.SocialWxQrcodeReqDTO;
-import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaOrderNotifyConfirmReceiveReqDTO;
-import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaOrderUploadShippingInfoReqDTO;
-import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO;
import cn.iocoder.yudao.module.system.controller.admin.socail.vo.client.SocialClientPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.socail.vo.client.SocialClientSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialClientDO;
import cn.iocoder.yudao.module.system.dal.mysql.social.SocialClientMapper;
-import cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants;
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
import cn.iocoder.yudao.module.system.framework.justauth.core.AuthRequestFactory;
-import com.binarywang.spring.starter.wxjava.miniapp.properties.WxMaProperties;
-import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
import jakarta.annotation.Resource;
-import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.common.bean.WxJsapiSignature;
-import me.chanjar.weixin.common.bean.subscribemsg.TemplateInfo;
-import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
-import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
@@ -56,24 +26,14 @@
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
-import java.time.Duration;
-import java.time.ZonedDateTime;
import java.util.List;
-import java.util.Map;
import java.util.Objects;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen;
-import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.UTC_MS_WITH_XXX_OFFSET_FORMATTER;
-import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.toEpochSecond;
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
-import static java.util.Collections.singletonList;
/**
* 绀句氦搴旂敤 Service 瀹炵幇绫�
@@ -84,84 +44,9 @@
@Slf4j
public class SocialClientServiceImpl implements SocialClientService {
- /**
- * 灏忕▼搴忕爜瑕佹墦寮�鐨勫皬绋嬪簭鐗堟湰
- *
- * 1. release锛氭寮忕増
- * 2. trial锛氫綋楠岀増
- * 3. developer锛氬紑鍙戠増
- */
- @Value("${yudao.wxa-code.env-version:release}")
- public String envVersion;
- /**
- * 璁㈤槄娑堟伅璺宠浆灏忕▼搴忕被鍨�
- *
- * 1. developer锛氬紑鍙戠増
- * 2. trial锛氫綋楠岀増
- * 3. formal锛氭寮忕増
- */
- @Value("${yudao.wxa-subscribe-message.miniprogram-state:formal}")
- public String miniprogramState;
-
- /**
- * 涓婁紶鍙戣揣淇℃伅閲嶈瘯闂撮殧锛堟绉掞級锛屾暟缁勯暱搴﹀嵆閲嶈瘯娆℃暟锛涙�荤瓑寰呮渶鍧� 1 + 2 + 4 = 7 绉掞紝瑕嗙洊寰俊鏀粯鍥炶皟鐨勫父瑙佸欢杩�
- */
- private static final long[] UPLOAD_SHIPPING_INFO_RETRY_BACKOFF_MILLIS = {1000, 2000, 4000};
- /**
- * 寰俊閿欒鐮侊細鏀粯鍗曚笉瀛樺湪
- */
- private static final int WX_ERR_CODE_PAY_ORDER_NOT_EXIST = 10060001;
-
@SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection")
@Autowired(required = false) // 鐢变簬 justauth.enable 閰嶇疆椤癸紝鍙互鍏抽棴 AuthRequestFactory 鐨勫姛鑳斤紝鎵�浠ヨ繖閲屽彧鑳戒笉寮哄埗娉ㄥ叆
private AuthRequestFactory authRequestFactory;
-
- @Resource
- private WxMpService wxMpService;
- @Resource
- private WxMpProperties wxMpProperties;
- @Resource
- private StringRedisTemplate stringRedisTemplate; // WxMpService 闇�瑕佷娇鐢ㄥ埌锛屾墍浠ュ湪 Service 娉ㄥ叆浜嗗畠
- /**
- * 缂撳瓨 WxMpService 瀵硅薄
- *
- * key锛氫娇鐢ㄥ井淇″叕浼楀彿鐨� appId + secret 鎷兼帴锛屽嵆 {@link SocialClientDO} 鐨� clientId 鍜� clientSecret 灞炴�с��
- * 涓轰粈涔� key 浣跨敤杩欑鏍煎紡锛熷洜涓� {@link SocialClientDO} 鍦ㄧ鐞嗗悗鍙板彲浠ュ彉鏇达紝閫氳繃杩欎釜 key 瀛樺偍瀹冪殑鍗曚緥銆�
- *
- * 涓轰粈涔堣鍋� WxMpService 缂撳瓨锛熷洜涓� WxMpService 鏋勫缓鎴愭湰姣旇緝澶э紝鎵�浠ュ敖閲忎繚璇佸畠鏄崟渚嬨��
- */
- private final LoadingCache<String, WxMpService> wxMpServiceCache = CacheUtils.buildAsyncReloadingCache(
- Duration.ofSeconds(10L),
- new CacheLoader<String, WxMpService>() {
-
- @Override
- public WxMpService load(String key) {
- String[] keys = key.split(":");
- return buildWxMpService(keys[0], keys[1]);
- }
-
- });
-
- @Resource
- private WxMaService wxMaService;
- @Resource
- private WxMaProperties wxMaProperties;
- /**
- * 缂撳瓨 WxMaService 瀵硅薄
- *
- * 璇存槑鍚� {@link #wxMpServiceCache} 鍙橀噺
- */
- private final LoadingCache<String, WxMaService> wxMaServiceCache = CacheUtils.buildAsyncReloadingCache(
- Duration.ofSeconds(10L),
- new CacheLoader<String, WxMaService>() {
-
- @Override
- public WxMaService load(String key) {
- String[] keys = key.split(":");
- return buildWxMaService(keys[0], keys[1]);
- }
-
- });
@Resource
private SocialClientMapper socialClientMapper;
@@ -223,241 +108,6 @@
ReflectUtil.setFieldValue(request, "config", newAuthConfig);
}
return request;
- }
-
- // =================== 寰俊鍏紬鍙风嫭鏈� ===================
-
- @Override
- @SneakyThrows
- public WxJsapiSignature createWxMpJsapiSignature(Integer userType, String url) {
- WxMpService service = getWxMpService(userType);
- return service.createJsapiSignature(url);
- }
-
- /**
- * 鑾峰緱 clientId + clientSecret 瀵瑰簲鐨� WxMpService 瀵硅薄
- *
- * @param userType 鐢ㄦ埛绫诲瀷
- * @return WxMpService 瀵硅薄
- */
- @VisibleForTesting
- WxMpService getWxMpService(Integer userType) {
- // 绗竴姝ワ紝鏌ヨ DB 鐨勯厤缃」锛岃幏寰楀搴旂殑 WxMpService 瀵硅薄
- SocialClientDO client = socialClientMapper.selectBySocialTypeAndUserType(
- SocialTypeEnum.WECHAT_MP.getType(), userType);
- if (client != null && Objects.equals(client.getStatus(), CommonStatusEnum.ENABLE.getStatus())) {
- return wxMpServiceCache.getUnchecked(client.getClientId() + ":" + client.getClientSecret());
- }
- // 绗簩姝ワ紝涓嶅瓨鍦� DB 閰嶇疆椤癸紝鍒欎娇鐢� application-*.yaml 瀵瑰簲鐨� WxMpService 瀵硅薄
- return wxMpService;
- }
-
- /**
- * 鍒涘缓 clientId + clientSecret 瀵瑰簲鐨� WxMpService 瀵硅薄
- *
- * @param clientId 寰俊鍏紬鍙� appId
- * @param clientSecret 寰俊鍏紬鍙� secret
- * @return WxMpService 瀵硅薄
- */
- public WxMpService buildWxMpService(String clientId, String clientSecret) {
- // 绗竴姝ワ紝鍒涘缓 WxMpRedisConfigImpl 瀵硅薄
- WxMpRedisConfigImpl configStorage = new WxMpRedisConfigImpl(
- new RedisTemplateWxRedisOps(stringRedisTemplate),
- wxMpProperties.getConfigStorage().getKeyPrefix());
- configStorage.setAppId(clientId);
- configStorage.setSecret(clientSecret);
-
- // 绗簩姝ワ紝鍒涘缓 WxMpService 瀵硅薄
- WxMpService service = new WxMpServiceImpl();
- service.setWxMpConfigStorage(configStorage);
- return service;
- }
-
- // =================== 寰俊灏忕▼搴忕嫭鏈� ===================
-
- @Override
- public WxMaPhoneNumberInfo getWxMaPhoneNumberInfo(Integer userType, String phoneCode) {
- WxMaService service = getWxMaService(userType);
- try {
- return service.getUserService().getPhoneNumber(phoneCode);
- } catch (WxErrorException e) {
- log.error("[getPhoneNumber][userType({}) phoneCode({}) 鑾峰緱鎵嬫満鍙峰け璐", userType, phoneCode, e);
- throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_PHONE_CODE_ERROR);
- }
- }
-
- @Override
- public byte[] getWxaQrcode(SocialWxQrcodeReqDTO reqVO) {
- WxMaService service = getWxMaService(UserTypeEnum.MEMBER.getValue());
- try {
- return service.getQrcodeService().createWxaCodeUnlimitBytes(
- ObjUtil.defaultIfEmpty(reqVO.getScene(), SocialWxQrcodeReqDTO.SCENE),
- reqVO.getPath(),
- ObjUtil.defaultIfNull(reqVO.getCheckPath(), SocialWxQrcodeReqDTO.CHECK_PATH),
- envVersion,
- ObjUtil.defaultIfNull(reqVO.getWidth(), SocialWxQrcodeReqDTO.WIDTH),
- ObjUtil.defaultIfNull(reqVO.getAutoColor(), SocialWxQrcodeReqDTO.AUTO_COLOR),
- null,
- ObjUtil.defaultIfNull(reqVO.getHyaline(), SocialWxQrcodeReqDTO.HYALINE));
- } catch (WxErrorException e) {
- log.error("[getWxQrcode][reqVO({}) 鑾峰緱灏忕▼搴忕爜澶辫触]", reqVO, e);
- throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_QRCODE_ERROR);
- }
- }
-
- @Override
- @Cacheable(cacheNames = RedisKeyConstants.WXA_SUBSCRIBE_TEMPLATE, key = "#userType",
- unless = "#result == null")
- public List<TemplateInfo> getSubscribeTemplateList(Integer userType) {
- WxMaService service = getWxMaService(userType);
- try {
- WxMaSubscribeService subscribeService = service.getSubscribeService();
- return subscribeService.getTemplateList();
- } catch (WxErrorException e) {
- log.error("[getSubscribeTemplate][userType({}) 鑾峰緱灏忕▼搴忚闃呮秷鎭ā鐗圿", userType, e);
- throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_SUBSCRIBE_TEMPLATE_ERROR);
- }
- }
-
- @Override
- public void sendSubscribeMessage(SocialWxaSubscribeMessageSendReqDTO reqDTO, String templateId, String openId) {
- WxMaService service = getWxMaService(reqDTO.getUserType());
- try {
- WxMaSubscribeService subscribeService = service.getSubscribeService();
- subscribeService.sendSubscribeMsg(buildMessageSendReqDTO(reqDTO, templateId, openId));
- } catch (WxErrorException e) {
- log.error("[sendSubscribeMessage][reqVO({}) templateId({}) openId({}) 鍙戦�佸皬绋嬪簭璁㈤槄娑堟伅澶辫触]", reqDTO, templateId, openId, e);
- throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_SUBSCRIBE_MESSAGE_ERROR);
- }
- }
-
- /**
- * 鏋勫缓鍙戦�佹秷鎭姹傚弬鏁�
- *
- * @param reqDTO 璇锋眰
- * @param templateId 妯$増缂栧彿
- * @param openId 浼氬憳 openId
- * @return 寰俊灏忕▼搴忚闃呮秷鎭姹傚弬鏁�
- */
- private WxMaSubscribeMessage buildMessageSendReqDTO(SocialWxaSubscribeMessageSendReqDTO reqDTO,
- String templateId, String openId) {
- // 璁剧疆璁㈤槄娑堟伅鍩烘湰鍙傛暟
- WxMaSubscribeMessage subscribeMessage = new WxMaSubscribeMessage().setLang(WxMaConstants.MiniProgramLang.ZH_CN)
- .setMiniprogramState(miniprogramState).setTemplateId(templateId).setToUser(openId).setPage(reqDTO.getPage());
- // 璁剧疆鍏蜂綋娑堟伅鍙傛暟
- Map<String, String> messages = reqDTO.getMessages();
- if (CollUtil.isNotEmpty(messages)) {
- reqDTO.getMessages().keySet().forEach(key -> findAndThen(messages, key, value ->
- subscribeMessage.addData(new WxMaSubscribeMessage.MsgData(key, value))));
- }
- return subscribeMessage;
- }
-
- @Override
- public void uploadWxaOrderShippingInfo(Integer userType, SocialWxaOrderUploadShippingInfoReqDTO reqDTO) {
- WxMaService service = getWxMaService(userType);
- List<ShippingListBean> shippingList;
- if (Objects.equals(reqDTO.getLogisticsType(), SocialWxaOrderUploadShippingInfoReqDTO.LOGISTICS_TYPE_EXPRESS)) {
- shippingList = singletonList(ShippingListBean.builder()
- .trackingNo(reqDTO.getLogisticsNo())
- .expressCompany(reqDTO.getExpressCompany())
- .itemDesc(reqDTO.getItemDesc())
- .contact(ContactBean.builder().receiverContact(DesensitizedUtil.mobilePhone(reqDTO.getReceiverContact())).build())
- .build());
- } else {
- shippingList = singletonList(ShippingListBean.builder().itemDesc(reqDTO.getItemDesc()).build());
- }
- WxMaOrderShippingInfoUploadRequest request = WxMaOrderShippingInfoUploadRequest.builder()
- .orderKey(OrderKeyBean.builder()
- .orderNumberType(2) // 浣跨敤鍘熸敮浠樹氦鏄撳搴旂殑寰俊璁㈠崟鍙凤紝鍗虫笭閬撳崟鍙�
- .transactionId(reqDTO.getTransactionId())
- .build())
- .logisticsType(reqDTO.getLogisticsType()) // 閰嶉�佹柟寮�
- .deliveryMode(1) // 缁熶竴鍙戣揣
- .shippingList(shippingList)
- .payer(PayerBean.builder().openid(reqDTO.getOpenid()).build())
- .uploadTime(ZonedDateTime.now().format(UTC_MS_WITH_XXX_OFFSET_FORMATTER))
- .build();
- // 閲嶈瘯鏈哄埗锛氳В鍐虫敮浠樺洖璋冧笌璁㈠崟淇℃伅涓婁紶涔嬮棿鐨勬椂闂村樊瀵艰嚧鐨� 10060001 閿欒
- // 瀵瑰簲 ISSUE锛歨ttps://gitee.com/zhijiantianya/yudao-cloud/pulls/230
- // 娉ㄦ剰锛歸x-java 鐨� upload 鍐呴儴瀵� errCode != 0 鐩存帴鎶� WxErrorException锛屾墍浠ラ噸璇曞垽鏂繀椤诲熀浜庡紓甯哥殑 errorCode
- int maxAttempts = UPLOAD_SHIPPING_INFO_RETRY_BACKOFF_MILLIS.length + 1;
- for (int attempt = 1; attempt <= maxAttempts; attempt++) {
- try {
- WxMaOrderShippingInfoBaseResponse response = service.getWxMaOrderShippingService().upload(request);
- log.info("[uploadWxaOrderShippingInfo][涓婁紶寰俊灏忕▼搴忓彂璐т俊鎭垚鍔燂細request({}) response({})]", request, response);
- return;
- } catch (WxErrorException ex) {
- if (ex.getError().getErrorCode() == WX_ERR_CODE_PAY_ORDER_NOT_EXIST && attempt < maxAttempts) {
- long delayMillis = UPLOAD_SHIPPING_INFO_RETRY_BACKOFF_MILLIS[attempt - 1];
- log.warn("[uploadWxaOrderShippingInfo][绗� {} 娆″皾璇曞け璐ワ紝鏀粯鍗曚笉瀛樺湪锛寋} ms 鍚庨噸璇曪細request({})]",
- attempt, delayMillis, request, ex);
- ThreadUtil.sleep(delayMillis);
- continue;
- }
- log.error("[uploadWxaOrderShippingInfo][涓婁紶寰俊灏忕▼搴忓彂璐т俊鎭け璐ワ細request({})]", request, ex);
- throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_ORDER_UPLOAD_SHIPPING_INFO_ERROR, ex.getError().getErrorMsg());
- }
- }
- }
-
- @Override
- public void notifyWxaOrderConfirmReceive(Integer userType, SocialWxaOrderNotifyConfirmReceiveReqDTO reqDTO) {
- WxMaService service = getWxMaService(userType);
- WxMaOrderShippingInfoNotifyConfirmRequest request = WxMaOrderShippingInfoNotifyConfirmRequest.builder()
- .transactionId(reqDTO.getTransactionId())
- .receivedTime(toEpochSecond(reqDTO.getReceivedTime()))
- .build();
- try {
- WxMaOrderShippingInfoBaseResponse response = service.getWxMaOrderShippingService().notifyConfirmReceive(request);
- if (response.getErrCode() != 0) {
- log.error("[notifyWxaOrderConfirmReceive][纭鏀惰揣鎻愰啋鍒板井淇″皬绋嬪簭澶辫触锛歳equest({}) response({})]", request, response);
- throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_ORDER_NOTIFY_CONFIRM_RECEIVE_ERROR, response.getErrMsg());
- }
- log.info("[notifyWxaOrderConfirmReceive][纭鏀惰揣鎻愰啋鍒板井淇″皬绋嬪簭鎴愬姛锛歳equest({}) response({})]", request, response);
- } catch (WxErrorException ex) {
- log.error("[notifyWxaOrderConfirmReceive][纭鏀惰揣鎻愰啋鍒板井淇″皬绋嬪簭澶辫触锛歳equest({})]", request, ex);
- throw exception(SOCIAL_CLIENT_WEIXIN_MINI_APP_ORDER_NOTIFY_CONFIRM_RECEIVE_ERROR, ex.getError().getErrorMsg());
- }
- }
-
- /**
- * 鑾峰緱 clientId + clientSecret 瀵瑰簲鐨� WxMpService 瀵硅薄
- *
- * @param userType 鐢ㄦ埛绫诲瀷
- * @return WxMpService 瀵硅薄
- */
- @VisibleForTesting
- WxMaService getWxMaService(Integer userType) {
- // 绗竴姝ワ紝鏌ヨ DB 鐨勯厤缃」锛岃幏寰楀搴旂殑 WxMaService 瀵硅薄
- SocialClientDO client = socialClientMapper.selectBySocialTypeAndUserType(
- SocialTypeEnum.WECHAT_MINI_PROGRAM.getType(), userType);
- if (client != null && Objects.equals(client.getStatus(), CommonStatusEnum.ENABLE.getStatus())) {
- return wxMaServiceCache.getUnchecked(client.getClientId() + ":" + client.getClientSecret());
- }
- // 绗簩姝ワ紝涓嶅瓨鍦� DB 閰嶇疆椤癸紝鍒欎娇鐢� application-*.yaml 瀵瑰簲鐨� WxMaService 瀵硅薄
- return wxMaService;
- }
-
- /**
- * 鍒涘缓 clientId + clientSecret 瀵瑰簲鐨� WxMaService 瀵硅薄
- *
- * @param clientId 寰俊灏忕▼搴� appId
- * @param clientSecret 寰俊灏忕▼搴� secret
- * @return WxMaService 瀵硅薄
- */
- private WxMaService buildWxMaService(String clientId, String clientSecret) {
- // 绗竴姝ワ紝鍒涘缓 WxMaRedisBetterConfigImpl 瀵硅薄
- WxMaRedisBetterConfigImpl configStorage = new WxMaRedisBetterConfigImpl(
- new RedisTemplateWxRedisOps(stringRedisTemplate),
- wxMaProperties.getConfigStorage().getKeyPrefix());
- configStorage.setAppid(clientId);
- configStorage.setSecret(clientSecret);
-
- // 绗簩姝ワ紝鍒涘缓 WxMpService 瀵硅薄
- WxMaService service = new WxMaServiceImpl();
- service.setWxMaConfig(configStorage);
- return service;
}
// =================== 瀹㈡埛绔鐞� ===================
--
Gitblit v1.9.3