mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-04-20 05:02:50 +08:00
refactor: ♻️ curdModule 新增Edit方案
[skip ci]
This commit is contained in:
parent
4228bd5c32
commit
c2a2b27afd
@ -8,12 +8,14 @@ namespace NetAdmin.Application.Modules;
|
||||
/// </summary>
|
||||
/// <typeparam name="TCreateReq">创建请求类型</typeparam>
|
||||
/// <typeparam name="TCreateRsp">创建响应类型</typeparam>
|
||||
/// <typeparam name="TEditReq">编辑请求类型</typeparam>
|
||||
/// <typeparam name="TQueryReq">查询请求类型</typeparam>
|
||||
/// <typeparam name="TQueryRsp">查询响应类型</typeparam>
|
||||
/// <typeparam name="TDelReq">删除请求类型</typeparam>
|
||||
public interface ICrudModule<in TCreateReq, TCreateRsp, TQueryReq, TQueryRsp, TDelReq>
|
||||
public interface ICrudModule<in TCreateReq, TCreateRsp, in TEditReq, TQueryReq, TQueryRsp, TDelReq>
|
||||
where TCreateReq : DataAbstraction, new()
|
||||
where TCreateRsp : DataAbstraction
|
||||
where TEditReq : DataAbstraction, new()
|
||||
where TQueryReq : DataAbstraction, new()
|
||||
where TQueryRsp : DataAbstraction
|
||||
where TDelReq : DataAbstraction, new()
|
||||
@ -39,9 +41,9 @@ public interface ICrudModule<in TCreateReq, TCreateRsp, TQueryReq, TQueryRsp, TD
|
||||
Task<int> DeleteAsync(TDelReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 判断实体是否存在
|
||||
/// 编辑实体
|
||||
/// </summary>
|
||||
Task<bool> ExistAsync(QueryReq<TQueryReq> req);
|
||||
Task<TQueryRsp> EditAsync(TEditReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 导出实体
|
||||
|
@ -7,6 +7,7 @@ namespace NetAdmin.Application.Modules.Tpl;
|
||||
/// 示例模块
|
||||
/// </summary>
|
||||
public interface IExampleModule : ICrudModule<CreateExampleReq, QueryExampleRsp // 创建类型
|
||||
, EditExampleReq // 编辑类型
|
||||
, QueryExampleReq, QueryExampleRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -47,10 +47,14 @@ public sealed class ExampleService(BasicRepository<Tpl_Example, long> rpo) //
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryExampleReq> req)
|
||||
public async Task<QueryExampleRsp> EditAsync(EditExampleReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
#if DBTYPE_SQLSERVER
|
||||
return (await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryExampleRsp>();
|
||||
#else
|
||||
return await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryExampleReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -34,9 +34,9 @@ public sealed class ExampleCache(IDistributedCache cache, IExampleService servic
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryExampleReq> req)
|
||||
public Task<QueryExampleRsp> EditAsync(EditExampleReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -11,7 +11,8 @@ public sealed class ApiIdAttribute : ValidationAttribute
|
||||
/// <inheritdoc />
|
||||
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
|
||||
{
|
||||
var service = App.GetService(App.EffectiveTypes.Single(x => x.FullName == "NetAdmin.SysComponent.Cache.Sys.Dependency.IApiCache"));
|
||||
var service = App.GetService(
|
||||
App.EffectiveTypes.Single(x => x.FullName == "NetAdmin.SysComponent.Application.Services.Sys.Dependency.IApiService"));
|
||||
|
||||
var req = new QueryReq<QueryApiReq> { Filter = new QueryApiReq { Id = value as string } };
|
||||
|
||||
|
@ -11,7 +11,8 @@ public sealed class UserIdAttribute : ValidationAttribute
|
||||
/// <inheritdoc />
|
||||
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
|
||||
{
|
||||
var service = App.GetService(App.EffectiveTypes.Single(x => x.FullName == "NetAdmin.SysComponent.Cache.Sys.Dependency.IUserCache"));
|
||||
var service = App.GetService(
|
||||
App.EffectiveTypes.Single(x => x.FullName == "NetAdmin.SysComponent.Application.Services.Sys.Dependency.IUserService"));
|
||||
|
||||
var req = new QueryReq<QueryUserReq> { Filter = new QueryUserReq { Id = (long)value! } };
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.Api;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑接口
|
||||
/// </summary>
|
||||
public sealed record EditApiReq : Sys_Api;
|
@ -5,4 +5,4 @@ namespace NetAdmin.Domain.Dto.Sys.JobRecord;
|
||||
/// <summary>
|
||||
/// 请求:创建计划作业执行记录
|
||||
/// </summary>
|
||||
public sealed record CreateJobRecordReq : Sys_JobRecord;
|
||||
public record CreateJobRecordReq : Sys_JobRecord;
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.JobRecord;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑计划作业执行记录
|
||||
/// </summary>
|
||||
public sealed record EditJobRecordReq : CreateJobRecordReq;
|
@ -8,7 +8,7 @@ namespace NetAdmin.Domain.Dto.Sys.LoginLog;
|
||||
/// <summary>
|
||||
/// 请求:创建登录日志
|
||||
/// </summary>
|
||||
public sealed record CreateLoginLogReq : Sys_LoginLog, IRegister
|
||||
public record CreateLoginLogReq : Sys_LoginLog, IRegister
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.LoginLog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑登录日志
|
||||
/// </summary>
|
||||
public sealed record EditLoginLogReq : CreateLoginLogReq;
|
@ -6,7 +6,7 @@ namespace NetAdmin.Domain.Dto.Sys.RequestLog;
|
||||
/// <summary>
|
||||
/// 请求:创建请求日志
|
||||
/// </summary>
|
||||
public sealed record CreateRequestLogReq : Sys_RequestLog
|
||||
public record CreateRequestLogReq : Sys_RequestLog
|
||||
{
|
||||
/// <inheritdoc cref="Sys_RequestLog.Detail" />
|
||||
public new CreateRequestLogDetailReq Detail { get; init; }
|
||||
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.RequestLog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑请求日志
|
||||
/// </summary>
|
||||
public sealed record EditRequestLogReq : CreateRequestLogReq;
|
@ -5,4 +5,4 @@ namespace NetAdmin.Domain.Dto.Sys.RequestLogDetail;
|
||||
/// <summary>
|
||||
/// 请求:创建请求日志明细
|
||||
/// </summary>
|
||||
public sealed record CreateRequestLogDetailReq : Sys_RequestLogDetail;
|
||||
public record CreateRequestLogDetailReq : Sys_RequestLogDetail;
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.RequestLogDetail;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑请求日志明细
|
||||
/// </summary>
|
||||
public sealed record EditRequestLogDetailReq : CreateRequestLogDetailReq;
|
@ -5,4 +5,4 @@ namespace NetAdmin.Domain.Dto.Sys.SiteMsgDept;
|
||||
/// <summary>
|
||||
/// 请求:创建站内信-部门映射
|
||||
/// </summary>
|
||||
public sealed record CreateSiteMsgDeptReq : Sys_SiteMsgDept;
|
||||
public record CreateSiteMsgDeptReq : Sys_SiteMsgDept;
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.SiteMsgDept;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑站内信-部门映射
|
||||
/// </summary>
|
||||
public sealed record EditSiteMsgDeptReq : CreateSiteMsgDeptReq;
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.SiteMsgFlag;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑站内信标记
|
||||
/// </summary>
|
||||
public record EditSiteMsgFlagReq : CreateSiteMsgFlagReq;
|
@ -5,4 +5,4 @@ namespace NetAdmin.Domain.Dto.Sys.SiteMsgRole;
|
||||
/// <summary>
|
||||
/// 请求:创建站内信-角色映射
|
||||
/// </summary>
|
||||
public sealed record CreateSiteMsgRoleReq : Sys_SiteMsgRole;
|
||||
public record CreateSiteMsgRoleReq : Sys_SiteMsgRole;
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.SiteMsgRole;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑站内信-角色映射
|
||||
/// </summary>
|
||||
public sealed record EditSiteMsgRoleReq : CreateSiteMsgRoleReq;
|
@ -5,4 +5,4 @@ namespace NetAdmin.Domain.Dto.Sys.SiteMsgUser;
|
||||
/// <summary>
|
||||
/// 请求:创建站内信-用户映射
|
||||
/// </summary>
|
||||
public sealed record CreateSiteMsgUserReq : Sys_SiteMsgUser;
|
||||
public record CreateSiteMsgUserReq : Sys_SiteMsgUser;
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.SiteMsgUser;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑站内信-用户映射
|
||||
/// </summary>
|
||||
public sealed record EditSiteMsgUserReq : CreateSiteMsgUserReq;
|
@ -0,0 +1,6 @@
|
||||
namespace NetAdmin.Domain.Dto.Sys.VerifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑验证码
|
||||
/// </summary>
|
||||
public record EditVerifyCodeReq : CreateVerifyCodeReq;
|
@ -0,0 +1,15 @@
|
||||
namespace NetAdmin.Domain.Dto.Tpl.Example;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:编辑示例
|
||||
/// </summary>
|
||||
public record EditExampleReq : CreateExampleReq
|
||||
{
|
||||
/// <inheritdoc cref="EntityBase{T}.Id" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Id { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldVersion.Version" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Version { get; init; }
|
||||
}
|
@ -50,12 +50,12 @@ public sealed class ExampleController(IExampleCache cache) : ControllerBase<IExa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 示例是否存在
|
||||
/// 编辑示例
|
||||
/// </summary>
|
||||
[NonAction]
|
||||
public Task<bool> ExistAsync(QueryReq<QueryExampleReq> req)
|
||||
[Transaction]
|
||||
public Task<QueryExampleRsp> EditAsync(EditExampleReq req)
|
||||
{
|
||||
return Cache.ExistAsync(req);
|
||||
return Cache.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 接口模块
|
||||
/// </summary>
|
||||
public interface IApiModule : ICrudModule<CreateApiReq, QueryApiRsp // 创建类型
|
||||
, EditApiReq // 编辑类型
|
||||
, QueryApiReq, QueryApiRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
|
@ -6,15 +6,11 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 配置模块
|
||||
/// </summary>
|
||||
public interface IConfigModule : ICrudModule<CreateConfigReq, QueryConfigRsp // 创建类型
|
||||
, EditConfigReq // 编辑类型
|
||||
, QueryConfigReq, QueryConfigRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑配置
|
||||
/// </summary>
|
||||
Task<QueryConfigRsp> EditAsync(EditConfigReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 获取最新有效配置
|
||||
/// </summary>
|
||||
|
@ -6,15 +6,11 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 部门模块
|
||||
/// </summary>
|
||||
public interface IDeptModule : ICrudModule<CreateDeptReq, QueryDeptRsp // 创建类型
|
||||
, EditDeptReq // 编辑类型
|
||||
, QueryDeptReq, QueryDeptRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑部门
|
||||
/// </summary>
|
||||
Task<QueryDeptRsp> EditAsync(EditDeptReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 启用/禁用部门
|
||||
/// </summary>
|
||||
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 字典目录模块
|
||||
/// </summary>
|
||||
public interface IDicCatalogModule : ICrudModule<CreateDicCatalogReq, QueryDicCatalogRsp // 创建类型
|
||||
, EditDicCatalogReq // 编辑类型
|
||||
, QueryDicCatalogReq, QueryDicCatalogRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 字典内容模块
|
||||
/// </summary>
|
||||
public interface IDicContentModule : ICrudModule<CreateDicContentReq, QueryDicContentRsp // 创建类型
|
||||
, EditDicContentReq // 编辑类型
|
||||
, QueryDicContentReq, QueryDicContentRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
|
@ -41,7 +41,7 @@ public interface IDicModule
|
||||
/// <summary>
|
||||
/// 编辑字典目录
|
||||
/// </summary>
|
||||
Task<int> EditCatalogAsync(EditDicCatalogReq req);
|
||||
Task<QueryDicCatalogRsp> EditCatalogAsync(EditDicCatalogReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 编辑字典内容
|
||||
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 文档分类模块
|
||||
/// </summary>
|
||||
public interface IDocCatalogModule : ICrudModule<CreateDocCatalogReq, QueryDocCatalogRsp // 创建类型
|
||||
, EditDocCatalogReq // 编辑类型
|
||||
, QueryDocCatalogReq, QueryDocCatalogRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 文档内容模块
|
||||
/// </summary>
|
||||
public interface IDocContentModule : ICrudModule<CreateDocContentReq, QueryDocContentRsp // 创建类型
|
||||
, EditDocContentReq // 编辑类型
|
||||
, QueryDocContentReq, QueryDocContentRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
|
@ -41,7 +41,7 @@ public interface IDocModule
|
||||
/// <summary>
|
||||
/// 编辑文档分类
|
||||
/// </summary>
|
||||
Task<int> EditCatalogAsync(EditDocCatalogReq req);
|
||||
Task<QueryDocCatalogRsp> EditCatalogAsync(EditDocCatalogReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 编辑文档内容
|
||||
|
@ -8,6 +8,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 计划作业模块
|
||||
/// </summary>
|
||||
public interface IJobModule : ICrudModule<CreateJobReq, QueryJobRsp // 创建类型
|
||||
, EditJobReq // 编辑类型
|
||||
, QueryJobReq, QueryJobRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
@ -17,11 +18,6 @@ public interface IJobModule : ICrudModule<CreateJobReq, QueryJobRsp // 创建类
|
||||
/// </summary>
|
||||
Task<long> CountRecordAsync(QueryReq<QueryJobRecordReq> req);
|
||||
|
||||
/// <summary>
|
||||
/// 编辑作业
|
||||
/// </summary>
|
||||
Task<QueryJobRsp> EditAsync(EditJobReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 执行作业
|
||||
/// </summary>
|
||||
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 计划作业执行记录模块
|
||||
/// </summary>
|
||||
public interface IJobRecordModule : ICrudModule<CreateJobRecordReq, QueryJobRecordRsp // 创建类型
|
||||
, EditJobRecordReq // 编辑类型
|
||||
, QueryJobRecordReq, QueryJobRecordRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 登录日志模块
|
||||
/// </summary>
|
||||
public interface ILoginLogModule : ICrudModule<CreateLoginLogReq, QueryLoginLogRsp // 创建类型
|
||||
, EditLoginLogReq // 编辑类型
|
||||
, QueryLoginLogReq, QueryLoginLogRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -6,15 +6,11 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 菜单模块
|
||||
/// </summary>
|
||||
public interface IMenuModule : ICrudModule<CreateMenuReq, QueryMenuRsp // 创建类型
|
||||
, EditMenuReq // 编辑类型
|
||||
, QueryMenuReq, QueryMenuRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑菜单
|
||||
/// </summary>
|
||||
Task<QueryMenuRsp> EditAsync(EditMenuReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 当前用户菜单
|
||||
/// </summary>
|
||||
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 请求日志明细模块
|
||||
/// </summary>
|
||||
public interface IRequestLogDetailModule : ICrudModule<CreateRequestLogDetailReq, QueryRequestLogDetailRsp // 创建类型
|
||||
, EditRequestLogDetailReq // 编辑类型
|
||||
, QueryRequestLogDetailReq, QueryRequestLogDetailRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -7,6 +7,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 请求日志模块
|
||||
/// </summary>
|
||||
public interface IRequestLogModule : ICrudModule<CreateRequestLogReq, QueryRequestLogRsp // 创建类型
|
||||
, EditRequestLogReq // 编辑类型
|
||||
, QueryRequestLogReq, QueryRequestLogRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
|
@ -6,15 +6,11 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 角色模块
|
||||
/// </summary>
|
||||
public interface IRoleModule : ICrudModule<CreateRoleReq, QueryRoleRsp // 创建类型
|
||||
, EditRoleReq // 编辑类型
|
||||
, QueryRoleReq, QueryRoleRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑角色
|
||||
/// </summary>
|
||||
Task<QueryRoleRsp> EditAsync(EditRoleReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 设置是否显示仪表板
|
||||
/// </summary>
|
||||
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 站内信-部门映射模块
|
||||
/// </summary>
|
||||
public interface ISiteMsgDeptModule : ICrudModule<CreateSiteMsgDeptReq, QuerySiteMsgDeptRsp // 创建类型
|
||||
, EditSiteMsgDeptReq // 编辑类型
|
||||
, QuerySiteMsgDeptReq, QuerySiteMsgDeptRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 站内信标记模块
|
||||
/// </summary>
|
||||
public interface ISiteMsgFlagModule : ICrudModule<CreateSiteMsgFlagReq, QuerySiteMsgFlagRsp // 创建类型
|
||||
, EditSiteMsgFlagReq // 编辑类型
|
||||
, QuerySiteMsgFlagReq, QuerySiteMsgFlagRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -7,15 +7,11 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 站内信模块
|
||||
/// </summary>
|
||||
public interface ISiteMsgModule : ICrudModule<CreateSiteMsgReq, QuerySiteMsgRsp // 创建类型
|
||||
, EditSiteMsgReq // 编辑类型
|
||||
, QuerySiteMsgReq, QuerySiteMsgRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑站内信
|
||||
/// </summary>
|
||||
Task<QuerySiteMsgRsp> EditAsync(EditSiteMsgReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 获取单个我的站内信
|
||||
/// </summary>
|
||||
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 站内信-角色映射模块
|
||||
/// </summary>
|
||||
public interface ISiteMsgRoleModule : ICrudModule<CreateSiteMsgRoleReq, QuerySiteMsgRoleRsp // 创建类型
|
||||
, EditSiteMsgRoleReq // 编辑类型
|
||||
, QuerySiteMsgRoleReq, QuerySiteMsgRoleRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 站内信-用户映射模块
|
||||
/// </summary>
|
||||
public interface ISiteMsgUserModule : ICrudModule<CreateSiteMsgUserReq, QuerySiteMsgUserRsp // 创建类型
|
||||
, EditSiteMsgUserReq // 编辑类型
|
||||
, QuerySiteMsgUserReq, QuerySiteMsgUserRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -7,6 +7,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 用户模块
|
||||
/// </summary>
|
||||
public partial interface IUserModule : ICrudModule<CreateUserReq, QueryUserRsp // 创建类型
|
||||
, EditUserReq // 编辑类型
|
||||
, QueryUserReq, QueryUserRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
@ -21,11 +22,6 @@ public partial interface IUserModule : ICrudModule<CreateUserReq, QueryUserRsp /
|
||||
/// </summary>
|
||||
Task<bool> CheckUserNameAvailableAsync(CheckUserNameAvailableReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 编辑用户
|
||||
/// </summary>
|
||||
Task<QueryUserRsp> EditAsync(EditUserReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 密码登录
|
||||
/// </summary>
|
||||
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 用户档案模块
|
||||
/// </summary>
|
||||
public interface IUserProfileModule : ICrudModule<CreateUserProfileReq, QueryUserProfileRsp // 创建类型
|
||||
, EditUserProfileReq // 编辑类型
|
||||
, QueryUserProfileReq, QueryUserProfileRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>;
|
@ -6,6 +6,7 @@ namespace NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
/// 验证码模块
|
||||
/// </summary>
|
||||
public interface IVerifyCodeModule : ICrudModule<CreateVerifyCodeReq, QueryVerifyCodeRsp // 创建类型
|
||||
, EditVerifyCodeReq // 编辑类型
|
||||
, QueryVerifyCodeReq, QueryVerifyCodeRsp // 查询类型
|
||||
, DelReq // 删除类型
|
||||
>
|
||||
|
@ -38,11 +38,18 @@ public sealed class ApiService(
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<QueryApiRsp> EditAsync(EditApiReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryApiReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
return QueryInternal(req).AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -50,19 +50,10 @@ public sealed class ConfigService(BasicRepository<Sys_Config, long> rpo) //
|
||||
#if DBTYPE_SQLSERVER
|
||||
return (await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryConfigRsp>();
|
||||
#else
|
||||
return await UpdateAsync(req, null).ConfigureAwait(false) > 0
|
||||
? await GetAsync(new QueryConfigReq { Id = req.Id }).ConfigureAwait(false)
|
||||
: null;
|
||||
return await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryConfigReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryConfigReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryConfigReq> req)
|
||||
{
|
||||
|
@ -7,6 +7,11 @@ namespace NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
||||
/// </summary>
|
||||
public interface IApiService : IService, IApiModule
|
||||
{
|
||||
/// <summary>
|
||||
/// 接口是否存在
|
||||
/// </summary>
|
||||
public Task<bool> ExistAsync(QueryReq<QueryApiReq> req);
|
||||
|
||||
/// <summary>
|
||||
/// 反射接口列表
|
||||
/// </summary>
|
||||
|
@ -1,14 +1,6 @@
|
||||
using NetAdmin.Domain.Dto.Sys.Dic.Catalog;
|
||||
|
||||
namespace NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 字典目录服务
|
||||
/// </summary>
|
||||
public interface IDicCatalogService : IService, IDicCatalogModule
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑字典目录
|
||||
/// </summary>
|
||||
Task<int> EditAsync(EditDicCatalogReq req);
|
||||
}
|
||||
public interface IDicCatalogService : IService, IDicCatalogModule;
|
@ -7,11 +7,6 @@ namespace NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
||||
/// </summary>
|
||||
public interface IDicContentService : IService, IDicContentModule
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑字典内容
|
||||
/// </summary>
|
||||
Task<QueryDicContentRsp> EditAsync(EditDicContentReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 通过分类键查询字典内容
|
||||
/// </summary>
|
||||
|
@ -1,14 +1,6 @@
|
||||
using NetAdmin.Domain.Dto.Sys.Doc.Catalog;
|
||||
|
||||
namespace NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
||||
|
||||
/// <summary>
|
||||
/// 文档分类服务
|
||||
/// </summary>
|
||||
public interface IDocCatalogService : IService, IDocCatalogModule
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑文档分类
|
||||
/// </summary>
|
||||
Task<int> EditAsync(EditDocCatalogReq req);
|
||||
}
|
||||
public interface IDocCatalogService : IService, IDocCatalogModule;
|
@ -7,11 +7,6 @@ namespace NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
||||
/// </summary>
|
||||
public interface IDocContentService : IService, IDocContentModule
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑文档内容
|
||||
/// </summary>
|
||||
Task<QueryDocContentRsp> EditAsync(EditDocContentReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 浏览文档内容
|
||||
/// </summary>
|
||||
|
@ -7,11 +7,6 @@ namespace NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
||||
/// </summary>
|
||||
public interface IUserProfileService : IService, IUserProfileModule
|
||||
{
|
||||
/// <summary>
|
||||
/// 编辑用户档案
|
||||
/// </summary>
|
||||
Task<int> EditAsync(EditUserProfileReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前用户配置
|
||||
/// </summary>
|
||||
|
@ -7,6 +7,11 @@ namespace NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
||||
/// </summary>
|
||||
public interface IUserService : IService, IUserModule
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户是否存在
|
||||
/// </summary>
|
||||
public Task<bool> ExistAsync(QueryReq<QueryUserReq> req);
|
||||
|
||||
/// <summary>
|
||||
/// 用户编号登录
|
||||
/// </summary>
|
||||
|
@ -68,17 +68,10 @@ public sealed class DeptService(BasicRepository<Sys_Dept, long> rpo) //
|
||||
#if DBTYPE_SQLSERVER
|
||||
return (await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryDeptRsp>();
|
||||
#else
|
||||
return await UpdateAsync(req, null).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDeptReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
return await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDeptReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDeptReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryDeptReq> req)
|
||||
{
|
||||
|
@ -51,19 +51,19 @@ public sealed class DicCatalogService(BasicRepository<Sys_DicCatalog, long> rpo)
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <exception cref="NetAdminInvalidOperationException">The_parent_node_does_not_exist</exception>
|
||||
public async Task<int> EditAsync(EditDicCatalogReq req)
|
||||
public async Task<QueryDicCatalogRsp> EditAsync(EditDicCatalogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)
|
||||
? await UpdateAsync(req).ConfigureAwait(false)
|
||||
: throw new NetAdminInvalidOperationException(Ln.父节点不存在);
|
||||
}
|
||||
if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.父节点不存在);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDicCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
return
|
||||
#if DBTYPE_SQLSERVER
|
||||
(await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryDicCatalogRsp>();
|
||||
#else
|
||||
await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDicCatalogReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -60,19 +60,10 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
#if DBTYPE_SQLSERVER
|
||||
return (await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryDicContentRsp>();
|
||||
#else
|
||||
return await UpdateAsync(req, null).ConfigureAwait(false) > 0
|
||||
? await GetAsync(new QueryDicContentReq { Id = req.Id }).ConfigureAwait(false)
|
||||
: null;
|
||||
return await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDicContentReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDicContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryDicContentReq> req)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ public sealed class DicService(IDicCatalogService catalogService, IDicContentSer
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<int> EditCatalogAsync(EditDicCatalogReq req)
|
||||
public Task<QueryDicCatalogRsp> EditCatalogAsync(EditDicCatalogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return catalogService.EditAsync(req);
|
||||
|
@ -51,19 +51,20 @@ public sealed class DocCatalogService(BasicRepository<Sys_DocCatalog, long> rpo)
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <exception cref="NetAdminInvalidOperationException">The_parent_node_does_not_exist</exception>
|
||||
public async Task<int> EditAsync(EditDocCatalogReq req)
|
||||
public async Task<QueryDocCatalogRsp> EditAsync(EditDocCatalogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return req.ParentId == 0 || await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)
|
||||
? await UpdateAsync(req).ConfigureAwait(false)
|
||||
: throw new NetAdminInvalidOperationException(Ln.父节点不存在);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDocCatalogReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
if (req.ParentId != 0 && !await Rpo.Where(a => a.Id == req.ParentId).WithNoLockNoWait().AnyAsync().ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.父节点不存在);
|
||||
}
|
||||
|
||||
return
|
||||
#if DBTYPE_SQLSERVER
|
||||
(await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryDocCatalogRsp>();
|
||||
#else
|
||||
await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryDocCatalogReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -70,13 +70,6 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
@ -122,6 +115,7 @@ public sealed class DocContentService(BasicRepository<Sys_DocContent, long> rpo)
|
||||
req.ThrowIfInvalid();
|
||||
var ret = await QueryInternal(new QueryReq<QueryDocContentReq> { Filter = req, Order = Orders.None }).ToOneAsync().ConfigureAwait(false);
|
||||
|
||||
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
|
||||
switch (ret?.Visibility) {
|
||||
case ArchiveVisibilities.LogonUser:
|
||||
if (UserToken == null) {
|
||||
|
@ -50,7 +50,7 @@ public sealed class DocService(IDocCatalogService catalogService, IDocContentSer
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<int> EditCatalogAsync(EditDocCatalogReq req)
|
||||
public Task<QueryDocCatalogRsp> EditCatalogAsync(EditDocCatalogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return catalogService.EditAsync(req);
|
||||
|
@ -45,10 +45,10 @@ public sealed class JobRecordService(BasicRepository<Sys_JobRecord, long> rpo) /
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryJobRecordReq> req)
|
||||
public Task<QueryJobRecordRsp> EditAsync(EditJobRecordReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -121,13 +121,6 @@ public sealed class JobService(BasicRepository<Sys_Job, long> rpo, IJobRecordSer
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryJobReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryJobReq> req)
|
||||
{
|
||||
|
@ -44,10 +44,10 @@ public sealed class LoginLogService(BasicRepository<Sys_LoginLog, long> rpo) //
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryLoginLogReq> req)
|
||||
public Task<QueryLoginLogRsp> EditAsync(EditLoginLogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -52,17 +52,10 @@ public sealed class MenuService(BasicRepository<Sys_Menu, long> rpo, IUserServic
|
||||
#if DBTYPE_SQLSERVER
|
||||
return (await UpdateReturnListAsync(req).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryMenuRsp>();
|
||||
#else
|
||||
return await UpdateAsync(req, null).ConfigureAwait(false) > 0 ? await GetAsync(new QueryMenuReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
return await UpdateAsync(req).ConfigureAwait(false) > 0 ? await GetAsync(new QueryMenuReq { Id = req.Id }).ConfigureAwait(false) : null;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryMenuReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryMenuReq> req)
|
||||
{
|
||||
|
@ -44,10 +44,10 @@ public sealed class RequestLogDetailService(BasicRepository<Sys_RequestLogDetail
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRequestLogDetailReq> req)
|
||||
public Task<QueryRequestLogDetailRsp> EditAsync(EditRequestLogDetailReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -52,10 +52,10 @@ public sealed class RequestLogService(BasicRepository<Sys_RequestLog, long> rpo,
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRequestLogReq> req)
|
||||
public Task<QueryRequestLogRsp> EditAsync(EditRequestLogReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -66,13 +66,6 @@ public sealed class RoleService(BasicRepository<Sys_Role, long> rpo) //
|
||||
return (await QueryAsync(new QueryReq<QueryRoleReq> { Filter = new QueryRoleReq { Id = req.Id } }).ConfigureAwait(false)).First();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRoleReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryRoleReq> req)
|
||||
{
|
||||
|
@ -44,10 +44,10 @@ public sealed class SiteMsgDeptService(BasicRepository<Sys_SiteMsgDept, long> rp
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgDeptReq> req)
|
||||
public Task<QuerySiteMsgDeptRsp> EditAsync(EditSiteMsgDeptReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -44,10 +44,10 @@ public sealed class SiteMsgFlagService(BasicRepository<Sys_SiteMsgFlag, long> rp
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgFlagReq> req)
|
||||
public Task<QuerySiteMsgFlagRsp> EditAsync(EditSiteMsgFlagReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -44,10 +44,10 @@ public sealed class SiteMsgRoleService(BasicRepository<Sys_SiteMsgRole, long> rp
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgRoleReq> req)
|
||||
public Task<QuerySiteMsgRoleRsp> EditAsync(EditSiteMsgRoleReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -86,13 +86,6 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
|
||||
return (await QueryAsync(new QueryReq<QuerySiteMsgReq> { Filter = new QuerySiteMsgReq { Id = req.Id } }).ConfigureAwait(false)).First();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QuerySiteMsgReq> req)
|
||||
{
|
||||
@ -170,7 +163,10 @@ public sealed class SiteMsgService(BasicRepository<Sys_SiteMsg, long> rpo, Conte
|
||||
public async Task SetSiteMsgStatusAsync(SetUserSiteMsgStatusReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
if (!await ExistAsync(new QueryReq<QuerySiteMsgReq> { Filter = new QuerySiteMsgReq { Id = req.SiteMsgId } }).ConfigureAwait(false)) {
|
||||
if (!await QueryInternal(new QueryReq<QuerySiteMsgReq> { Filter = new QuerySiteMsgReq { Id = req.SiteMsgId } })
|
||||
.WithNoLockNoWait()
|
||||
.AnyAsync()
|
||||
.ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.站内信不存在);
|
||||
}
|
||||
|
||||
|
@ -44,10 +44,10 @@ public sealed class SiteMsgUserService(BasicRepository<Sys_SiteMsgUser, long> rp
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgUserReq> req)
|
||||
public Task<QuerySiteMsgUserRsp> EditAsync(EditSiteMsgUserReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -64,17 +64,18 @@ public sealed class UserProfileService(BasicRepository<Sys_UserProfile, long> rp
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<int> EditAsync(EditUserProfileReq req)
|
||||
public async Task<QueryUserProfileRsp> EditAsync(EditUserProfileReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return UpdateAsync(req.Adapt<Sys_UserProfile>());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryUserProfileReq> req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
return
|
||||
#if DBTYPE_SQLSERVER
|
||||
(await UpdateReturnListAsync(req.Adapt<Sys_UserProfile>()).ConfigureAwait(false)).FirstOrDefault()?.Adapt<QueryUserProfileRsp>();
|
||||
#else
|
||||
await UpdateAsync(req.Adapt<Sys_UserProfile>()).ConfigureAwait(false) > 0
|
||||
? await GetAsync(new QueryUserProfileReq { Id = req.Id }).ConfigureAwait(false)
|
||||
: null;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -54,10 +54,10 @@ public sealed class VerifyCodeService(BasicRepository<Sys_VerifyCode, long> rpo,
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryVerifyCodeReq> req)
|
||||
public Task<QueryVerifyCodeRsp> EditAsync(EditVerifyCodeReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
return QueryInternal(req).WithNoLockNoWait().AnyAsync();
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -31,9 +31,9 @@ public sealed class ApiCache(IDistributedCache cache, IApiService service) //
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryApiReq> req)
|
||||
public Task<QueryApiRsp> EditAsync(EditApiReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -36,12 +36,6 @@ public sealed class ConfigCache(IDistributedCache cache, IConfigService service)
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryConfigReq> req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryConfigReq> req)
|
||||
{
|
||||
|
@ -36,12 +36,6 @@ public sealed class DeptCache(IDistributedCache cache, IDeptService service) //
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDeptReq> req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryDeptReq> req)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ public sealed class DicCache(IDistributedCache cache, IDicService service) //
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<int> EditCatalogAsync(EditDicCatalogReq req)
|
||||
public Task<QueryDicCatalogRsp> EditCatalogAsync(EditDicCatalogReq req)
|
||||
{
|
||||
return Service.EditCatalogAsync(req);
|
||||
}
|
||||
|
@ -31,9 +31,9 @@ public sealed class DicCatalogCache(IDistributedCache cache, IDicCatalogService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDicCatalogReq> req)
|
||||
public Task<QueryDicCatalogRsp> EditAsync(EditDicCatalogReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -31,9 +31,9 @@ public sealed class DicContentCache(IDistributedCache cache, IDicContentService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDicContentReq> req)
|
||||
public Task<QueryDicContentRsp> EditAsync(EditDicContentReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -44,7 +44,7 @@ public sealed class DocCache(IDistributedCache cache, IDocService service) //
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<int> EditCatalogAsync(EditDocCatalogReq req)
|
||||
public Task<QueryDocCatalogRsp> EditCatalogAsync(EditDocCatalogReq req)
|
||||
{
|
||||
return Service.EditCatalogAsync(req);
|
||||
}
|
||||
|
@ -31,9 +31,9 @@ public sealed class DocCatalogCache(IDistributedCache cache, IDocCatalogService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDocCatalogReq> req)
|
||||
public Task<QueryDocCatalogRsp> EditAsync(EditDocCatalogReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -31,9 +31,9 @@ public sealed class DocContentCache(IDistributedCache cache, IDocContentService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryDocContentReq> req)
|
||||
public Task<QueryDocContentRsp> EditAsync(EditDocContentReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -49,12 +49,6 @@ public sealed class JobCache(IDistributedCache cache, IJobService service) : Dis
|
||||
return Service.ExecuteAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryJobReq> req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryJobReq> req)
|
||||
{
|
||||
|
@ -31,9 +31,9 @@ public sealed class JobRecordCache(IDistributedCache cache, IJobRecordService se
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryJobRecordReq> req)
|
||||
public Task<QueryJobRecordRsp> EditAsync(EditJobRecordReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -31,9 +31,9 @@ public sealed class LoginLogCache(IDistributedCache cache, ILoginLogService serv
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryLoginLogReq> req)
|
||||
public Task<QueryLoginLogRsp> EditAsync(EditLoginLogReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -36,12 +36,6 @@ public sealed class MenuCache(IDistributedCache cache, IMenuService service) //
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryMenuReq> req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryMenuReq> req)
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ public sealed class RequestLogCache(IDistributedCache cache, IRequestLogService
|
||||
public async Task<long> CountAsync(QueryReq<QueryRequestLogReq> req)
|
||||
#else
|
||||
public Task<long> CountAsync(QueryReq<QueryRequestLogReq> req)
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
#if !DEBUG
|
||||
var ret = await GetOrCreateAsync( //
|
||||
@ -44,9 +44,9 @@ public sealed class RequestLogCache(IDistributedCache cache, IRequestLogService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRequestLogReq> req)
|
||||
public Task<QueryRequestLogRsp> EditAsync(EditRequestLogReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -31,9 +31,9 @@ public sealed class RequestLogDetailCache(IDistributedCache cache, IRequestLogDe
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRequestLogDetailReq> req)
|
||||
public Task<QueryRequestLogDetailRsp> EditAsync(EditRequestLogDetailReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -36,12 +36,6 @@ public sealed class RoleCache(IDistributedCache cache, IRoleService service) //
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QueryRoleReq> req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QueryRoleReq> req)
|
||||
{
|
||||
|
@ -37,12 +37,6 @@ public sealed class SiteMsgCache(IDistributedCache cache, ISiteMsgService servic
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgReq> req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IActionResult> ExportAsync(QueryReq<QuerySiteMsgReq> req)
|
||||
{
|
||||
|
@ -31,9 +31,9 @@ public sealed class SiteMsgDeptCache(IDistributedCache cache, ISiteMsgDeptServic
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgDeptReq> req)
|
||||
public Task<QuerySiteMsgDeptRsp> EditAsync(EditSiteMsgDeptReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -31,9 +31,9 @@ public sealed class SiteMsgFlagCache(IDistributedCache cache, ISiteMsgFlagServic
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgFlagReq> req)
|
||||
public Task<QuerySiteMsgFlagRsp> EditAsync(EditSiteMsgFlagReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -31,9 +31,9 @@ public sealed class SiteMsgRoleCache(IDistributedCache cache, ISiteMsgRoleServic
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgRoleReq> req)
|
||||
public Task<QuerySiteMsgRoleRsp> EditAsync(EditSiteMsgRoleReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -31,9 +31,9 @@ public sealed class SiteMsgUserCache(IDistributedCache cache, ISiteMsgUserServic
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> ExistAsync(QueryReq<QuerySiteMsgUserReq> req)
|
||||
public Task<QuerySiteMsgUserRsp> EditAsync(EditSiteMsgUserReq req)
|
||||
{
|
||||
return Service.ExistAsync(req);
|
||||
return Service.EditAsync(req);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user