-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Anime-Manga/dev
## [2.0.0] - 16-10-2023
- Loading branch information
Showing
111 changed files
with
887 additions
and
4,936 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,12 @@ jobs: | |
id: meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ${{ secrets.DOCKER_USER }}/animemanga-notifyservice:1.1.0 | ||
images: ${{ secrets.DOCKER_USER }}/animemanga-notifyservice:2.0.0 | ||
|
||
- name: Build the Docker image Notify Service | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKER_USER }}/animemanga-notifyservice:1.1.0, ${{ secrets.DOCKER_USER }}/animemanga-notifyservice:latest | ||
tags: ${{ secrets.DOCKER_USER }}/animemanga-notifyservice:2.0.0, ${{ secrets.DOCKER_USER }}/animemanga-notifyservice:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/Cesxhin.AnimeManga.Application/Cesxhin.AnimeManga.Application.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BCrypt.Net-Core" Version="1.6.0" /> | ||
<PackageReference Include="Discord.Net.Webhook" Version="3.10.0" /> | ||
<PackageReference Include="FFMpegCore" Version="5.1.0" /> | ||
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" /> | ||
<PackageReference Include="m3uParser.NET" Version="1.0.17" /> | ||
<PackageReference Include="MassTransit.RabbitMQ" Version="8.0.14" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" /> | ||
<PackageReference Include="MongoDB.Bson" Version="2.19.1" /> | ||
<PackageReference Include="NLog" Version="5.1.3" /> | ||
<PackageReference Include="Quartz" Version="3.4.0" /> | ||
<PackageReference Include="Telegram.Bot" Version="19.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\references\Cesxhin.AnimeManga.Domain\Cesxhin.AnimeManga.Domain.csproj" /> | ||
<ProjectReference Include="..\references\Cesxhin.AnimeManga.Modules\Cesxhin.AnimeManga.Modules.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
33 changes: 33 additions & 0 deletions
33
src/Cesxhin.AnimeManga.Application/Consumers/NotifyBookConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Cesxhin.AnimeManga.Application.Notify; | ||
using Cesxhin.AnimeManga.Modules.NlogManager; | ||
using Cesxhin.AnimeManga.Domain.DTO; | ||
using Discord.Webhook; | ||
using MassTransit; | ||
using NLog; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Consumers | ||
{ | ||
public class NotifyBookConsumer : IConsumer<NotifyMangaDTO> | ||
{ | ||
//nlog | ||
private readonly NLogConsole _logger = new(LogManager.GetCurrentClassLogger()); | ||
|
||
//webhook discord | ||
private readonly string _webhookDiscord = Environment.GetEnvironmentVariable("WEBHOOK_DISCORD_BOOK"); | ||
|
||
public Task Consume(ConsumeContext<NotifyMangaDTO> context) | ||
{ | ||
DiscordWebhookClient discord = new(_webhookDiscord); | ||
var managementNotify = new NotifyDiscord(); | ||
|
||
var notify = context.Message; | ||
_logger.Info($"Recive this message: {notify.Message}"); | ||
|
||
managementNotify.SendNotify(discord, GenericNotify.NotifyMangaDTOToGenericNotify(notify), null); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Cesxhin.AnimeManga.Application/Consumers/NotifyBookTelegramConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Cesxhin.AnimeManga.Application.Notify; | ||
using Cesxhin.AnimeManga.Modules.NlogManager; | ||
using Cesxhin.AnimeManga.Domain.DTO; | ||
using MassTransit; | ||
using NLog; | ||
using System; | ||
using System.Threading.Tasks; | ||
using Telegram.Bot; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Consumers | ||
{ | ||
public class NotifyBookTelegramConsumer : IConsumer<NotifyMangaDTO> | ||
{ | ||
//nlog | ||
private readonly NLogConsole _logger = new(LogManager.GetCurrentClassLogger()); | ||
|
||
//settings for bot telegram | ||
private readonly string tokenBot = Environment.GetEnvironmentVariable("TOKEN_BOT"); | ||
private readonly string chat_id = Environment.GetEnvironmentVariable("CHAT_ID"); | ||
|
||
public Task Consume(ConsumeContext<NotifyMangaDTO> context) | ||
{ | ||
var botTelegram = new TelegramBotClient(tokenBot); | ||
var managementNotify = new NotifyTelegramChannel(); | ||
|
||
var notify = context.Message; | ||
_logger.Info($"Recive this message: {context.MessageId}"); | ||
|
||
managementNotify.SendNotify(botTelegram, GenericNotify.NotifyMangaDTOToGenericNotify(notify), chat_id); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Cesxhin.AnimeManga.Application/Consumers/NotifyRequestBookConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Cesxhin.AnimeManga.Application.Notify; | ||
using Cesxhin.AnimeManga.Modules.NlogManager; | ||
using Cesxhin.AnimeManga.Domain.DTO; | ||
using Discord.Webhook; | ||
using MassTransit; | ||
using NLog; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Consumers | ||
{ | ||
public class NotifyRequestBookConsumer : IConsumer<NotifyRequestMangaDTO> | ||
{ | ||
//nlog | ||
private readonly NLogConsole _logger = new(LogManager.GetCurrentClassLogger()); | ||
|
||
//webhook discord | ||
private readonly string _webhookDiscord = Environment.GetEnvironmentVariable("WEBHOOK_DISCORD_BOOK_REQUEST"); | ||
|
||
public Task Consume(ConsumeContext<NotifyRequestMangaDTO> context) | ||
{ | ||
DiscordWebhookClient discord = new(_webhookDiscord); | ||
var managementNotify = new NotifyDiscord(); | ||
|
||
var notify = context.Message; | ||
_logger.Info($"Recive this message: {notify.Message}"); | ||
|
||
managementNotify.SendNotify(discord, GenericNotify.NotifyRequestMangaDTOToGenericNotify(notify), null); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Cesxhin.AnimeManga.Application/Consumers/NotifyRequestBookTelegramConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Cesxhin.AnimeManga.Application.Notify; | ||
using Cesxhin.AnimeManga.Modules.NlogManager; | ||
using Cesxhin.AnimeManga.Domain.DTO; | ||
using MassTransit; | ||
using NLog; | ||
using System; | ||
using System.Threading.Tasks; | ||
using Telegram.Bot; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Consumers | ||
{ | ||
public class NotifyRequestBookTelegramConsumer : IConsumer<NotifyRequestMangaDTO> | ||
{ | ||
//nlog | ||
private readonly NLogConsole _logger = new(LogManager.GetCurrentClassLogger()); | ||
|
||
//settings for bot telegram | ||
private readonly string tokenBot = Environment.GetEnvironmentVariable("TOKEN_BOT"); | ||
private readonly string chat_id = Environment.GetEnvironmentVariable("CHAT_ID_REQUEST"); | ||
|
||
public Task Consume(ConsumeContext<NotifyRequestMangaDTO> context) | ||
{ | ||
var botTelegram = new TelegramBotClient(tokenBot); | ||
var managementNotify = new NotifyTelegramChannel(); | ||
|
||
var notify = context.Message; | ||
_logger.Info($"Recive this message: {context.MessageId}"); | ||
|
||
managementNotify.SendNotify(botTelegram, GenericNotify.NotifyRequestMangaDTOToGenericNotify(notify), chat_id); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Cesxhin.AnimeManga.Application/Consumers/NotifyRequestVideoConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Cesxhin.AnimeManga.Application.Notify; | ||
using Cesxhin.AnimeManga.Modules.NlogManager; | ||
using Cesxhin.AnimeManga.Domain.DTO; | ||
using Discord.Webhook; | ||
using MassTransit; | ||
using NLog; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Consumers | ||
{ | ||
public class NotifyRequestVideoConsumer : IConsumer<NotifyRequestAnimeDTO> | ||
{ | ||
//nlog | ||
private readonly NLogConsole _logger = new(LogManager.GetCurrentClassLogger()); | ||
|
||
//webhook discord | ||
private readonly string _webhookDiscord = Environment.GetEnvironmentVariable("WEBHOOK_DISCORD_VIDEO_REQUEST"); | ||
|
||
public Task Consume(ConsumeContext<NotifyRequestAnimeDTO> context) | ||
{ | ||
DiscordWebhookClient discord = new(_webhookDiscord); | ||
var managementNotify = new NotifyDiscord(); | ||
|
||
var notify = context.Message; | ||
_logger.Info($"Recive this message: {notify.Message}"); | ||
|
||
managementNotify.SendNotify(discord, GenericNotify.NotifyRequestAnimeDTOToGenericNotify(notify), null); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Cesxhin.AnimeManga.Application/Consumers/NotifyRequestVideoTelegramConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Cesxhin.AnimeManga.Application.Notify; | ||
using Cesxhin.AnimeManga.Modules.NlogManager; | ||
using Cesxhin.AnimeManga.Domain.DTO; | ||
using MassTransit; | ||
using NLog; | ||
using System; | ||
using System.Threading.Tasks; | ||
using Telegram.Bot; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Consumers | ||
{ | ||
public class NotifyRequestVideoTelegramConsumer : IConsumer<NotifyRequestAnimeDTO> | ||
{ | ||
//nlog | ||
private readonly NLogConsole _logger = new(LogManager.GetCurrentClassLogger()); | ||
|
||
//settings for bot telegram | ||
private readonly string tokenBot = Environment.GetEnvironmentVariable("TOKEN_BOT"); | ||
private readonly string chat_id = Environment.GetEnvironmentVariable("CHAT_ID_REQUEST"); | ||
|
||
public Task Consume(ConsumeContext<NotifyRequestAnimeDTO> context) | ||
{ | ||
var botTelegram = new TelegramBotClient(tokenBot); | ||
var managementNotify = new NotifyTelegramChannel(); | ||
|
||
var notify = context.Message; | ||
_logger.Info($"Recive this message: {context.MessageId}"); | ||
|
||
managementNotify.SendNotify(botTelegram, GenericNotify.NotifyRequestAnimeDTOToGenericNotify(notify), chat_id); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Cesxhin.AnimeManga.Application/Consumers/NotifyVideoConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Cesxhin.AnimeManga.Application.Notify; | ||
using Cesxhin.AnimeManga.Modules.NlogManager; | ||
using Cesxhin.AnimeManga.Domain.DTO; | ||
using Discord.Webhook; | ||
using MassTransit; | ||
using NLog; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Consumers | ||
{ | ||
public class NotifyVideoConsumer : IConsumer<NotifyAnimeDTO> | ||
{ | ||
//nlog | ||
private readonly NLogConsole _logger = new(LogManager.GetCurrentClassLogger()); | ||
|
||
//webhook discord | ||
private readonly string _webhookDiscord = Environment.GetEnvironmentVariable("WEBHOOK_DISCORD_VIDEO"); | ||
|
||
public Task Consume(ConsumeContext<NotifyAnimeDTO> context) | ||
{ | ||
DiscordWebhookClient discord = new(_webhookDiscord); | ||
var managementNotify = new NotifyDiscord(); | ||
|
||
var notify = context.Message; | ||
_logger.Info($"Recive this message: {notify.Message}"); | ||
|
||
managementNotify.SendNotify(discord, GenericNotify.NotifyAnimeDTOToGenericNotify(notify), null); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/Cesxhin.AnimeManga.Application/Consumers/NotifyVideoTelegramConsumer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Cesxhin.AnimeManga.Application.Notify; | ||
using Cesxhin.AnimeManga.Modules.NlogManager; | ||
using Cesxhin.AnimeManga.Domain.DTO; | ||
using MassTransit; | ||
using NLog; | ||
using System; | ||
using System.Threading.Tasks; | ||
using Telegram.Bot; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Consumers | ||
{ | ||
public class NotifyVideoTelegramConsumer : IConsumer<NotifyAnimeDTO> | ||
{ | ||
//nlog | ||
private readonly NLogConsole _logger = new(LogManager.GetCurrentClassLogger()); | ||
|
||
//settings for bot telegram | ||
private readonly string tokenBot = Environment.GetEnvironmentVariable("TOKEN_BOT"); | ||
private readonly string chat_id = Environment.GetEnvironmentVariable("CHAT_ID"); | ||
|
||
public Task Consume(ConsumeContext<NotifyAnimeDTO> context) | ||
{ | ||
var botTelegram = new TelegramBotClient(tokenBot); | ||
var managementNotify = new NotifyTelegramChannel(); | ||
|
||
var notify = context.Message; | ||
_logger.Info($"Recive this message: {context.MessageId}"); | ||
|
||
managementNotify.SendNotify(botTelegram, GenericNotify.NotifyAnimeDTOToGenericNotify(notify), chat_id); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Discord.Webhook; | ||
|
||
namespace Cesxhin.AnimeManga.Application.Notify | ||
{ | ||
public abstract class Notify<S, T> | ||
{ | ||
public abstract void SendNotify(S whereSend, T notify, string token); | ||
} | ||
} |
Oops, something went wrong.