Add user profile and permissions handling - Updated `AuthHelper` to deserialize permissions from claims. - Introduced `GetDates` method in `GeneralController` for date info. - Created `LoginController` with `GetProfile` method to return user profile details.
34 lines
989 B
C#
34 lines
989 B
C#
using System.Globalization;
|
||
using _0_Framework.Application;
|
||
using CompanyManagment.EFCore.Migrations;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
using ServiceHost.BaseControllers;
|
||
|
||
namespace ServiceHost.Controllers;
|
||
|
||
public class GeneralController:GeneralBaseController
|
||
{
|
||
|
||
|
||
/// <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
|
||
});
|
||
}
|
||
|
||
|
||
} |