pull/43/head
3y 2 years ago
commit 274bb01a05

@ -1,5 +1,6 @@
package com.java3y.austin.service.api.impl.service;
import com.java3y.austin.common.enums.RespStatusEnum;
import com.java3y.austin.common.vo.BasicResultVO;
import com.java3y.austin.service.api.domain.SendRequest;
import com.java3y.austin.service.api.domain.SendResponse;
@ -7,6 +8,7 @@ import com.java3y.austin.service.api.impl.domain.SendTaskModel;
import com.java3y.austin.service.api.service.RecallService;
import com.java3y.austin.support.pipeline.ProcessContext;
import com.java3y.austin.support.pipeline.ProcessController;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -24,6 +26,9 @@ public class RecallServiceImpl implements RecallService {
@Override
public SendResponse recall(SendRequest sendRequest) {
if(ObjectUtils.isEmpty(sendRequest)){
return new SendResponse(RespStatusEnum.CLIENT_BAD_PARAMETERS.getCode(), RespStatusEnum.CLIENT_BAD_PARAMETERS.getMsg());
}
SendTaskModel sendTaskModel = SendTaskModel.builder()
.messageTemplateId(sendRequest.getMessageTemplateId())
.build();

@ -1,6 +1,7 @@
package com.java3y.austin.service.api.impl.service;
import cn.monitor4all.logRecord.annotation.OperationLog;
import com.java3y.austin.common.enums.RespStatusEnum;
import com.java3y.austin.common.vo.BasicResultVO;
import com.java3y.austin.service.api.domain.BatchSendRequest;
import com.java3y.austin.service.api.domain.SendRequest;
@ -9,6 +10,7 @@ import com.java3y.austin.service.api.impl.domain.SendTaskModel;
import com.java3y.austin.service.api.service.SendService;
import com.java3y.austin.support.pipeline.ProcessContext;
import com.java3y.austin.support.pipeline.ProcessController;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -28,6 +30,9 @@ public class SendServiceImpl implements SendService {
@Override
@OperationLog(bizType = "SendService#send", bizId = "#sendRequest.messageTemplateId", msg = "#sendRequest")
public SendResponse send(SendRequest sendRequest) {
if(ObjectUtils.isEmpty(sendRequest)){
return new SendResponse(RespStatusEnum.CLIENT_BAD_PARAMETERS.getCode(), RespStatusEnum.CLIENT_BAD_PARAMETERS.getMsg());
}
SendTaskModel sendTaskModel = SendTaskModel.builder()
.messageTemplateId(sendRequest.getMessageTemplateId())

@ -1,5 +1,6 @@
package com.java3y.austin.support.utils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.PropertyPlaceholderHelper;
import java.text.MessageFormat;
@ -43,7 +44,7 @@ public class ContentHolderUtil {
@Override
public String resolvePlaceholder(String placeholderName) {
String value = paramMap.get(placeholderName);
if (null == value) {
if (StringUtils.isEmpty(value)) {
String errorStr = MessageFormat.format("template:{0} require param:{1},but not exist! paramMap:{2}", template, placeholderName, paramMap.toString());
throw new IllegalArgumentException(errorStr);
}

Loading…
Cancel
Save