Merge branch 'master' into vip

pull/9/head
3y 3 years ago
commit 4e0ea1688c

@ -21,7 +21,7 @@ public class ContentDeduplicationBuilder extends AbstractDeduplicationBuilder im
@Override
public DeduplicationParam build(String deduplication, TaskInfo taskInfo) {
DeduplicationParam deduplicationParam = getParamsFromConfig(deduplicationType, deduplication, taskInfo);
if (deduplication == null) {
if (deduplicationParam == null) {
return null;
}
deduplicationParam.setAnchorState(AnchorState.CONTENT_DEDUPLICATION);

@ -25,14 +25,14 @@ import java.util.stream.Collectors;
*
*/
@Slf4j
public class AfterParamCheckAction implements BusinessProcess {
public class AfterParamCheckAction implements BusinessProcess<SendTaskModel> {
public static final String PHONE_REGEX_EXP = "^((13[0-9])|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[0-9])|(18[0-9])|(19[1,8,9]))\\d{8}$";
@Override
public void process(ProcessContext context) {
SendTaskModel sendTaskModel = (SendTaskModel) context.getProcessModel();
public void process(ProcessContext<SendTaskModel> context) {
SendTaskModel sendTaskModel = context.getProcessModel();
List<TaskInfo> taskInfo = sendTaskModel.getTaskInfo();
// 1. 过滤掉不合法的手机号

@ -31,14 +31,14 @@ import java.util.*;
* @description
*/
@Slf4j
public class AssembleAction implements BusinessProcess {
public class AssembleAction implements BusinessProcess<SendTaskModel> {
@Autowired
private MessageTemplateDao messageTemplateDao;
@Override
public void process(ProcessContext context) {
SendTaskModel sendTaskModel = (SendTaskModel) context.getProcessModel();
public void process(ProcessContext<SendTaskModel> context) {
SendTaskModel sendTaskModel = context.getProcessModel();
Long messageTemplateId = sendTaskModel.getMessageTemplateId();
try {

@ -19,11 +19,11 @@ import java.util.stream.Collectors;
* @description
*/
@Slf4j
public class PreParamCheckAction implements BusinessProcess {
public class PreParamCheckAction implements BusinessProcess<SendTaskModel> {
@Override
public void process(ProcessContext context) {
SendTaskModel sendTaskModel = (SendTaskModel) context.getProcessModel();
public void process(ProcessContext<SendTaskModel> context) {
SendTaskModel sendTaskModel = context.getProcessModel();
Long messageTemplateId = sendTaskModel.getMessageTemplateId();
List<MessageParam> messageParamList = sendTaskModel.getMessageParamList();

@ -19,7 +19,7 @@ import org.springframework.beans.factory.annotation.Value;
* MQ
*/
@Slf4j
public class SendMqAction implements BusinessProcess {
public class SendMqAction implements BusinessProcess<SendTaskModel> {
@Autowired
private KafkaUtils kafkaUtils;
@ -28,8 +28,8 @@ public class SendMqAction implements BusinessProcess {
private String topicName;
@Override
public void process(ProcessContext context) {
SendTaskModel sendTaskModel = (SendTaskModel) context.getProcessModel();
public void process(ProcessContext<SendTaskModel> context) {
SendTaskModel sendTaskModel = context.getProcessModel();
String message = JSON.toJSONString(sendTaskModel.getTaskInfo(), new SerializerFeature[]{SerializerFeature.WriteClassName});
try {

@ -5,11 +5,11 @@ package com.java3y.austin.support.pipeline;
*
* @author 3y
*/
public interface BusinessProcess {
public interface BusinessProcess<T extends ProcessModel> {
/**
*
* @param context
*/
void process(ProcessContext context);
void process(ProcessContext<T> context);
}

@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
@NoArgsConstructor
@Builder
@Accessors(chain = true)
public class ProcessContext {
public class ProcessContext<T extends ProcessModel> {
/**
* code
@ -27,7 +27,7 @@ public class ProcessContext {
/**
*
*/
private ProcessModel processModel;
private T processModel;
/**
*

Loading…
Cancel
Save