Files
Backend-Api/ServiceHost/Controllers/GeneralController.cs
MahanCh c30c460a68 feature : add login controller and get detail profile
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.
2025-07-02 12:03:25 +03:30

34 lines
989 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
});
}
}