Skip to content

Commit

Permalink
[OneBot] Fix misc style
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Feb 12, 2024
1 parent 5278f4f commit d74d08b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace Lagrange.OneBot.Core;
namespace Lagrange.OneBot.Core.Entity;

[Serializable]
public class OneBotFriend
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Text.Json.Nodes;
using Lagrange.Core;
using Lagrange.Core.Common.Interface.Api;
using Lagrange.OneBot.Core.Entity;
using Lagrange.OneBot.Core.Entity.Action;

namespace Lagrange.OneBot.Core.Operation.Info;
Expand Down
9 changes: 4 additions & 5 deletions Lagrange.OneBot/Utility/OneBotSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Lagrange.OneBot.Utility;

public class OneBotSigner : SignProvider
{
private const string Tag = nameof(OneBotSigner);
private readonly string _signServer;
private readonly ILogger _logger;
private readonly Timer _timer;
Expand All @@ -25,11 +24,11 @@ public OneBotSigner(IConfiguration config, ILogger<OneBotSigner> logger)
if (string.IsNullOrEmpty(_signServer))
{
Available = false;
logger.LogWarning($"[{Tag}]: Signature Service is not available, login may be failed");
logger.LogWarning("Signature Service is not available, login may be failed");
}
else
{
logger.LogInformation($"[{Tag}]: Signature Service is successfully established");
logger.LogInformation("Signature Service is successfully established");
}

_timer = new Timer(_ =>
Expand Down Expand Up @@ -67,7 +66,7 @@ public OneBotSigner(IConfiguration config, ILogger<OneBotSigner> logger)
Available = false;
_timer.Change(0, 5000);

_logger.LogWarning($"[{Tag}] Failed to get signature, using dummy signature");
_logger.LogWarning("Failed to get signature, using dummy signature");
return new byte[35]; // Dummy signature
}
}
Expand All @@ -79,7 +78,7 @@ public override bool Test()
string response = Http.GetAsync($"{_signServer}/ping").GetAwaiter().GetResult();
if (JsonSerializer.Deserialize<JsonObject>(response)?["code"]?.GetValue<int>() == 0)
{
_logger.LogInformation($"[{Tag}] Reconnected to Signature Service successfully");
_logger.LogInformation("Reconnected to Signature Service successfully");
return true;
}
}
Expand Down

0 comments on commit d74d08b

Please sign in to comment.