Merge branch 'master' into master

pull/62/head
Java3y 7 months ago committed by GitHub
commit d820969d18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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;
}

@ -10,7 +10,6 @@ import com.java3y.austin.handler.handler.HandlerHolder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
* *
* *
@ -29,8 +28,8 @@ public class SendMessageAction implements BusinessProcess<TaskInfo> {
if (ChannelType.MINI_PROGRAM.getCode().equals(taskInfo.getSendChannel()) if (ChannelType.MINI_PROGRAM.getCode().equals(taskInfo.getSendChannel())
|| ChannelType.OFFICIAL_ACCOUNT.getCode().equals(taskInfo.getSendChannel()) || ChannelType.OFFICIAL_ACCOUNT.getCode().equals(taskInfo.getSendChannel())
|| ChannelType.ALIPAY_MINI_PROGRAM.getCode().equals(taskInfo.getSendChannel())) { || ChannelType.ALIPAY_MINI_PROGRAM.getCode().equals(taskInfo.getSendChannel())) {
for (String receiver : taskInfo.getReceiver()) {
TaskInfo taskClone = ObjectUtil.cloneByStream(taskInfo); TaskInfo taskClone = ObjectUtil.cloneByStream(taskInfo);
for (String receiver : taskInfo.getReceiver()) {
taskClone.setReceiver(Sets.newHashSet(receiver)); taskClone.setReceiver(Sets.newHashSet(receiver));
handlerHolder.route(taskInfo.getSendChannel()).doHandler(taskClone); handlerHolder.route(taskInfo.getSendChannel()).doHandler(taskClone);
} }

@ -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());
if (CharSequenceUtil.isNotBlank(smsParam.getContent()) && smsParam.getContent().contains(PARAMS_KV_SPLIT_KEY)) {
params.put("tpl_value", getTplValue(smsParam)); 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());

@ -26,8 +26,9 @@ public class ExceptionHandlerAdvice {
@ExceptionHandler({Exception.class}) @ExceptionHandler({Exception.class})
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
public BasicResultVO<String> exceptionResponse(Exception e) { public BasicResultVO<String> exceptionResponse(Exception e) {
log.error(Throwables.getStackTrace(e)); String errStackStr = Throwables.getStackTrace(e);
return BasicResultVO.fail(RespStatusEnum.ERROR_500, "\r\n" + Throwables.getStackTrace(e) + "\r\n"); log.error(errStackStr);
return BasicResultVO.fail(RespStatusEnum.ERROR_500, "\r\n" + errStackStr + "\r\n");
} }
@ExceptionHandler({CommonException.class}) @ExceptionHandler({CommonException.class})

Loading…
Cancel
Save