责任链代码风格 统一

pull/6/head
3y 3 years ago
parent 1beb92804e
commit 9420e13919

@ -18,8 +18,9 @@ import org.springframework.stereotype.Component;
/**
* Task
* 0.
* 1.
* 2.
* 2.
* 2.
* 3.
*
* @author 3y
*/

@ -13,6 +13,7 @@ import com.java3y.austin.service.api.impl.domain.SendTaskModel;
import com.java3y.austin.support.pipeline.BusinessProcess;
import com.java3y.austin.support.pipeline.ProcessContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Iterator;
import java.util.List;
@ -25,6 +26,7 @@ import java.util.stream.Collectors;
*
*/
@Slf4j
@Service
public class AfterParamCheckAction implements BusinessProcess<SendTaskModel> {

@ -21,6 +21,7 @@ import com.java3y.austin.support.utils.ContentHolderUtil;
import com.java3y.austin.support.utils.TaskInfoUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
@ -31,6 +32,7 @@ import java.util.*;
* @description
*/
@Slf4j
@Service
public class AssembleAction implements BusinessProcess<SendTaskModel> {
@Autowired

@ -9,6 +9,7 @@ import com.java3y.austin.service.api.impl.domain.SendTaskModel;
import com.java3y.austin.support.pipeline.BusinessProcess;
import com.java3y.austin.support.pipeline.ProcessContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
@ -19,6 +20,7 @@ import java.util.stream.Collectors;
* @description
*/
@Slf4j
@Service
public class PreParamCheckAction implements BusinessProcess<SendTaskModel> {
@Override

@ -13,12 +13,14 @@ import com.java3y.austin.support.utils.KafkaUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
* @author 3y
* MQ
*/
@Slf4j
@Service
public class SendMqAction implements BusinessProcess<SendTaskModel> {
@Autowired

@ -6,15 +6,15 @@ import com.java3y.austin.service.api.impl.action.AfterParamCheckAction;
import com.java3y.austin.service.api.impl.action.AssembleAction;
import com.java3y.austin.service.api.impl.action.PreParamCheckAction;
import com.java3y.austin.service.api.impl.action.SendMqAction;
import com.java3y.austin.service.api.impl.domain.SendTaskModel;
import com.java3y.austin.support.pipeline.BusinessProcess;
import com.java3y.austin.support.pipeline.ProcessController;
import com.java3y.austin.support.pipeline.ProcessTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* apipipeline
@ -23,6 +23,14 @@ import java.util.Map;
@Configuration
public class PipelineConfig {
@Autowired
private PreParamCheckAction preParamCheckAction;
@Autowired
private AssembleAction assembleAction;
@Autowired
private AfterParamCheckAction afterParamCheckAction;
@Autowired
private SendMqAction sendMqAction;
/**
*
@ -35,14 +43,8 @@ public class PipelineConfig {
@Bean("commonSendTemplate")
public ProcessTemplate commonSendTemplate() {
ProcessTemplate processTemplate = new ProcessTemplate();
ArrayList<BusinessProcess> processList = new ArrayList<>();
processList.add(preParamCheckAction());
processList.add(assembleAction());
processList.add(afterParamCheckAction());
processList.add(sendMqAction());
processTemplate.setProcessList(processList);
processTemplate.setProcessList(Arrays.asList(preParamCheckAction, assembleAction,
afterParamCheckAction, sendMqAction));
return processTemplate;
}
@ -62,45 +64,4 @@ public class PipelineConfig {
return processController;
}
/**
* Action
*
* @return
*/
@Bean
public AssembleAction assembleAction() {
return new AssembleAction();
}
/**
* Action
*
* @return
*/
@Bean
public PreParamCheckAction preParamCheckAction() {
return new PreParamCheckAction();
}
/**
* Action
*
* @return
*/
@Bean
public AfterParamCheckAction afterParamCheckAction() {
return new AfterParamCheckAction();
}
/**
* MQAction
*
* @return
*/
@Bean
public SendMqAction sendMqAction() {
return new SendMqAction();
}
}

Loading…
Cancel
Save