33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using Crm.Core.Identity.Domain.Dto;
|
|
using Crm.Core.Identity.Domain.Impl;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Crm.Core.Identity.WebApi.Controller
|
|
{
|
|
public class IdentityController : ControllerBase
|
|
{
|
|
private readonly IIdentityDomain _identityDomain;
|
|
public IdentityController(IIdentityDomain identityDomain)
|
|
{
|
|
_identityDomain = identityDomain;
|
|
}
|
|
/// <summary>
|
|
/// 加密
|
|
/// </summary>
|
|
/// <param name="encryptDto"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Encrypt")]
|
|
public async Task<EncryptResultDto> Encrypt([FromBody] EncryptDto encryptDto)
|
|
=> await _identityDomain.Encrypt(encryptDto);
|
|
|
|
/// <summary>
|
|
/// 解密
|
|
/// </summary>
|
|
/// <param name="decryptDto"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("Decrypt")]
|
|
public async Task<string> Decrypt([FromBody] DecryptDto decryptDto)
|
|
=> await _identityDomain.Decrypt(decryptDto);
|
|
}
|
|
}
|