commit e134b8f16ae14d4cc4d929b5202df6fc09e1dc4a Author: Fahmeed Mahmud Alvee Date: Tue Mar 24 14:21:50 2026 +0600 init diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..9fab42f --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,13 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "8.0.8", + "commands": [ + "dotnet-ef" + ], + "rollForward": false + } + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2fea15 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Build output +bin/ +obj/ \ No newline at end of file diff --git a/Controllers/UserController.cs b/Controllers/UserController.cs new file mode 100644 index 0000000..dd949bd --- /dev/null +++ b/Controllers/UserController.cs @@ -0,0 +1,106 @@ +using cel.hrm.mobile.api.Models; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace cel.hrm.mobile.api.Controllers +{ + [ApiController] + [Route("api/Mobile/User")] + [Authorize] + public class UserController : ControllerBase + { + [HttpPost] + [Route("GetApiLink")] + [AllowAnonymous] + public ActionResult GetApiLink(MobileApiDetails oMobileApiDetails) + { + string address = ""; + string companyName = ""; + try + { + string domain = string.Empty; + string[] parts = oMobileApiDetails.EmailAddress!.Split('@'); + + if (parts.Length >= 2) + { + domain = parts[1].ToLower(); + } + + switch (domain) + { + case "celimited.com": + address = "https://celbd.com/celhrmmobiletest/api/Mobile/"; + companyName = "CEL"; + //address = "http://100.100.100.15:45456/api/Mobile/"; + break; + + case "shvenergybd.com": + //address = "https://celclouds.com/petromax/api/Mobile/"; + companyName = "Petromax"; + address = "http://100.100.100.19:45456/api/Mobile/"; + //address = "https://celbd.com/petromaxHRUAT/api/Mobile/"; + break; + + case "lifung.com": + case "lfsourcing.com": + case "neotangent.com": + case "lfmilesgroup.com": + //address = "https://celclouds.com/lifungbd/api/Mobile/"; + companyName = "LF"; + address = "http://100.100.100.15:45457/api/Mobile/"; + break; + + case "hm.com": + case "HM.COM": + case "arket.com": + case "weekday.com": + address = "https://bdpohr01.azurewebsites.net/api/Mobile/"; + companyName = "H&M"; + //address = "http://100.100.100.19:45455/api/Mobile/"; + break; + + case "wartsila.com": + address = "https://celclouds.com/WartsilaHR/api/Mobile/"; + companyName = "Wartsila"; + //address = "http://100.100.100.19:45456/api/Mobile/"; + break; + + case "texebo-bd.com": + //temporary + if (DateTime.UtcNow > new DateTime(2026, 3, 11, 16, 0, 0)) + address = "https://hris.texebo-bd.net/texebohrms/api/Mobile/"; + else + address = "https://celclouds.com/texebohrms/api/Mobile/"; + companyName = "Tex-Ebo"; + //address = "http://100.100.100.19:45457/api/Mobile/"; + break; + + case "duncanbd.com": + address = "https://hrm.duncanbd.net/api/Mobile/"; + //address = "https://celclouds.com/texebohrms/api/Mobile/"; + companyName = "Duncan BD"; + //address = "http://100.100.100.19:45457/api/Mobile/"; + break; + + case "customdomain.com": + Console.WriteLine("This is a Custom Domain address."); + break; + + default: + //address = "https://celbd.com/celhrmmobiletest/api/Mobile/"; + //companyName = "CEL"; + //address = "http://100.100.100.15:45456/api/Mobile/"; + //return StatusCode(StatusCodes.Status500InternalServerError, "Invalid Email Address " + oMobileApiDetails.EmailAddress); + //throw new CustomException(Error, "Employee does not exists in the system"); + //break; + return Ok("Invalid Email Address"); + } + } + catch (Exception e) + { + return StatusCode(StatusCodes.Status500InternalServerError, e.Message); + } + return Ok("companyname#" + companyName + "#" + "address#" + address + "#"); + } + } +} diff --git a/Models/MobileApiDetails.cs b/Models/MobileApiDetails.cs new file mode 100644 index 0000000..8b5e077 --- /dev/null +++ b/Models/MobileApiDetails.cs @@ -0,0 +1,13 @@ +namespace cel.hrm.mobile.api.Models +{ + public class MobileApiDetails + { + public int EmpID { get; set; } + public string? EmpNo { get; set; } + public string? EmailAddress { get; set; } + public string? VersionNumber { get; set; } + public string? DeviceID { get; set; } + public string? ConnectionString { get; set; } + public string? CompanyName { get; set; } + } +} diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..e1f6952 --- /dev/null +++ b/Program.cs @@ -0,0 +1,24 @@ +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllers(); + +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); + + diff --git a/Properties/PublishProfiles/FolderProfile.pubxml b/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..e939118 --- /dev/null +++ b/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,17 @@ + + + + + false + false + true + Release + Any CPU + FileSystem + D:\mob api link + FileSystem + <_TargetId>Folder + + \ No newline at end of file diff --git a/Properties/PublishProfiles/FolderProfile.pubxml.user b/Properties/PublishProfiles/FolderProfile.pubxml.user new file mode 100644 index 0000000..529b871 --- /dev/null +++ b/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -0,0 +1,11 @@ + + + + + <_PublishTargetUrl>D:\mob api link + True|2024-08-29T09:47:29.7935405Z;True|2024-08-28T12:17:07.3753533+06:00;True|2024-08-25T14:48:29.6318775+06:00;True|2024-08-25T12:29:37.1677516+06:00;True|2024-07-15T17:47:18.4638143+06:00; + + + \ No newline at end of file diff --git a/Properties/PublishProfiles/FolderProfile1.pubxml b/Properties/PublishProfiles/FolderProfile1.pubxml new file mode 100644 index 0000000..2bd92f5 --- /dev/null +++ b/Properties/PublishProfiles/FolderProfile1.pubxml @@ -0,0 +1,21 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + D:\Published + FileSystem + <_TargetId>Folder + + net8.0 + dba022c4-ef81-43e4-8898-1570e5a85be1 + false + + \ No newline at end of file diff --git a/Properties/PublishProfiles/FolderProfile1.pubxml.user b/Properties/PublishProfiles/FolderProfile1.pubxml.user new file mode 100644 index 0000000..37c797e --- /dev/null +++ b/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -0,0 +1,11 @@ + + + + + <_PublishTargetUrl>D:\Published + True|2024-09-05T05:59:24.0796753Z||;True|2024-09-02T16:26:11.2605613+06:00||; + + + \ No newline at end of file diff --git a/Properties/PublishProfiles/FolderProfile2.pubxml b/Properties/PublishProfiles/FolderProfile2.pubxml new file mode 100644 index 0000000..0e6af39 --- /dev/null +++ b/Properties/PublishProfiles/FolderProfile2.pubxml @@ -0,0 +1,21 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + D:\Published\cel.hrm.mobile.api + FileSystem + <_TargetId>Folder + + net8.0 + dba022c4-ef81-43e4-8898-1570e5a85be1 + false + + \ No newline at end of file diff --git a/Properties/PublishProfiles/FolderProfile2.pubxml.user b/Properties/PublishProfiles/FolderProfile2.pubxml.user new file mode 100644 index 0000000..14e446b --- /dev/null +++ b/Properties/PublishProfiles/FolderProfile2.pubxml.user @@ -0,0 +1,11 @@ + + + + + <_PublishTargetUrl>D:\Published\cel.hrm.mobile.api + True|2026-03-11T09:48:44.3637366Z||;True|2026-03-11T12:39:49.9033553+06:00||;True|2026-03-11T12:19:09.9203092+06:00||;True|2026-02-23T12:52:43.3569190+06:00||;True|2026-02-23T12:49:30.5308946+06:00||;True|2026-02-09T10:40:57.8264197+06:00||;True|2026-02-08T18:39:32.9176679+06:00||;True|2025-12-24T12:01:48.6692354+06:00||;True|2025-12-15T14:42:07.9515065+06:00||;True|2025-12-02T10:05:52.0687245+06:00||;True|2025-12-01T17:41:58.9313241+06:00||;True|2025-02-10T11:32:18.0515717+06:00||;True|2024-12-04T14:19:19.0933707+06:00||; + + + \ No newline at end of file diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..d6f9a75 --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:14374", + "sslPort": 44314 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5125", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7268;http://localhost:5125", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/appsettings.Development.json b/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/cel.hrm.mobile.api.csproj b/cel.hrm.mobile.api.csproj new file mode 100644 index 0000000..dbedb64 --- /dev/null +++ b/cel.hrm.mobile.api.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/cel.hrm.mobile.api.csproj.user b/cel.hrm.mobile.api.csproj.user new file mode 100644 index 0000000..ff8fc8c --- /dev/null +++ b/cel.hrm.mobile.api.csproj.user @@ -0,0 +1,10 @@ + + + + IIS Express + D:\cel.hrm.mobile.api\Properties\PublishProfiles\FolderProfile2.pubxml + + + ProjectDebugger + + \ No newline at end of file diff --git a/cel.hrm.mobile.api.http b/cel.hrm.mobile.api.http new file mode 100644 index 0000000..d876ac7 --- /dev/null +++ b/cel.hrm.mobile.api.http @@ -0,0 +1,6 @@ +@cel.hrm.mobile.api_HostAddress = http://localhost:5125 + +GET {{cel.hrm.mobile.api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/cel.hrm.mobile.api.sln b/cel.hrm.mobile.api.sln new file mode 100644 index 0000000..c5419ea --- /dev/null +++ b/cel.hrm.mobile.api.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cel.hrm.mobile.api", "cel.hrm.mobile.api.csproj", "{DBA022C4-EF81-43E4-8898-1570E5A85BE1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DBA022C4-EF81-43E4-8898-1570E5A85BE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DBA022C4-EF81-43E4-8898-1570E5A85BE1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DBA022C4-EF81-43E4-8898-1570E5A85BE1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DBA022C4-EF81-43E4-8898-1570E5A85BE1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {173D065D-B33D-4EB0-8FFF-19672BAE5945} + EndGlobalSection +EndGlobal