Files
linker/linker.messenger.flow/FlowTransfer.cs
snltty 0ad8e6ebfa sync
2025-01-01 19:01:07 +08:00

25 lines
710 B
C#

using linker.libs;
namespace linker.messenger.flow
{
public sealed class FlowTransfer
{
private List<IFlow> flows = new List<IFlow>();
public FlowTransfer()
{
}
public void AddFlows(List<IFlow> list)
{
LoggerHelper.Instance.Info($"add flow {string.Join(",", list.Select(c => c.GetType().Name))}");
this.flows = this.flows.Concat(list).Distinct().ToList();
}
public Dictionary<string, FlowItemInfo> GetFlows()
{
return flows.Select(c => new FlowItemInfo { ReceiveBytes = c.ReceiveBytes, SendtBytes = c.SendtBytes, FlowName = c.FlowName }).ToDictionary(c => c.FlowName);
}
}
}