change base controllers name - add dates and add admin select List
This commit is contained in:
25
ServiceHost/Areas/Admin/Controllers/AccountController.cs
Normal file
25
ServiceHost/Areas/Admin/Controllers/AccountController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class AccountController:AdminBaseController
|
||||
{
|
||||
private readonly IAccountApplication _accountApplication;
|
||||
|
||||
public AccountController(IAccountApplication accountApplication)
|
||||
{
|
||||
_accountApplication = accountApplication;
|
||||
}
|
||||
/// <summary>
|
||||
/// سلکت لیست اکانت های ادمین برای جستجو
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("select_list")]
|
||||
public async Task<ActionResult<List<AccountSelectListViewModel>>> GetAdminAccountsSelectList()
|
||||
{
|
||||
var res = await _accountApplication.GetAdminSelectList();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,9 @@ using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Api.Areas.Admin.Controllers;
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class AdminMonthlyOverviewController:AdminController
|
||||
public class AdminMonthlyOverviewController:AdminBaseController
|
||||
{
|
||||
|
||||
private readonly IAdminMonthlyOverviewApplication _adminMonthlyOverviewApplication;
|
||||
|
||||
@@ -6,7 +6,7 @@ using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class ContractingPartyController : AdminController
|
||||
public class ContractingPartyController : AdminBaseController
|
||||
{
|
||||
private readonly IPersonalContractingPartyApp _contractingPartyApplication;
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ using CompanyManagment.App.Contracts.Employee;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Api.Areas.Admin.Controllers;
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class EmployeesController:AdminController
|
||||
public class EmployeesController:AdminBaseController
|
||||
{
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
|
||||
@@ -5,7 +5,7 @@ using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class EmployerController : AdminController
|
||||
public class EmployerController : AdminBaseController
|
||||
{
|
||||
private readonly IEmployerApplication _employerApplication;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class RepresentativeController : AdminController
|
||||
public class RepresentativeController : AdminBaseController
|
||||
{
|
||||
private readonly IRepresentativeApplication _representativeApplication;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class WorkshopController:AdminController
|
||||
public class WorkshopController: AdminBaseController
|
||||
{
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace ServiceHost.BaseControllers;
|
||||
[Area("Admin")]
|
||||
[ApiExplorerSettings(GroupName = "Admin")]
|
||||
[Route("api/[area]/[controller]")]
|
||||
public class AdminController:ControllerBase
|
||||
public class AdminBaseController:ControllerBase
|
||||
{
|
||||
|
||||
}
|
||||
14
ServiceHost/BaseControllers/CameraBaseController.cs
Normal file
14
ServiceHost/BaseControllers/CameraBaseController.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ServiceHost.Api.BaseControllers;
|
||||
|
||||
|
||||
//[ApiExplorerSettings(GroupName = "Camera")]
|
||||
[Authorize(Policy = "CameraArea")]
|
||||
[Area("Camera")]
|
||||
[Route("api/[area]/[controller]")]
|
||||
public class CameraBaseController:ControllerBase
|
||||
{
|
||||
|
||||
}
|
||||
13
ServiceHost/BaseControllers/ClientBaseController.cs
Normal file
13
ServiceHost/BaseControllers/ClientBaseController.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ServiceHost.Api.BaseControllers;
|
||||
|
||||
//[Authorize(Policy = "ClientArea")]
|
||||
[Area("Client")]
|
||||
[ApiExplorerSettings(GroupName = "Client")]
|
||||
[Route("api/[area]/[controller]")]
|
||||
public class ClientBaseController: ControllerBase
|
||||
{
|
||||
|
||||
}
|
||||
13
ServiceHost/BaseControllers/GeneralBaseController.cs
Normal file
13
ServiceHost/BaseControllers/GeneralBaseController.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ServiceHost.Api.BaseControllers;
|
||||
|
||||
|
||||
[ApiExplorerSettings(GroupName = "General")]
|
||||
|
||||
[Route("api/[controller]")]
|
||||
public class GeneralBaseController:ControllerBase
|
||||
{
|
||||
|
||||
}
|
||||
23
ServiceHost/Controllers/GeneralController.cs
Normal file
23
ServiceHost/Controllers/GeneralController.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.Api.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Controllers;
|
||||
|
||||
public class GeneralController:GeneralBaseController
|
||||
{
|
||||
[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
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user