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

@ -1,5 +1,6 @@
package com.java3y.austin.service.api.impl.service; 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.common.vo.BasicResultVO;
import com.java3y.austin.service.api.domain.SendRequest; import com.java3y.austin.service.api.domain.SendRequest;
import com.java3y.austin.service.api.domain.SendResponse; 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.service.api.service.RecallService;
import com.java3y.austin.support.pipeline.ProcessContext; import com.java3y.austin.support.pipeline.ProcessContext;
import com.java3y.austin.support.pipeline.ProcessController; import com.java3y.austin.support.pipeline.ProcessController;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -24,6 +26,9 @@ public class RecallServiceImpl implements RecallService {
@Override @Override
public SendResponse recall(SendRequest sendRequest) { 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() SendTaskModel sendTaskModel = SendTaskModel.builder()
.messageTemplateId(sendRequest.getMessageTemplateId()) .messageTemplateId(sendRequest.getMessageTemplateId())
.build(); .build();

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

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

Loading…
Cancel
Save