merge from programManager Move
This commit is contained in:
29
ServiceHost/Areas/Admin/Controllers/GeneralController.cs
Normal file
29
ServiceHost/Areas/Admin/Controllers/GeneralController.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class GeneralController:AdminBaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// نمایش اطلاعات عمومی مانند تاریخ ها و سال ها
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("Dates")]
|
||||
public IActionResult GetDates()
|
||||
{
|
||||
var pc = new PersianCalendar();
|
||||
var now = DateTime.Now;
|
||||
var currentYear = pc.GetYear(now);
|
||||
var years = Enumerable.Range(1370, currentYear - 1370 + 1).ToList();
|
||||
var months = Enumerable.Range(1, 12).ToList();
|
||||
var currentDate = new { Year = currentYear, Month = pc.GetMonth(now), Day = pc.GetDayOfMonth(now) };
|
||||
return new JsonResult(new
|
||||
{
|
||||
years,
|
||||
months,
|
||||
currentDate
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Application.Modules.Checkouts.Commands.CreateCheckout;
|
||||
using GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetCheckoutList;
|
||||
using GozareshgirProgramManager.Application.Modules.Checkouts.Queries.GetUserToGropCreate;
|
||||
using GozareshgirProgramManager.Domain.CheckoutAgg.Enums;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers.ProgramManager;
|
||||
|
||||
public class CheckoutController : ProgramManagerBaseController
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public CheckoutController(IMediator mediator)
|
||||
{
|
||||
_mediator = mediator;
|
||||
}
|
||||
|
||||
[HttpGet("GetUsersToGroupCreating")]
|
||||
public async Task<ActionResult<OperationResult<GetUserToGroupCreatingResponse>>> GetUserListWhoHaveSettings([FromQuery] GetUserToGroupCreatingQuery command)
|
||||
{
|
||||
|
||||
var res = await _mediator.Send(command);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
//[HttpGet("TypeOfCheckoutHandlerDictionary")]
|
||||
//public IActionResult GetTypeOfCheckoutHandlerDictionary()
|
||||
//{
|
||||
// var names = Enum.GetNames(typeof(TypeOfCheckoutHandler));
|
||||
// List<string> result = new List<string>();
|
||||
|
||||
// foreach (var name in names)
|
||||
// {
|
||||
// if (name == "CreateInGroup")
|
||||
// {
|
||||
// result.Add("CreateInGroup ایجاد گروهی sample('1404', '8', UserIdList : [1,2,3] ");
|
||||
// result.Add("------------------------------------------------------------------------------------------------------------------------------------");
|
||||
// }
|
||||
|
||||
// if (name == "CreateInGroup")
|
||||
// {
|
||||
// result.Add("GroupEditing ویرایش گروهی sample(checkoutIdList : ['3fa85f64-5717-4562-b3fc-2c963f66afa6', '3fa85f64-5717-4562-b3fc-2c963f66afa6'])");
|
||||
// result.Add("------------------------------------------------------------------------------------------------------------------------------------");
|
||||
// }
|
||||
|
||||
// if (name == "CreateInGroup")
|
||||
// result.Add("SingleEdit ویرایش تکی sample(checkoutId : '3fa85f64-5717-4562-b3fc-2c963f66afa6')" );
|
||||
// }
|
||||
// return Ok(result);
|
||||
//}
|
||||
|
||||
[HttpPost("Create")]
|
||||
public async Task<OperationResult> Create([FromBody] List<long>? UserIdlist, string Year, string Month)
|
||||
{
|
||||
var createCommand = new CreateOrEditCheckoutCommand(
|
||||
TypeOfCheckoutHandler.CreateInGroup,
|
||||
Year,
|
||||
Month,UserIdlist, new List<Guid>());
|
||||
|
||||
|
||||
var res = await _mediator.Send(createCommand);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("Edit")]
|
||||
public async Task<OperationResult> EditSingleOrGroup([FromBody] List<Guid> CheckoutIdList)
|
||||
{
|
||||
var createCommand = new CreateOrEditCheckoutCommand(
|
||||
TypeOfCheckoutHandler.GroupEditing,
|
||||
null,
|
||||
null, null, CheckoutIdList);
|
||||
|
||||
|
||||
var res = await _mediator.Send(createCommand);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("GetCheckoutList")]
|
||||
public async Task<ActionResult<OperationResult<PaginationResult<GetCheckoutListResponse>>>> GetCheckoutList([FromQuery] GetCheckoutListQuery command)
|
||||
{
|
||||
|
||||
var res = await _mediator.Send(command);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Commands.AssignProject;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Commands.ChangeStatusSection;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Commands.CreateProject;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Commands.DeleteProject;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Commands.EditProject;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Commands.SetTimeProject;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Commands.TransferSection;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Queries.GetProjectAssignDetails;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Queries.GetProjectsList;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Queries.ProjectBoardList;
|
||||
using GozareshgirProgramManager.Application.Modules.Projects.Queries.ProjectSetTimeDetails;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers.ProgramManager;
|
||||
|
||||
public class ProjectController : ProgramManagerBaseController
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public ProjectController(IMediator mediator)
|
||||
{
|
||||
_mediator = mediator;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<OperationResult<GetProjectsListResponse>>> Get([FromQuery]GetProjectsListQuery query)
|
||||
{
|
||||
var res=await _mediator.Send(query);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<OperationResult>> Create([FromBody] CreateProjectCommand command)
|
||||
{
|
||||
var res=await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPut]
|
||||
public async Task<ActionResult<OperationResult>> Edit([FromBody] EditProjectCommand command)
|
||||
{
|
||||
var res=await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpDelete]
|
||||
public async Task<ActionResult<OperationResult>> Delete([FromQuery] DeleteProjectCommand command)
|
||||
{
|
||||
var res=await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpGet("assign")]
|
||||
public async Task<ActionResult<OperationResult<GetProjectAssignDetailsResponse>>> GetAssignableProjects(GetProjectAssignDetailsQuery query)
|
||||
{
|
||||
var res=await _mediator.Send(query);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("assign")]
|
||||
public async Task<ActionResult<OperationResult>> Assign(AssignProjectCommand command)
|
||||
{
|
||||
var res=await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
[HttpGet("set-time")]
|
||||
public async Task<ActionResult<OperationResult<ProjectSetTimeResponse>>> GetSetTimeProjectDetails(ProjectSetTimeDetailsQuery query)
|
||||
{
|
||||
var res=await _mediator.Send(query);
|
||||
return res;
|
||||
}
|
||||
[HttpPost("set-time")]
|
||||
public async Task<ActionResult<OperationResult>> SetTimeProject(SetTimeProjectCommand command)
|
||||
{
|
||||
var res=await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("change-status")]
|
||||
public async Task<ActionResult<OperationResult>> ChangeStatus(ChangeStatusSectionCommand command)
|
||||
{
|
||||
var res = await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("transfer-section")]
|
||||
public async Task<ActionResult<OperationResult>> TransferSection([FromBody] TransferSectionCommand command)
|
||||
{
|
||||
var res = await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpGet("board")]
|
||||
public async Task<ActionResult<OperationResult<List<ProjectBoardListResponse>>>> GetProjectBoard([FromQuery] ProjectBoardListQuery query)
|
||||
{
|
||||
var res = await _mediator.Send(query);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Application.Modules.Roles.Commands.CreateRole;
|
||||
using GozareshgirProgramManager.Application.Modules.Roles.Commands.EditRole;
|
||||
using GozareshgirProgramManager.Application.Modules.Roles.Queries.GetRoles;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers.ProgramManager;
|
||||
|
||||
public class RoleController : ProgramManagerBaseController
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public RoleController(IMediator mediator)
|
||||
{
|
||||
_mediator = mediator;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<OperationResult<GetRolesResponse>>> Get([FromQuery] GetRolesQuery query)
|
||||
{
|
||||
var res = await _mediator.Send(query);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<OperationResult>> Create([FromBody] CreateRoleCommand command)
|
||||
{
|
||||
var res = await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpPost("edit")]
|
||||
public async Task<ActionResult<OperationResult>> Edit([FromBody] EditRoleCommand command)
|
||||
{
|
||||
var res = await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Commands.CreateSalarySettings;
|
||||
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Commands.EditSalarySettings;
|
||||
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetSalarySettingToEdit;
|
||||
using GozareshgirProgramManager.Application.Modules.SalaryPaymentSettings.Queries.GetUserListWhoHaveSettings;
|
||||
using GozareshgirProgramManager.Domain.SalaryPaymentSettingAgg.Enums;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers.ProgramManager;
|
||||
|
||||
public class SalaryPaymentSettingsController : ProgramManagerBaseController
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public SalaryPaymentSettingsController(IMediator mediator)
|
||||
{
|
||||
_mediator = mediator;
|
||||
}
|
||||
|
||||
[HttpGet("PersianDayOfWeekDictionary")]
|
||||
public IActionResult GetPersianDayOfWeekDictionary()
|
||||
{
|
||||
var names = Enum.GetNames(typeof(PersianDayOfWeek));
|
||||
|
||||
return Ok(names);
|
||||
}
|
||||
|
||||
[HttpGet("GetUsers")]
|
||||
public async Task<ActionResult<OperationResult<GetUserListWhoHaveSettingsResponse>>> GetUserListWhoHaveSettings([FromQuery] GetUserListWhoHaveSettingsQuery command)
|
||||
{
|
||||
|
||||
var res = await _mediator.Send(command);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpGet("GetToEdit/{UserId}")]
|
||||
public async Task<ActionResult<OperationResult<GetSalarySettingToEditResponse>>> GetSalarySettingsByUserId(long UserId)
|
||||
{
|
||||
var query = new GetSalarySettingToEditQuery(UserId);
|
||||
var res = await _mediator.Send(query);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("edit")]
|
||||
public async Task<ActionResult<OperationResult>> Edit([FromBody] EditSalarySettingsCommand command)
|
||||
{
|
||||
var res = await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("create")]
|
||||
public async Task<ActionResult<OperationResult>> Create([FromBody] CreateSalarySettingsCommand command)
|
||||
{
|
||||
var res = await _mediator.Send(command);
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Application.Modules.Skills.Queries.GetSkillList;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers.ProgramManager;
|
||||
|
||||
public class SkillController:ProgramManagerBaseController
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public SkillController(IMediator mediator)
|
||||
{
|
||||
_mediator = mediator;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<OperationResult<GetSkillListResponse>>> GetList([FromQuery]GetSkillListQuery query)
|
||||
{
|
||||
var res = await _mediator.Send(query);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using GozareshgirProgramManager.Application._Common.Models;
|
||||
using GozareshgirProgramManager.Application.Modules.Users.Commands.CreateUser;
|
||||
using GozareshgirProgramManager.Application.Modules.Users.Commands.EditUser;
|
||||
using GozareshgirProgramManager.Application.Modules.Users.Queries.GetSingleUser;
|
||||
using GozareshgirProgramManager.Application.Modules.Users.Queries.GetUsers;
|
||||
using GozareshgirProgramManager.Application.Modules.Users.Queries.GetUserSelectList;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers.ProgramManager;
|
||||
|
||||
public class UserController : ProgramManagerBaseController
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
|
||||
public UserController(IMediator mediator)
|
||||
{
|
||||
_mediator = mediator;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<OperationResult<GetUsersResponse>>> Get([FromQuery] GetUsersQuery query)
|
||||
{
|
||||
var res = await _mediator.Send(query);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("{accountId}")]
|
||||
public async Task<ActionResult<OperationResult<GetSingleUserResponse>>> GetUserByAccountId(string accountId)
|
||||
{
|
||||
var query = new GetSingleUserQuery(accountId);
|
||||
var res = await _mediator.Send(query);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpGet("GetUserSelectList")]
|
||||
public async Task<ActionResult<OperationResult<GetUserSelectListResponse>>> GetUserSelectList()
|
||||
{
|
||||
var query = new GetUserSelectListQuery();
|
||||
var res = await _mediator.Send(query);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("create")]
|
||||
public async Task<ActionResult<OperationResult>> Create([FromBody] CreateUserCommand command)
|
||||
{
|
||||
var res = await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("edit")]
|
||||
public async Task<ActionResult<OperationResult>> Edit([FromBody] EditUserCommand command)
|
||||
{
|
||||
var res = await _mediator.Send(command);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
@using Microsoft.CodeAnalysis.CSharp.Syntax
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckoutListViewModel
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckoutListViewModel
|
||||
@{
|
||||
var i = 1;
|
||||
var b = 0;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using System.Security.Cryptography.X509Certificates
|
||||
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel
|
||||
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel
|
||||
@{
|
||||
var totalDays = Model.MonthlyRollCall?.Count ?? 0;
|
||||
var rightSideDays = totalDays / 2;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Checkouts.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.ContractingParties.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Contracts.IndexModel
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using _0_Framework.Application
|
||||
@model CompanyManagment.App.Contracts.Employee.CreateEmployee
|
||||
@model CompanyManagment.App.Contracts.Employee.CreateEmployee
|
||||
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using _0_Framework.Application
|
||||
@model CompanyManagment.App.Contracts.Employee.CreateEmployee
|
||||
@model CompanyManagment.App.Contracts.Employee.CreateEmployee
|
||||
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Employees.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Employers.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using CompanyManagment.App.Contracts.Holiday
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Holidays.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using CompanyManagment.App.Contracts.InsuranceList.Enums
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model CompanyManagment.App.Contracts.InsuranceList.InsuranceListConfirmOperation
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Jobs.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.MandatoryHours.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.Representative
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Representative.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
@page
|
||||
@using _0_Framework.Application.Enums
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.SmsResult.SmsSettingsModel
|
||||
@Html.AntiForgeryToken()
|
||||
@{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Workshops.EditWorkshopModel
|
||||
@{
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@page
|
||||
@using CompanyManagment.App.Contracts.PersonalContractingParty
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.Workshops.IndexModel
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using AccountManagement.Application.Contracts.Account
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model CompanyManagment.App.Contracts.Workshop.EditWorkshop
|
||||
|
||||
@{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@using AccountManagement.Application.Contracts.TicketAccessAccount
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model ServiceHost.Areas.Admin.Pages.IndexModel
|
||||
@inject ITicketAccessAccountApplication TicketAccessAccount;
|
||||
@inject IAuthHelper authHelper;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
@using Microsoft.AspNetCore.Razor.Language.Intermediate
|
||||
@using _0_Framework.Application
|
||||
@using Version = _0_Framework.Application.Version
|
||||
@using Version = _0_Framework.Application.Version
|
||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@using _0_Framework.Application
|
||||
@using AccountManagement.Domain.TicketAccessAccountAgg
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@using Microsoft.Extensions.Options
|
||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||
@inject ITicketAccessAccountRepository TicketAccessAccount;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
@using ServiceHost
|
||||
@namespace ServiceHost.Pages
|
||||
@namespace ServiceHost.Areas.Admin.Pages
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@addTagHelper *, ServiceHost
|
||||
14
ServiceHost/BaseControllers/ProgramManagerBaseController.cs
Normal file
14
ServiceHost/BaseControllers/ProgramManagerBaseController.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ServiceHost.BaseControllers;
|
||||
|
||||
[Authorize(Policy = "AdminArea")]
|
||||
[Area("ProgramManager")]
|
||||
[ApiExplorerSettings(GroupName = "ProgramManager")]
|
||||
[Route("api/[area]/[controller]")]
|
||||
public class ProgramManagerBaseController : ControllerBase
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using _0_Framework.Application.Sms;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Configuration;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using PersonalContractingParty.Config;
|
||||
using ServiceHost;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Query.Bootstrapper;
|
||||
using ServiceHost.Hubs;
|
||||
using ServiceHost.MiddleWare;
|
||||
@@ -20,23 +13,24 @@ using WorkFlow.Infrastructure.Config;
|
||||
using _0_Framework.Application.UID;
|
||||
using _0_Framework.Exceptions.Handler;
|
||||
using _0_Framework.Application.FaceEmbedding;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using ServiceHost.Test;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json;
|
||||
using _0_Framework.InfraStructure.Mongo;
|
||||
using Bogus;
|
||||
using CompanyManagment.App.Contracts.Hubs;
|
||||
using CompanyManagment.EFCore.Services;
|
||||
using Microsoft.AspNetCore.CookiePolicy;
|
||||
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
using MongoDB.Driver;
|
||||
using Parbad.Builder;
|
||||
using Parbad.Gateway.Sepehr;
|
||||
using Swashbuckle.AspNetCore.SwaggerUI;
|
||||
using AccountManagement.Domain.InternalApiCaller;
|
||||
using FluentValidation;
|
||||
using GozareshgirProgramManager.Application._Bootstrapper;
|
||||
using GozareshgirProgramManager.Application.Modules.Users.Commands.CreateUser;
|
||||
using GozareshgirProgramManager.Infrastructure;
|
||||
using GozareshgirProgramManager.Infrastructure.Persistence.Seed;
|
||||
using Microsoft.OpenApi;
|
||||
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -55,6 +49,11 @@ var connectionString = builder.Configuration.GetConnectionString("MesbahDb");
|
||||
var connectionStringTestDb = builder.Configuration.GetConnectionString("TestDb");
|
||||
var connectionStringProgramManager = builder.Configuration.GetConnectionString("ProgramManagerDb");
|
||||
|
||||
|
||||
builder.Services.AddProgramManagerApplication();
|
||||
builder.Services.AddProgramManagerInfrastructure(builder.Configuration);
|
||||
builder.Services.AddValidatorsFromAssemblyContaining<CreateUserCommandValidators>();
|
||||
builder.Services.AddScoped<IDataSeeder, DataSeeder>();
|
||||
#region MongoDb
|
||||
|
||||
var mongoConnectionSection = builder.Configuration.GetSection("MongoDb");
|
||||
@@ -216,6 +215,7 @@ builder.Services.AddSignalR();
|
||||
builder.Services.AddSwaggerGen(options =>
|
||||
{
|
||||
options.UseInlineDefinitionsForEnums();
|
||||
options.CustomSchemaIds(type => type.FullName);
|
||||
|
||||
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
||||
@@ -231,36 +231,37 @@ builder.Services.AddSwaggerGen(options =>
|
||||
options.SwaggerDoc("Admin", new OpenApiInfo { Title = "API - Admin", Version = "v1" });
|
||||
options.SwaggerDoc("Client", new OpenApiInfo { Title = "API - Client", Version = "v1" });
|
||||
options.SwaggerDoc("Camera", new OpenApiInfo { Title = "API - Camera", Version = "v1" });
|
||||
options.SwaggerDoc("ProgramManager", new OpenApiInfo { Title = "API - ProgramManager", Version = "v1" });
|
||||
|
||||
options.DocInclusionPredicate((docName, apiDesc) =>
|
||||
string.Equals(docName, apiDesc.GroupName, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
|
||||
// اضافه کردن پشتیبانی از JWT در Swagger
|
||||
options.AddSecurityDefinition("Bearer", new Microsoft.OpenApi.Models.OpenApiSecurityScheme
|
||||
{
|
||||
Name = "Authorization",
|
||||
Type = Microsoft.OpenApi.Models.SecuritySchemeType.ApiKey,
|
||||
Scheme = "Bearer",
|
||||
BearerFormat = "JWT",
|
||||
In = Microsoft.OpenApi.Models.ParameterLocation.Header,
|
||||
Description = "لطفاً 'Bearer [space] token' را وارد کنید."
|
||||
});
|
||||
|
||||
options.AddSecurityRequirement(new Microsoft.OpenApi.Models.OpenApiSecurityRequirement
|
||||
{
|
||||
{
|
||||
new Microsoft.OpenApi.Models.OpenApiSecurityScheme
|
||||
{
|
||||
Reference = new Microsoft.OpenApi.Models.OpenApiReference
|
||||
{
|
||||
Type = Microsoft.OpenApi.Models.ReferenceType.SecurityScheme,
|
||||
Id = "Bearer"
|
||||
}
|
||||
},
|
||||
Array.Empty<string>()
|
||||
}
|
||||
});
|
||||
// options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
|
||||
// {
|
||||
// Name = "Authorization",
|
||||
// Type = SecuritySchemeType.ApiKey,
|
||||
// Scheme = "Bearer",
|
||||
// BearerFormat = "JWT",
|
||||
// In = ParameterLocation.Header,
|
||||
// Description = "لطفاً 'Bearer [space] token' را وارد کنید."
|
||||
// });
|
||||
//
|
||||
// options.AddSecurityRequirement(new OpenApiSecurityRequirement
|
||||
// {
|
||||
// {
|
||||
// new Microsoft.OpenApi.Models.OpenApiSecurityScheme
|
||||
// {
|
||||
// Reference = new Microsoft.OpenApi.Models.OpenApiReference
|
||||
// {
|
||||
// Type = Microsoft.OpenApi.Models.ReferenceType.SecurityScheme,
|
||||
// Id = "Bearer"
|
||||
// }
|
||||
// },
|
||||
// Array.Empty<string>()
|
||||
// }
|
||||
// });
|
||||
|
||||
options.EnableAnnotations();
|
||||
});
|
||||
@@ -396,6 +397,8 @@ if (app.Environment.IsDevelopment())
|
||||
options.SwaggerEndpoint("/swagger/Admin/swagger.json", "API - Admin");
|
||||
options.SwaggerEndpoint("/swagger/Client/swagger.json", "API - Client");
|
||||
options.SwaggerEndpoint("/swagger/Camera/swagger.json", "API - Camera");
|
||||
options.SwaggerEndpoint("/swagger/ProgramManager/swagger.json", "API - ProgramManager");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
@@ -69,6 +69,8 @@
|
||||
<ProjectReference Include="..\backService\backService.csproj" />
|
||||
<ProjectReference Include="..\CompanyManagement.Infrastructure.Excel\CompanyManagement.Infrastructure.Excel.csproj" />
|
||||
<ProjectReference Include="..\PersonalContractingParty.Config\PersonalContractingParty.Config.csproj" />
|
||||
<ProjectReference Include="..\ProgramManager\src\Application\GozareshgirProgramManager.Application\GozareshgirProgramManager.Application.csproj" />
|
||||
<ProjectReference Include="..\ProgramManager\src\Infrastructure\GozareshgirProgramManager.Infrastructure\GozareshgirProgramManager.Infrastructure.csproj" />
|
||||
<ProjectReference Include="..\Query.Bootstrapper\Query.Bootstrapper.csproj" />
|
||||
<ProjectReference Include="..\Query\Query.csproj" />
|
||||
<ProjectReference Include="..\WorkFlow\Application\WorkFlow.Application.Contracts\WorkFlow.Application.Contracts.csproj" />
|
||||
@@ -77,25 +79,28 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bogus" Version="35.6.3" />
|
||||
<PackageReference Include="IPE.SmsIR" Version="1.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
|
||||
<PackageReference Include="Bogus" Version="35.6.5" />
|
||||
<PackageReference Include="FluentValidation" Version="12.1.1" />
|
||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
|
||||
<PackageReference Include="IPE.SmsIR" Version="1.2.7" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter" Version="10.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.1" />
|
||||
<PackageReference Include="Microsoft.Build" Version="18.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="3.5.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.0.0" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="3.5.2" />
|
||||
<PackageReference Include="Parbad.AspNetCore" Version="1.5.0" />
|
||||
<PackageReference Include="Parbad.Storage.Cache" Version="1.5.0" />
|
||||
<PackageReference Include="SocialExplorer.FastDBF" Version="1.0.0" />
|
||||
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.4" />
|
||||
<PackageReference Include="System.Data.OleDb" Version="10.0.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.0.1" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
"TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;",
|
||||
|
||||
//program_manager_db
|
||||
"ProgramManagerDb": "Data Source=.;Initial Catalog=program_manager_db;Integrated Security=True;TrustServerCertificate=true;"
|
||||
"ProgramManagerDb": "Data Source=.;Initial Catalog=program_manager_db;Integrated Security=True;TrustServerCertificate=true;",
|
||||
"ProgramManagerDbServer": "Data Source=171.22.24.15;Initial Catalog=program_manager_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;"
|
||||
//mahan Docker
|
||||
//"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user