fix# 渠道去重 key 修复 && 官方账号Redis初始化 key 修复 && 云片参数判空;

pull/64/head
3y 8 months ago
parent bf831a7913
commit 5c83a786f2

@ -1,45 +0,0 @@
package com.java3y.austin.common.dto.account;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* <p>
*
* [{"sms_20":{"url":"https://sms.yunpian.com/v2/sms/tpl_batch_send.json","apikey":"ca55d4c8544444444444622221b5cd7","tpl_id":"533332222282","supplierId":20,"supplierName":"云片"}}]
*
* @author 3y
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class YunPianSmsAccount {
/**
* apikey
*/
private String apikey;
/**
* tplId
*/
private String tplId;
/**
* api
*/
private String url;
/**
* Id
*/
private Integer supplierId;
/**
*
*/
private String supplierName;
}

@ -31,7 +31,7 @@ public class FrequencyDeduplicationService extends AbstractDeduplicationService
/** /**
* key * key
* <p> * <p>
* key receiver + templateId + sendChannel * key receiver + sendChannel
* <p> * <p>
* N * N
* *
@ -43,7 +43,6 @@ public class FrequencyDeduplicationService extends AbstractDeduplicationService
public String deduplicationSingleKey(TaskInfo taskInfo, String receiver) { public String deduplicationSingleKey(TaskInfo taskInfo, String receiver) {
return PREFIX + StrPool.C_UNDERLINE return PREFIX + StrPool.C_UNDERLINE
+ receiver + StrPool.C_UNDERLINE + receiver + StrPool.C_UNDERLINE
+ taskInfo.getMessageTemplateId() + StrPool.C_UNDERLINE
+ taskInfo.getSendChannel(); + taskInfo.getSendChannel();
} }
} }

@ -6,6 +6,7 @@ import cn.hutool.core.net.URLEncodeUtil;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.text.StrPool; import cn.hutool.core.text.StrPool;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.Header; import cn.hutool.http.Header;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@ -82,7 +83,9 @@ public class YunPianSmsScript implements SmsScript {
params.put("apikey", account.getApikey()); params.put("apikey", account.getApikey());
params.put("mobile", StringUtils.join(smsParam.getPhones(), StrPool.COMMA)); params.put("mobile", StringUtils.join(smsParam.getPhones(), StrPool.COMMA));
params.put("tpl_id", account.getTplId()); params.put("tpl_id", account.getTplId());
params.put("tpl_value", getTplValue(smsParam)); if (CharSequenceUtil.isNotBlank(smsParam.getContent()) && smsParam.getContent().contains(PARAMS_KV_SPLIT_KEY)) {
params.put("tpl_value", getTplValue(smsParam));
}
return params; return params;
} }

@ -119,7 +119,7 @@ public class AccountUtils {
*/ */
public WxMpService initOfficialAccountService(WeChatOfficialAccount officialAccount) { public WxMpService initOfficialAccountService(WeChatOfficialAccount officialAccount) {
WxMpService wxMpService = new WxMpServiceImpl(); WxMpService wxMpService = new WxMpServiceImpl();
WxMpRedisConfigImpl config = new WxMpRedisConfigImpl(redisTemplateWxRedisOps(), ChannelType.ENTERPRISE_WE_CHAT.getAccessTokenPrefix()); WxMpRedisConfigImpl config = new WxMpRedisConfigImpl(redisTemplateWxRedisOps(), ChannelType.OFFICIAL_ACCOUNT.getAccessTokenPrefix());
config.setAppId(officialAccount.getAppId()); config.setAppId(officialAccount.getAppId());
config.setSecret(officialAccount.getSecret()); config.setSecret(officialAccount.getSecret());
config.setToken(officialAccount.getToken()); config.setToken(officialAccount.getToken());

Loading…
Cancel
Save