xyz.erupt.cloud.server.model.CloudNodeProcess Maven / Gradle / Ivy
package xyz.erupt.cloud.server.model;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import xyz.erupt.annotation.fun.DataProxy;
import xyz.erupt.annotation.fun.TagsFetchHandler;
import xyz.erupt.annotation.sub_erupt.Tpl;
import xyz.erupt.cloud.server.node.MetaNode;
import xyz.erupt.cloud.server.node.NodeManager;
import xyz.erupt.core.config.GsonFactory;
import xyz.erupt.core.util.Erupts;
import xyz.erupt.jpa.dao.EruptDao;
import xyz.erupt.linq.lambda.LambdaSee;
import xyz.erupt.tpl.engine.EngineConst;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
/**
* @author YuePeng
* date 2024/5/7 22:02
*/
@Component
@Slf4j
public class CloudNodeProcess implements DataProxy, TagsFetchHandler, Tpl.TplHandler {
@Resource
private NodeManager nodeManager;
@Resource
private EruptDao eruptDao;
@Override
public void afterUpdate(CloudNode cloudNode) {
DataProxy.super.afterUpdate(cloudNode);
}
@Override
public void beforeAdd(CloudNode cloudNode) {
if (null == cloudNode.getAccessToken()) cloudNode.setAccessToken(Erupts.generateCode(16).toUpperCase());
}
@Override
public void beforeUpdate(CloudNode cloudNode) {
this.beforeAdd(cloudNode);
}
@Override
public void afterFetch(Collection
© 2015 - 2024 Weber Informatics LLC | Privacy Policy