Commit 1f530475 by huangfusuper

参数包装

parent e427390f
......@@ -32,7 +32,7 @@ import java.util.Map;
*/
@Component
@Slf4j
@MythRankOrder(1)
@MythRankOrder(2)
public class RpcCallbackInstanceRunTheLifeCycleCallback implements InstanceRunTheLifeCycleCallback {
@TaskClient(timeout = 30000, callMethodEnum = CallMethodEnum.SYNCHRONIZE)
......
package com.byit.strategy.instances;
import com.alibaba.fastjson.JSON;
import com.byit.annotations.MythRankOrder;
import com.byit.dto.plugin.FlowExtendedConfiguration;
import com.byit.enums.RedisKeyNameEnum;
import com.byit.model.RunRecording;
import com.byit.strategy.InstanceRunTheLifeCycleCallback;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
/**
* @author huangfu
* @date 2020年12月15日17:37:02
*/
@Component
@Slf4j
@MythRankOrder(1)
public class RunRecodingExtendedCinfigBroadcast implements InstanceRunTheLifeCycleCallback {
private final StringRedisTemplate stringRedisTemplate;
public RunRecodingExtendedCinfigBroadcast(StringRedisTemplate stringRedisTemplate) {
this.stringRedisTemplate = stringRedisTemplate;
}
/**
* 实例执行前
*
* @param runRecording 运行实例
* @return 两者的包装对象
*/
@Override
public RunRecording postProcessAfterInitialization(RunRecording runRecording) {
String extendedConfiguration = runRecording.getExtendedConfiguration();
FlowExtendedConfiguration flowExtendedConfiguration = JSON.parseObject(extendedConfiguration, FlowExtendedConfiguration.class);
String flowEmbedLogo = flowExtendedConfiguration.getFlowEmbedLogo();
String redisKey = String.format(RedisKeyNameEnum.REDIS_PUBLIC_PARAM_KEY.getKeyName(), runRecording.getRunId(), flowEmbedLogo);
stringRedisTemplate.opsForValue().set(redisKey, JSON.toJSONString(flowExtendedConfiguration));
return runRecording;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment