wip: 🧠 初步的框架

This commit is contained in:
tk
2023-08-25 15:33:42 +08:00
parent 57c1ba2002
commit 18b4d7547a
1014 changed files with 122380 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
using NetAdmin.Domain.Dto.Sys.Captcha;
using NetAdmin.Host.Controllers;
using NetAdmin.SysComponent.Application.Modules.Sys;
using NetAdmin.SysComponent.Application.Services.Sys.Dependency;
using NetAdmin.SysComponent.Cache.Sys.Dependency;
namespace NetAdmin.SysComponent.Host.Controllers.Sys;
/// <summary>
/// 人机验证服务
/// </summary>
[ApiDescriptionSettings(nameof(Sys), Module = nameof(Sys))]
public sealed class CaptchaController : ControllerBase<ICaptchaCache, ICaptchaService>, ICaptchaModule
{
/// <summary>
/// Initializes a new instance of the <see cref="CaptchaController" /> class.
/// </summary>
public CaptchaController(ICaptchaCache cache) //
: base(cache) { }
/// <summary>
/// 获取人机校验图
/// </summary>
[AllowAnonymous]
public Task<GetCaptchaRsp> GetCaptchaImageAsync()
{
return Cache.GetCaptchaImageAsync();
}
/// <summary>
/// 完成人机校验
/// </summary>
[AllowAnonymous]
public Task<bool> VerifyCaptchaAsync(VerifyCaptchaReq req)
{
return Cache.VerifyCaptchaAsync(req);
}
}