init
This commit is contained in:
commit
e134b8f16a
13
.config/dotnet-tools.json
Normal file
13
.config/dotnet-tools.json
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"isRoot": true,
|
||||||
|
"tools": {
|
||||||
|
"dotnet-ef": {
|
||||||
|
"version": "8.0.8",
|
||||||
|
"commands": [
|
||||||
|
"dotnet-ef"
|
||||||
|
],
|
||||||
|
"rollForward": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Build output
|
||||||
|
bin/
|
||||||
|
obj/
|
||||||
106
Controllers/UserController.cs
Normal file
106
Controllers/UserController.cs
Normal file
|
|
@ -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 + "#");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
Models/MobileApiDetails.cs
Normal file
13
Models/MobileApiDetails.cs
Normal file
|
|
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
24
Program.cs
Normal file
24
Program.cs
Normal file
|
|
@ -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();
|
||||||
|
|
||||||
|
|
||||||
17
Properties/PublishProfiles/FolderProfile.pubxml
Normal file
17
Properties/PublishProfiles/FolderProfile.pubxml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DeleteExistingFiles>false</DeleteExistingFiles>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<PublishProvider>FileSystem</PublishProvider>
|
||||||
|
<PublishUrl>D:\mob api link</PublishUrl>
|
||||||
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
|
<_TargetId>Folder</_TargetId>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
11
Properties/PublishProfiles/FolderProfile.pubxml.user
Normal file
11
Properties/PublishProfiles/FolderProfile.pubxml.user
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_PublishTargetUrl>D:\mob api link</_PublishTargetUrl>
|
||||||
|
<History>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;</History>
|
||||||
|
<LastFailureDetails />
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
21
Properties/PublishProfiles/FolderProfile1.pubxml
Normal file
21
Properties/PublishProfiles/FolderProfile1.pubxml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<PublishProvider>FileSystem</PublishProvider>
|
||||||
|
<PublishUrl>D:\Published</PublishUrl>
|
||||||
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
|
<_TargetId>Folder</_TargetId>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ProjectGuid>dba022c4-ef81-43e4-8898-1570e5a85be1</ProjectGuid>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
11
Properties/PublishProfiles/FolderProfile1.pubxml.user
Normal file
11
Properties/PublishProfiles/FolderProfile1.pubxml.user
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_PublishTargetUrl>D:\Published</_PublishTargetUrl>
|
||||||
|
<History>True|2024-09-05T05:59:24.0796753Z||;True|2024-09-02T16:26:11.2605613+06:00||;</History>
|
||||||
|
<LastFailureDetails />
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
21
Properties/PublishProfiles/FolderProfile2.pubxml
Normal file
21
Properties/PublishProfiles/FolderProfile2.pubxml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<PublishProvider>FileSystem</PublishProvider>
|
||||||
|
<PublishUrl>D:\Published\cel.hrm.mobile.api</PublishUrl>
|
||||||
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
|
<_TargetId>Folder</_TargetId>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ProjectGuid>dba022c4-ef81-43e4-8898-1570e5a85be1</ProjectGuid>
|
||||||
|
<SelfContained>false</SelfContained>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
11
Properties/PublishProfiles/FolderProfile2.pubxml.user
Normal file
11
Properties/PublishProfiles/FolderProfile2.pubxml.user
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_PublishTargetUrl>D:\Published\cel.hrm.mobile.api</_PublishTargetUrl>
|
||||||
|
<History>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||;</History>
|
||||||
|
<LastFailureDetails />
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
41
Properties/launchSettings.json
Normal file
41
Properties/launchSettings.json
Normal file
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
appsettings.Development.json
Normal file
8
appsettings.Development.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
appsettings.json
Normal file
9
appsettings.json
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
||||||
13
cel.hrm.mobile.api.csproj
Normal file
13
cel.hrm.mobile.api.csproj
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
10
cel.hrm.mobile.api.csproj.user
Normal file
10
cel.hrm.mobile.api.csproj.user
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
|
||||||
|
<NameOfLastUsedPublishProfile>D:\cel.hrm.mobile.api\Properties\PublishProfiles\FolderProfile2.pubxml</NameOfLastUsedPublishProfile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
6
cel.hrm.mobile.api.http
Normal file
6
cel.hrm.mobile.api.http
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
@cel.hrm.mobile.api_HostAddress = http://localhost:5125
|
||||||
|
|
||||||
|
GET {{cel.hrm.mobile.api_HostAddress}}/weatherforecast/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
###
|
||||||
25
cel.hrm.mobile.api.sln
Normal file
25
cel.hrm.mobile.api.sln
Normal file
|
|
@ -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
|
||||||
Loading…
Reference in New Issue
Block a user