...
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Back.Services;
|
||||
using Back.Validations;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Shared.DTOs;
|
||||
@@ -10,9 +11,11 @@ namespace Back.Controllers
|
||||
public class BaseController : ControllerBase
|
||||
{
|
||||
private readonly ServBase _sBase;
|
||||
public BaseController(ServBase sBase)
|
||||
private readonly MobileValidation _mobilevalidation;
|
||||
public BaseController(ServBase sBase, MobileValidation mobilevalidation)
|
||||
{
|
||||
_sBase = sBase;
|
||||
_mobilevalidation = mobilevalidation;
|
||||
}
|
||||
[HttpGet("Pricing")]
|
||||
public async Task<ActionResult<List<BasePriceDto>>> Pricing()
|
||||
@@ -34,6 +37,17 @@ namespace Back.Controllers
|
||||
[HttpGet("LastQuestion")]
|
||||
public async Task<ActionResult<PagingDto<QuestionDto>>> LastQuestion(int PageIndex, int PageSize)
|
||||
=> Ok(await _sBase.GetQuestion(PageIndex, PageSize));
|
||||
|
||||
[HttpPost("CreateCsrAndPrivateKey")]
|
||||
public async Task<ActionResult<TaxToolsDTO>> CreateCsrAndPrivateKey(CsrPrivateKeyDto model)
|
||||
{
|
||||
var resultValidationmodel = await _mobilevalidation.ValidateAsync(model.Mobile);
|
||||
if (!resultValidationmodel.IsValid)
|
||||
return BadRequest(resultValidationmodel.Errors);
|
||||
return Ok(await _sBase.CreateCsrAndPrivateKey(model));
|
||||
}
|
||||
[HttpPost("ReadPublicKeyFromCER")]
|
||||
public async Task<ActionResult<PublicKeyDTO>> ReadPublicKeyFromCER(string modelfromBase64)
|
||||
=> Ok(await _sBase.ReadPublicKeyFromCER(modelfromBase64));
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user