取消使用流程上下文自定义的字典数据;更改流程环境接口的输出方式

This commit is contained in:
fengjiayi
2024-11-08 17:30:51 +08:00
parent dff9a00fb6
commit 8c54b9a014
41 changed files with 448 additions and 505 deletions

View File

@@ -1,5 +1,6 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Serein.Library.Utils;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -97,7 +98,7 @@ namespace Serein.Library.Network.WebSocketCommunication.Handle
string msgId = jsonObject.GetValue(moduleConfig.MsgIdJsonKey)?.ToString();
if (_myMsgIdHash.Contains(msgId))
{
Console.WriteLine($"[{msgId}]{theme} 消息重复");
SereinEnv.WriteLine(InfoType.WARN, $"[{msgId}]{theme} 消息重复");
return;
}
context.MsgId = msgId; // 添加 ID
@@ -118,7 +119,7 @@ namespace Serein.Library.Network.WebSocketCommunication.Handle
}
catch (Exception ex)
{
Console.WriteLine($"error in ws : {ex.Message}{Environment.NewLine}json value:{jsonObject}");
SereinEnv.WriteLine(InfoType.ERROR, $"error in ws : {ex.Message}{Environment.NewLine}json value:{jsonObject}");
}
finally
{

View File

@@ -1,4 +1,5 @@
using System;
using Serein.Library.Utils;
using System;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
@@ -169,13 +170,13 @@ namespace Serein.Library.Network.WebSocketCommunication.Handle
return;
}
Console.WriteLine($"add websocket handle model :");
Console.WriteLine($"theme key, data key : {themeKey}, {dataKey}");
SereinEnv.WriteLine(InfoType.INFO, $"add websocket handle model :");
SereinEnv.WriteLine(InfoType.ERROR, $"theme key, data key : {themeKey}, {dataKey}");
foreach (var config in configs)
{
Console.WriteLine($"theme value : {config.ThemeValue} ");
SereinEnv.WriteLine(InfoType.ERROR, $"theme value : {config.ThemeValue} ");
var result = handleModule.AddHandleConfigs(config);
}

View File

@@ -56,17 +56,11 @@ namespace Serein.Library.Network.WebSocketCommunication
/// <summary>
/// 发送消息
/// </summary>
/// <param name="webSocket"></param>
/// <param name="message"></param>
/// <returns></returns>
public async Task SendAsync(string message)
{
//Console.WriteLine("发送消息");
//await Task.Delay(2000);
await SocketExtension.SendAsync(this._client, message); // 回复客户端
//Console.WriteLine();
//var buffer = Encoding.UTF8.GetBytes(message);
//await _client.SendAsync(new ArraySegment<byte>(buffer), WebSocketMessageType.Text, true, CancellationToken.None);
}
/// <summary>