ulr
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Back.Common;
|
||||
using Back.Data.Contracts;
|
||||
using Back.Data.Models;
|
||||
using Back.Services;
|
||||
using Back.Validations;
|
||||
@@ -23,11 +24,14 @@ namespace Back.Controllers
|
||||
private readonly ServValidatinMsg _servValidatinMsg;
|
||||
private readonly servSendMsg _servSendMsg;
|
||||
private readonly CompanyRegistrationValidation _companyRegistrationValidation;
|
||||
private readonly IAsyncRepository<Ulr> _ulrRepo;
|
||||
public BaseController(ServBase sBase, MobileValidation mobilevalidation
|
||||
, servCompany servCompany, servUser servUser
|
||||
, servPermission servPermission, ServValidatinMsg servValidatinMsg
|
||||
, servSendMsg servSendMsg, CompanyRegistrationValidation companyRegistrationValidation)
|
||||
, servSendMsg servSendMsg, CompanyRegistrationValidation companyRegistrationValidation
|
||||
, IAsyncRepository<Ulr> ulrRepo)
|
||||
{
|
||||
_ulrRepo = ulrRepo;
|
||||
_sBase = sBase;
|
||||
_mobilevalidation = mobilevalidation;
|
||||
_servCompany = servCompany;
|
||||
@@ -186,5 +190,21 @@ namespace Back.Controllers
|
||||
_servSendMsg.toContinue(modelvc.Code.ToString(),Item.Username, "فراموشی کلمه عبور");
|
||||
return Ok(modelvc.ID);
|
||||
}
|
||||
[HttpPost("Ulr")]
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult> Ulr(UlrDto Item)
|
||||
{
|
||||
if (Item.Type=="Panel" || Item.Type == "Main")
|
||||
{
|
||||
await _ulrRepo.AddBoolResultAsync(new Data.Models.Ulr
|
||||
{
|
||||
Type = Item.Type,
|
||||
Date=DateTime.Now.ConvertMiladiToShamsi(),
|
||||
Time=DateTime.Now.Hour.ToString("00")+ DateTime.Now.Minute.ToString("00"),
|
||||
Ip= HttpContext.Connection.RemoteIpAddress?.ToString()
|
||||
});
|
||||
}
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user