Skip to content

Commit

Permalink
feat(plugins/duplicatiplugin): logUtil -> ILogger<SendController>
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyungent committed Jan 19, 2024
1 parent 22b8d17 commit a420e45
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 53 deletions.
15 changes: 11 additions & 4 deletions plugins/DuplicatiPlugin/Controllers/SendController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
using Telegram.Bot;
using DuplicatiPlugin.Models;
using System.Text.Json;
using Microsoft.Extensions.Logging;

namespace DuplicatiPlugin.Controllers
{
[ApiController]
[Route("api/Duplicati")]
public class SendController : ControllerBase
{
private readonly ILogger<SendController> _logger;

public SendController(ILogger<SendController> logger)
{
_logger = logger;
}

#region Actions

[HttpGet, HttpPost]
Expand Down Expand Up @@ -46,9 +54,8 @@ await botClient.SendTextMessageAsync(
}
catch (Exception ex)
{
Utils.LogUtil.Exception(ex);
_logger.LogError(ex, message: nameof(DuplicatiPlugin));
}

}

// 解析 message
Expand Down Expand Up @@ -103,7 +110,7 @@ await botClient.SendTextMessageAsync(
}
catch (Exception ex)
{
Utils.LogUtil.Exception(ex);
_logger.LogError(ex, message: nameof(DuplicatiPlugin));

return Ok("fail");
}
Expand Down Expand Up @@ -174,7 +181,7 @@ await botClient.SendTextMessageAsync(
}
catch (Exception ex)
{
Utils.LogUtil.Exception(ex);
_logger.LogError(ex, message: nameof(DuplicatiPlugin));

return Ok("fail");
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/DuplicatiPlugin/DuplicatiPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>PluginCore.Plugins.DuplicatiPlugin</PackageId>
<Version>0.2.2</Version>
<FileVersion>0.2.2.0</FileVersion>
<Version>0.2.3</Version>
<FileVersion>0.2.3.0</FileVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Company>yiyun</Company>
<Authors>yiyun</Authors>
Expand Down
2 changes: 1 addition & 1 deletion plugins/DuplicatiPlugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@
> 本项目基于 [TelegramBots/Telegram.Bot: .NET Client for Telegram Bot API](https://github.com/TelegramBots/Telegram.Bot)
<!-- Matomo Image Tracker-->
<img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.moeci.com/matomo.php?idsite=2&amp;rec=1&amp;action_name=PluginCore.Plugins..DuplicatiPlugin-v0.2.2.README" style="border:0" alt="" />
<img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.moeci.com/matomo.php?idsite=2&amp;rec=1&amp;action_name=PluginCore.Plugins..DuplicatiPlugin-v0.2.3.README" style="border:0" alt="" />
<!-- End Matomo -->
45 changes: 0 additions & 45 deletions plugins/DuplicatiPlugin/Utils/LogUtil.cs

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/DuplicatiPlugin/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"DisplayName": "Duplicati插件",
"Description": "Duplicati插件",
"Author": "yiyun",
"Version": "0.2.2",
"Version": "0.2.3",
"SupportedVersions": [ "0.0.1" ]
}

0 comments on commit a420e45

Please sign in to comment.