diff --git a/AccountManagement.Application.Contracts/Account/CreateProgramManagerUser.cs b/AccountManagement.Application.Contracts/Account/CreateProgramManagerUser.cs deleted file mode 100644 index 139651b1..00000000 --- a/AccountManagement.Application.Contracts/Account/CreateProgramManagerUser.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace AccountManagement.Application.Contracts.Account; - -public record CreateUserApiResponse -{ - public bool isSuccess { get; set; } - public string? errorMessage { get; set; } - - public ErrorType ErrorType { get; set; } -} -public record CreateProgramManagerUser(string FullName, string UserName, string Password, string Mobile, string? Email, long? AccountId); - - -public enum ErrorType -{ - None, - BadRequest, - NotFound, - Unauthorized, - Validation, - InternalServerError -} \ No newline at end of file diff --git a/AccountManagement.Application.Contracts/ProgramManagerApiResult/ApiResponse.cs b/AccountManagement.Application.Contracts/ProgramManagerApiResult/ApiResponse.cs new file mode 100644 index 00000000..99d86f01 --- /dev/null +++ b/AccountManagement.Application.Contracts/ProgramManagerApiResult/ApiResponse.cs @@ -0,0 +1,9 @@ +namespace AccountManagement.Application.Contracts.ProgramManagerApiResult; + +public record ApiResponse +{ + public bool isSuccess { get; set; } + public string errorMessage { get; set; } + + public ErrorType ErrorType { get; set; } +} \ No newline at end of file diff --git a/AccountManagement.Application.Contracts/ProgramManagerApiResult/CreateProgramManagerRole.cs b/AccountManagement.Application.Contracts/ProgramManagerApiResult/CreateProgramManagerRole.cs new file mode 100644 index 00000000..4e4785f8 --- /dev/null +++ b/AccountManagement.Application.Contracts/ProgramManagerApiResult/CreateProgramManagerRole.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace AccountManagement.Application.Contracts.ProgramManagerApiResult; + + +public record CreateProgramManagerRole +{ + /// + /// نام نقش + /// + public string RoleName { get; set; } + + /// + /// کدهای دسترسی + /// + public List Permissions { get; set; } + + /// + /// آی دی اکانت گزارشگیر + /// + public long? GozareshgirRoleId { get; set; } +}; \ No newline at end of file diff --git a/AccountManagement.Application.Contracts/ProgramManagerApiResult/CreateProgramManagerUser.cs b/AccountManagement.Application.Contracts/ProgramManagerApiResult/CreateProgramManagerUser.cs new file mode 100644 index 00000000..7f471962 --- /dev/null +++ b/AccountManagement.Application.Contracts/ProgramManagerApiResult/CreateProgramManagerUser.cs @@ -0,0 +1,3 @@ +namespace AccountManagement.Application.Contracts.ProgramManagerApiResult; + +public record CreateProgramManagerUser(string FullName, string UserName, string Password, string Mobile, string Email, long? AccountId); \ No newline at end of file diff --git a/AccountManagement.Application.Contracts/ProgramManagerApiResult/ErrorType.cs b/AccountManagement.Application.Contracts/ProgramManagerApiResult/ErrorType.cs new file mode 100644 index 00000000..f8b62acf --- /dev/null +++ b/AccountManagement.Application.Contracts/ProgramManagerApiResult/ErrorType.cs @@ -0,0 +1,11 @@ +namespace AccountManagement.Application.Contracts.ProgramManagerApiResult; + +public enum ErrorType +{ + None, + BadRequest, + NotFound, + Unauthorized, + Validation, + InternalServerError +} \ No newline at end of file diff --git a/AccountManagement.Application.Contracts/ProgramManagerApiResult/RoleResponse.cs b/AccountManagement.Application.Contracts/ProgramManagerApiResult/RoleResponse.cs new file mode 100644 index 00000000..2c3f48d0 --- /dev/null +++ b/AccountManagement.Application.Contracts/ProgramManagerApiResult/RoleResponse.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace AccountManagement.Application.Contracts.ProgramManagerApiResult; + +public class RoleResponse +{ + public bool isSuccess { get; set; } + public RolesData data { get; set; } +} + +public class RolesData +{ + public List role { get; set; } +} + +public class RoleList +{ + public int id { get; set; } + public string roleName { get; set; } + public int gozareshgirRoleId { get; set; } + public List permissions { get; set; } +} diff --git a/AccountManagement.Application.Contracts/ProgramManagerApiResult/SingleUserResponseResult.cs b/AccountManagement.Application.Contracts/ProgramManagerApiResult/SingleUserResponseResult.cs new file mode 100644 index 00000000..2ce9788f --- /dev/null +++ b/AccountManagement.Application.Contracts/ProgramManagerApiResult/SingleUserResponseResult.cs @@ -0,0 +1,52 @@ +using static System.Runtime.InteropServices.JavaScript.JSType; + +namespace AccountManagement.Application.Contracts.ProgramManagerApiResult; + +public record SingleUserResponseResult +{ + public bool isSuccess { get; set; } + public SingleUserData Data { get; set; } +}; + +public record SingleUserData + +{ + public long id { get; set; } + /// + /// نام و نام خانوادگی + /// + public string fullName { get; set; } + + /// + /// نام کاربری + /// + public string userName { get; set; } + + + + /// + /// مسیر عکس پروفایل + /// + public string profilePhotoPath { get; set; } + + /// + /// شماره موبایل + /// + public string mobile { get; set; } + + + /// + /// فعال/غیر فعال بودن یوزر + /// + public bool isActive { get; set; } + + /// + /// گذرواژه + /// + public string password { get; set; } + + /// + /// ای دی اکانت کاربر در گزارشگیر + /// + public long? accountId { get; set; } +} diff --git a/AccountManagement.Application.Contracts/Role/CreateRole.cs b/AccountManagement.Application.Contracts/Role/CreateRole.cs index 9231b0df..c82cec2e 100644 --- a/AccountManagement.Application.Contracts/Role/CreateRole.cs +++ b/AccountManagement.Application.Contracts/Role/CreateRole.cs @@ -9,6 +9,10 @@ namespace AccountManagement.Application.Contracts.Role [Required(ErrorMessage = ValidationMessages.IsRequired)] public string Name { get; set; } public List Permissions { get; set; } + /// + /// لیست پرمیشن های پروگرام منیجر + /// + public List PmPermissions { get; set; } } } diff --git a/AccountManagement.Application/AccountApplication.cs b/AccountManagement.Application/AccountApplication.cs index 8061f33e..8e51316b 100644 --- a/AccountManagement.Application/AccountApplication.cs +++ b/AccountManagement.Application/AccountApplication.cs @@ -29,6 +29,8 @@ using Company.Domain.WorkshopSubAccountAgg; using Newtonsoft.Json; using Microsoft.EntityFrameworkCore; using Company.Domain._common; +using AccountManagement.Domain.InternalApiCaller; +using AccountManagement.Application.Contracts.ProgramManagerApiResult; //using AccountManagement.Domain.RoleAgg; @@ -149,7 +151,9 @@ public class AccountApplication : IAccountApplication var account = new Account(command.Fullname, command.Username, password, command.Mobile, command.RoleId, picturePath, roleName.Name, "true", "false"); - _unitOfWork.Begin(); + _unitOfWork.BeginAccountContext(); + + _accountRepository.Create(account); _accountRepository.SaveChanges(); @@ -164,42 +168,29 @@ public class AccountApplication : IAccountApplication account.id ); + var url = "api/user"; var key = SecretKeys.ProgramManagerInternalApi; - var client = new HttpClient(); - var url = "https://localhost:7032/api/user"; + var response = InternalApiCaller.PostAsync( + url, + key, + parameters + ); - // ساخت درخواست درست - var request = new HttpRequestMessage(HttpMethod.Post, url); - request.Headers.Add("X-INTERNAL-KEY", key); - - // تبدیل مدل به JSON در Body - var json = JsonConvert.SerializeObject(parameters); - request.Content = new StringContent(json, Encoding.UTF8, "application/json"); - - var response = client.SendAsync(request).GetAwaiter().GetResult(); - var success = response.IsSuccessStatusCode; - if (success) + if (!response.Success) { - var res = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); - var result = JsonConvert.DeserializeObject(res); - - if (!result.isSuccess) - { - _unitOfWork.Rollback(); - return operation.Failed(result.errorMessage); - } - - //Console.WriteLine(result.Data.accountId + " " + result.Data.mobile); + _unitOfWork.RollbackAccountContext(); + return operation.Failed(response.Error); } - else + + if (!response.Result.isSuccess) { - _unitOfWork.Rollback(); - return operation.Failed("خطا در ایجاد کاربر پروگرام منیجر"); + _unitOfWork.RollbackAccountContext(); + return operation.Failed(response.Result.errorMessage); } } - _unitOfWork.Commit(); + _unitOfWork.CommitAccountContext(); return operation.Succcedded(); } diff --git a/AccountManagement.Application/RoleApplication.cs b/AccountManagement.Application/RoleApplication.cs index dda743ee..02fa97e2 100644 --- a/AccountManagement.Application/RoleApplication.cs +++ b/AccountManagement.Application/RoleApplication.cs @@ -2,16 +2,22 @@ using AccountManagement.Application.Contracts.Role; using AccountManagement.Domain.RoleAgg; using System.Collections.Generic; +using System.Linq; +using AccountManagement.Application.Contracts.ProgramManagerApiResult; +using AccountManagement.Domain.InternalApiCaller; +using Company.Domain._common; namespace AccountManagement.Application; public class RoleApplication : IRoleApplication { private readonly IRoleRepository _roleRepository; + private readonly IUnitOfWork _unitOfWork; - public RoleApplication(IRoleRepository roleRepository) + public RoleApplication(IRoleRepository roleRepository, IUnitOfWork unitOfWork) { _roleRepository = roleRepository; + _unitOfWork = unitOfWork; } public OperationResult Create(CreateRole command) @@ -19,18 +25,51 @@ public class RoleApplication : IRoleApplication var operation = new OperationResult(); if (_roleRepository.Exists(x => x.Name == command.Name)) return operation.Failed(ApplicationMessages.DuplicatedRecord); - var permissions = new List(); - foreach (var code in command.Permissions) - { - if (code > 0) - { - permissions.Add(new Permission(code)); - } - } - //command.Permissions.ForEach(code => permissions.Add(new Permission(code))); + var permissions = command.Permissions.Where(x => x > 0).Select(x => new Permission(x)).ToList(); var role = new Role(command.Name, permissions); + _unitOfWork.BeginAccountContext(); + _roleRepository.Create(role); _roleRepository.SaveChanges(); + + var pmPermissions = command.PmPermissions.Where(x => x > 0).ToList(); + if (pmPermissions.Any()) + { + var parameters = new CreateProgramManagerRole + { + RoleName = command.Name, + Permissions = pmPermissions, + GozareshgirRoleId = role.id + + }; + + var url = "api/role"; + var key = SecretKeys.ProgramManagerInternalApi; + + var response = InternalApiCaller.PostAsync( + url, + key, + parameters + ); + + + if (!response.Success) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed(response.Error); + } + + if (!response.Result.isSuccess) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed(response.Result.errorMessage); + } + } + + + + //command.Permissions.ForEach(code => permissions.Add(new Permission(code))); + _unitOfWork.CommitAccountContext(); return operation.Succcedded(); } @@ -47,17 +86,47 @@ public class RoleApplication : IRoleApplication //var permissions = new List(); //command.Permissions.ForEach(code => permissions.Add(new Permission(code))); - var permissions = new List(); - foreach (var code in command.Permissions) - { - if (code > 0) - { - permissions.Add(new Permission(code)); - } - } + var permissions = command.Permissions.Where(x => x > 0).Select(x => new Permission(x)).ToList(); + + + _unitOfWork.BeginAccountContext(); role.Edit(command.Name, permissions); _roleRepository.SaveChanges(); + var pmPermissions = command.PmPermissions.Where(x => x > 0).ToList(); + + var parameters = new CreateProgramManagerRole + { + RoleName = command.Name, + Permissions = pmPermissions, + GozareshgirRoleId = role.id + + }; + + var url = "api/role/edit"; + var key = SecretKeys.ProgramManagerInternalApi; + + var response = InternalApiCaller.PostAsync( + url, + key, + parameters + ); + + + if (!response.Success) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed(response.Error); + } + + if (!response.Result.isSuccess) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed(response.Result.errorMessage); + } + + + return operation.Succcedded(); } diff --git a/AccountManagement.Domain/InternalApiCaller/InternalApiCaller.cs b/AccountManagement.Domain/InternalApiCaller/InternalApiCaller.cs new file mode 100644 index 00000000..98ab3c1d --- /dev/null +++ b/AccountManagement.Domain/InternalApiCaller/InternalApiCaller.cs @@ -0,0 +1,155 @@ +using Newtonsoft.Json; +using System.Net.Http; +using System.Text; +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Extensions.Configuration; + +namespace AccountManagement.Domain.InternalApiCaller; + +public class ApiResult +{ + public bool Success { get; set; } + public T Result { get; set; } + public string Error { get; set; } +} + +public static class InternalApiCaller +{ + private static string _baseUrl = ""; + + public static void SetBaseUrl(string baseUrl) + { + _baseUrl = baseUrl.TrimEnd('/'); // حذف / اضافی + } + /// + ///api post متد + /// + /// + /// + /// + /// + /// + /// + public static ApiResult PostAsync( + string url, + string internalKey, + TRequest body + ) + { + try + { + var client = new HttpClient(); + + // ساخت URL نهایی + var finalUrl = $"{_baseUrl}/{url.TrimStart('/')}"; + + var request = new HttpRequestMessage(HttpMethod.Post, finalUrl); + + request.Headers.Add("X-INTERNAL-KEY", internalKey); + + var json = JsonConvert.SerializeObject(body); + request.Content = new StringContent(json, Encoding.UTF8, "application/json"); + + var response = client.SendAsync(request).GetAwaiter().GetResult(); + + if (!response.IsSuccessStatusCode) + { + return new ApiResult + { + Success = false, + Error = $"HTTP Error: {response.StatusCode}" + }; + } + + var text = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); + var deserialized = JsonConvert.DeserializeObject(text); + + return new ApiResult + { + Success = true, + Result = deserialized + }; + } + catch (Exception ex) + { + return new ApiResult + { + Success = false, + Error = ex.Message + }; + } + } + + + + + /// + /// Api Get متد + /// + /// + /// + /// + /// + /// + public static ApiResult GetAsync( + string url, + string internalKey, + Dictionary parameters = null + ) + { + try + { + if (parameters != null && parameters.Any()) + { + var query = string.Join("&", + parameters + .Where(p => p.Value != null) + .Select(p => $"{p.Key}={p.Value}") + ); + + url += url.Contains("?") ? "&" + query : "?" + query; + } + + // ساخت URL نهایی + var finalUrl = $"{_baseUrl}/{url.TrimStart('/')}"; + + var client = new HttpClient(); + var request = new HttpRequestMessage(HttpMethod.Get, finalUrl); + + request.Headers.Add("X-INTERNAL-KEY", internalKey); + + var response = client.SendAsync(request).GetAwaiter().GetResult(); + + if (!response.IsSuccessStatusCode) + { + return new ApiResult + { + Success = false, + Error = $"HTTP Error: {response.StatusCode}" + }; + } + + var text = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); + var deserialized = JsonConvert.DeserializeObject(text); + + return new ApiResult + { + Success = true, + Result = deserialized + }; + } + catch (Exception ex) + { + return new ApiResult + { + Success = false, + Error = ex.Message + }; + } + } + + + +} diff --git a/Company.Domain/_common/IUnitOfWork.cs b/Company.Domain/_common/IUnitOfWork.cs index a51ae161..1c9b4cbf 100644 --- a/Company.Domain/_common/IUnitOfWork.cs +++ b/Company.Domain/_common/IUnitOfWork.cs @@ -2,7 +2,7 @@ public interface IUnitOfWork { - void Begin(); - void Commit(); - void Rollback(); + void BeginAccountContext(); + void CommitAccountContext(); + void RollbackAccountContext(); } \ No newline at end of file diff --git a/CompanyManagment.EFCore/_common/UnitOfWork.cs b/CompanyManagment.EFCore/_common/UnitOfWork.cs index 347aaf11..ddd47484 100644 --- a/CompanyManagment.EFCore/_common/UnitOfWork.cs +++ b/CompanyManagment.EFCore/_common/UnitOfWork.cs @@ -1,29 +1,30 @@ -using Company.Domain._common; +using AccountMangement.Infrastructure.EFCore; +using Company.Domain._common; using Microsoft.EntityFrameworkCore.Storage; namespace CompanyManagment.EFCore._common; public class UnitOfWork : IUnitOfWork { - private readonly CompanyContext _context; + private readonly AccountContext _context; private IDbContextTransaction _transaction; - public UnitOfWork(CompanyContext context) + public UnitOfWork(AccountContext context) { _context = context; } - public void Begin() + public void BeginAccountContext() { _transaction = _context.Database.BeginTransaction(); } - public void Commit() + public void CommitAccountContext() { _transaction?.Commit(); } - public void Rollback() + public void RollbackAccountContext() { _transaction?.Rollback(); } diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/CreateRole.cshtml b/ServiceHost/Areas/Admin/Pages/Accounts/Account/CreateRole.cshtml index e22b8350..1bbb0a7d 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/CreateRole.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/CreateRole.cshtml @@ -922,7 +922,117 @@ - + + + + +
+ + + + +
+ + + +
+ + + +
+ + +
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + @@ -1096,22 +1206,36 @@ \ No newline at end of file diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Edit.cshtml b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Edit.cshtml index eda0fe89..dbfd19a0 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Edit.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Edit.cshtml @@ -1,5 +1,53 @@ @model AccountManagement.Application.Contracts.Account.EditAccount @{ + } - +
+ +
+ آیا کاربر در پروگرام منیجر هم فعالیت میکند؟ +   + +
+
diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/EditRole.cshtml b/ServiceHost/Areas/Admin/Pages/Accounts/Account/EditRole.cshtml index f3192c16..abaf0ff7 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/EditRole.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/EditRole.cshtml @@ -934,6 +934,112 @@ + + +
+ + + + +
+ + + +
+ + + +
+ + +
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
@@ -1160,22 +1266,35 @@ \ No newline at end of file diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs index 5ffc6e4f..cbfffc33 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs @@ -1,12 +1,16 @@ using _0_Framework.Application; using _0_Framework.Application.Sms; using AccountManagement.Application.Contracts.Account; +using AccountManagement.Application.Contracts.ProgramManagerApiResult; using AccountManagement.Application.Contracts.Role; +using AccountManagement.Domain.AccountAgg; +using AccountManagement.Domain.InternalApiCaller; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.SignalR; +using Newtonsoft.Json; using ServiceHost.Hubs; namespace ServiceHost.Areas.Admin.Pages.Accounts.Account; @@ -81,8 +85,42 @@ public class IndexModel : PageModel public IActionResult OnGetEdit(long id) - { + { + var account = _accountApplication.GetDetails(id); + + + + + + var key = SecretKeys.ProgramManagerInternalApi; + + var apiResult = InternalApiCaller.GetAsync( + $"api/user/{account.Id}", + key + ); + + + + // حالا نتیجه دیسریال شده در apiResult.Result قرار دارد + var result = apiResult.Result; + + // مثل قبل: + if (result != null && result.isSuccess) + { + account.IsProgramManagerUser = (result.Data.accountId == account.Id); + } + else + { + account.IsProgramManagerUser = false; + } + + + + + + + account.Roles = _roleApplication.List(); return Partial("Edit", account); } @@ -100,7 +138,31 @@ public class IndexModel : PageModel var rol = new List(); foreach (var item in role.MappedPermissions) rol.Add(item.Code); - role.Permissions = rol; + var key = SecretKeys.ProgramManagerInternalApi; + + var apiResult = InternalApiCaller.GetAsync( + "api/role", + key, + new Dictionary + { + { "RoleName", "" }, + + { "GozareshgirRoleId", role.Id } + } + ); + + + role.Permissions = rol; + if (apiResult.Success) + { + if (apiResult.Result.isSuccess && apiResult.Result.data.role.Any()) + { + var pmPermission = apiResult.Result.data.role.FirstOrDefault()!.permissions; + role.Permissions.AddRange(pmPermission); + } + + } + return Partial("EditRole", role); } diff --git a/ServiceHost/Pages/Index.cshtml.cs b/ServiceHost/Pages/Index.cshtml.cs index 20c52fa3..7d013f16 100644 --- a/ServiceHost/Pages/Index.cshtml.cs +++ b/ServiceHost/Pages/Index.cshtml.cs @@ -45,51 +45,3 @@ namespace ServiceHost.Pages } } } - -public record SingleUserRespnsResult -{ - public bool isSuccess { get; set; } - public Data Data { get; set; } -} -public record Data - -{ - public long id { get; set; } - /// - /// نام و نام خانوادگی - /// - public string fullName { get; set; } - - /// - /// نام کاربری - /// - public string userName { get; set; } - - - - /// - /// مسیر عکس پروفایل - /// - public string profilePhotoPath { get; set; } - - /// - /// شماره موبایل - /// - public string mobile { get; set; } - - - /// - /// فعال/غیر فعال بودن یوزر - /// - public bool isActive { get; set; } - - /// - /// گذرواژه - /// - public string password { get; set; } - - /// - /// ای دی اکانت کاربر در گزارشگیر - /// - public long? accountId { get; set; } -} diff --git a/ServiceHost/Program.cs b/ServiceHost/Program.cs index 72430211..a14dba9e 100644 --- a/ServiceHost/Program.cs +++ b/ServiceHost/Program.cs @@ -36,6 +36,7 @@ using MongoDB.Driver; using Parbad.Builder; using Parbad.Gateway.Sepehr; using Swashbuckle.AspNetCore.SwaggerUI; +using AccountManagement.Domain.InternalApiCaller; var builder = WebApplication.CreateBuilder(args); @@ -333,7 +334,13 @@ builder.Services.AddParbad().ConfigureGateways(gateways => var app = builder.Build(); app.UseCors("AllowSpecificOrigins"); +#region InternalProgarmManagerApi +var baseUrl = builder.Configuration["InternalProgramManagerApi:BaseUrl"]; +InternalApiCaller.SetBaseUrl(baseUrl); + + +#endregion #region Mahan diff --git a/ServiceHost/appsettings.Development.json b/ServiceHost/appsettings.Development.json index 0f4feeef..17619b5f 100644 --- a/ServiceHost/appsettings.Development.json +++ b/ServiceHost/appsettings.Development.json @@ -41,11 +41,16 @@ }, "SmsSettings": { "IsTestMode": true, - "TestNumbers": [ "09116967898" - //, "09116067106", "09114221321" + "TestNumbers": [ + "09116967898" + //, "09116067106", "09114221321" ] }, + "InternalProgramManagerApi": { + "BaseUrl": "https://localhost:7032" + }, "SepehrGateWayTerminalId": 99213700 + } diff --git a/ServiceHost/appsettings.json b/ServiceHost/appsettings.json index 0b602bb1..84af0c3e 100644 --- a/ServiceHost/appsettings.json +++ b/ServiceHost/appsettings.json @@ -36,6 +36,10 @@ "IsTestMode": false, "TestNumbers": [] }, + + "InternalProgramManagerApi": { + "BaseUrl": "https://localhost:7032" + }, "SepehrGateWayTerminalId": 99213700 }