commit 609402b04c88d0a5cbedc87ab747465c3d4c227a Author: Hadi Khazaee Asl Date: Wed Nov 11 13:36:09 2026 +0330 Initialize Commit ... diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1bd9d0b --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# +# DotNet ... +bin +obj + +# +# Natural Docs ... +Documentation/* diff --git a/Configuration/Entities/XBotUserEntityConfiguration.cs b/Configuration/Entities/XBotUserEntityConfiguration.cs new file mode 100644 index 0000000..4c4d52d --- /dev/null +++ b/Configuration/Entities/XBotUserEntityConfiguration.cs @@ -0,0 +1,16 @@ +using xBotService.Constants; +using xDataService.Providers; +using xBotService.Models.Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace xBotService.Configuration.Entities +{ + public class XBotUserEntityConfiguration: XBaseEntityTypeConfiguration + { + public override void Configure(EntityTypeBuilder builder) + { + builder.ToTable(XBotServiceConstants.XBotUsersTable); + } + } +} \ No newline at end of file diff --git a/Constants/ConfigurationNodeNames.cs b/Constants/ConfigurationNodeNames.cs new file mode 100644 index 0000000..8c8c3a7 --- /dev/null +++ b/Constants/ConfigurationNodeNames.cs @@ -0,0 +1,7 @@ +namespace xBotService.Constants +{ + public partial struct ConfigurationNodeNames + { + public const string BOT_SERVICE_NODE = "BotServiceConfiguration"; + } +} \ No newline at end of file diff --git a/Constants/XBotServiceConstants.cs b/Constants/XBotServiceConstants.cs new file mode 100644 index 0000000..78cf773 --- /dev/null +++ b/Constants/XBotServiceConstants.cs @@ -0,0 +1,27 @@ +namespace xBotService.Constants +{ + public struct XBotServiceConstants + { + // + // Bot Service Log Tag ... + public const string XBotServiceDILogTag = "XBotService"; + + // + // Table Mapping ... + public const string XBotUserTable = "BotUsers"; + + // + // GraphQL Mappings ... + public const string XBotUserSingleName = "botUser"; + public const string XBotUserCollectionName = "botUsers"; + + // + // Hubs ... + public const string XBotUserDtoHub = "botUserDto"; + public const string XBotUserEntityHub = "botUserEntity"; + + // + // Helper Method Names ... + public const string GetXBotUserEFRepositoryDescriptor = "GetXBotUserEFRepositoryDescriptor"; + } +} \ No newline at end of file diff --git a/Interfaces/Entities/Dtos/IXBotUserRepositoryService.cs b/Interfaces/Entities/Dtos/IXBotUserRepositoryService.cs new file mode 100644 index 0000000..1320293 --- /dev/null +++ b/Interfaces/Entities/Dtos/IXBotUserRepositoryService.cs @@ -0,0 +1,9 @@ +using xBotService.Models.Dtos; +using xDataService.Interfaces; +using xBotService.Models.Entities; + +namespace xBotService.Interfaces.Entities.Dtos +{ + public interface IXBotUserRepositoryService : IXBaseRepositoryService + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXBotUserKeyGenerator.cs b/Interfaces/Entities/IXBotUserKeyGenerator.cs new file mode 100644 index 0000000..9d20288 --- /dev/null +++ b/Interfaces/Entities/IXBotUserKeyGenerator.cs @@ -0,0 +1,8 @@ +using xDataService.Interfaces; +using xBotService.Models.Entities; + +namespace xBotService.Interfaces.Entities +{ + public interface IXBotUserKeyGenerator : IXKeyGenerator + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXBotUserRepository.cs b/Interfaces/Entities/IXBotUserRepository.cs new file mode 100644 index 0000000..6f6c983 --- /dev/null +++ b/Interfaces/Entities/IXBotUserRepository.cs @@ -0,0 +1,8 @@ +using xDataService.Interfaces; +using xBotService.Models.Entities; + +namespace xBotService.Interfaces.Entities +{ + public interface IXBotUserRepository : IXBaseRepository + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXBotUserRepositoryEvents.cs b/Interfaces/Entities/IXBotUserRepositoryEvents.cs new file mode 100644 index 0000000..9e18e5e --- /dev/null +++ b/Interfaces/Entities/IXBotUserRepositoryEvents.cs @@ -0,0 +1,8 @@ +using xDataService.Interfaces; +using xBotService.Models.Entities; + +namespace xBotService.Interfaces.Entities +{ + public interface IXBotUserRepositoryEvents : IXBaseRepositoryEvents + { } +} \ No newline at end of file diff --git a/Models/Dtos/XBotUserDto.cs b/Models/Dtos/XBotUserDto.cs new file mode 100644 index 0000000..73e83a1 --- /dev/null +++ b/Models/Dtos/XBotUserDto.cs @@ -0,0 +1,29 @@ +using xModels.Base; +using xModels.Dtos; + +namespace xBotService.Models.Dtos +{ + /// + /// Bot User / System User Relation ... + /// + public class XBotUserDto : XBaseIntIDEntityDto + { + /// + /// User Id ... + /// + /// + public string UserId { get; set; } + + /// + /// System Person Information ... + /// + /// + public virtual XPersonDto User { get; set; } = null; + + /// + /// Chat Bot User Name ... + /// + /// + public string BotUserName { get; set; } + } +} \ No newline at end of file diff --git a/Models/Entities/XBotUser.cs b/Models/Entities/XBotUser.cs new file mode 100644 index 0000000..054947e --- /dev/null +++ b/Models/Entities/XBotUser.cs @@ -0,0 +1,22 @@ +using xModels.Base; + +namespace xBotService.Models.Entities +{ + /// + /// Bot User / System User Relation ... + /// + public class XBotUser : XBaseIntIDEntity + { + /// + /// User Id ... + /// + /// + public string UserId { get; set; } + + /// + /// Chat Bot User Name ... + /// + /// + public string BotUserName { get; set; } + } +} \ No newline at end of file diff --git a/Providers/Dtos/XBotUserRepositoryService.cs b/Providers/Dtos/XBotUserRepositoryService.cs new file mode 100644 index 0000000..317b5e8 --- /dev/null +++ b/Providers/Dtos/XBotUserRepositoryService.cs @@ -0,0 +1,19 @@ +using AutoMapper; +using xDataService.Providers; +using xBotService.Models.Dtos; +using xBotService.Models.Entities; +using System.Collections.Generic; +using xBotService.Interfaces.Entities; +using xBotService.Interfaces.Entities.Dtos; + +namespace xBotService.Providers.Dtos +{ + public class XBotUserRepositoryService : XBaseRepositoryService, IXBotUserRepositoryService + { + public XBotUserRepositoryService( + IXBotUserRepository repository, + IEnumerable mapperProfiles = null + ) : base(repository, mapperProfiles) + { } + } +} \ No newline at end of file diff --git a/Providers/Entities/XBotUserEFRepository.cs b/Providers/Entities/XBotUserEFRepository.cs new file mode 100644 index 0000000..aff0308 --- /dev/null +++ b/Providers/Entities/XBotUserEFRepository.cs @@ -0,0 +1,21 @@ +using xDataService.Db; +using xDataService.Providers; +using xDataService.Interfaces; +using xDataService.Configuration; +using xBotService.Models.Entities; +using xBotService.Interfaces.Entities; + +namespace xBotService.Providers.Entities +{ + public class XBotUserEFRepository : XBaseEFRepository, IXBotUserRepository + where TContext : XDbContext + { + public XBotUserEFRepository( + IXUnitOfWorks unitOfWorks, + XDataServiceConfiguration configuration, + IXBotUserKeyGenerator keyGenerator = null, + IXBotUserRepositoryEvents baseRepositoryEvents = null + ) : base(unitOfWorks, configuration, keyGenerator, baseRepositoryEvents) + { } + } +} \ No newline at end of file diff --git a/Providers/Entities/XBotUserKeyGenerator.cs b/Providers/Entities/XBotUserKeyGenerator.cs new file mode 100644 index 0000000..1a5e62c --- /dev/null +++ b/Providers/Entities/XBotUserKeyGenerator.cs @@ -0,0 +1,9 @@ +using xDataService.Providers; +using xBotService.Models.Entities; +using xBotService.Interfaces.Entities; + +namespace xBotService.Providers.Entities +{ + public class XBotUserKeyGenerator : XIntKeyGenerator, IXBotUserKeyGenerator + { } +} \ No newline at end of file diff --git a/Providers/Entities/XBotUserRepositoryEvents.cs b/Providers/Entities/XBotUserRepositoryEvents.cs new file mode 100644 index 0000000..3d7dd82 --- /dev/null +++ b/Providers/Entities/XBotUserRepositoryEvents.cs @@ -0,0 +1,9 @@ +using xDataService.Providers; +using xBotService.Models.Entities; +using xBotService.Interfaces.Entities; + +namespace xBotService.Providers.Entities +{ + public class XBotUserRepositoryEvents : XBaseRepositoryEvents, IXBotUserRepositoryEvents + { } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..25c0e00 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# xLoggingService + +provide all commonly used actions/extensions and classes which required to Bot Management Feature in xDashboard project. + +## Implementing + +after adding this package as a dependency to your project you can do following: + +### 1. Register it on DI + +```c# +``` + + + +## Maintainer + +Hadi Khazaee asl + +[https://www.saherelm.ir](https://www.saherelm.ir) + +[hadi_khazaee_asl@yahoo.com](mailto:hadi_khazaee_asl@yahoo.com) diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000..15cb0f4 --- /dev/null +++ b/nuget.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/xBotService.csproj b/xBotService.csproj new file mode 100644 index 0000000..a475e40 --- /dev/null +++ b/xBotService.csproj @@ -0,0 +1,46 @@ + + + + + 1.0.0 + 12.0 + Hadi Khazaee Asl + SaherElm IT Center + xDashboard.xBotService + netstandard2.0 + + + provide all commonly used actions/extensions and classes which required to Bot Management Feature in xDashboard project. + + + + icon.png + + + + + + + + + + + + + + + + + + + + + + + + $(NoWarn);1591 + true + true + + +