feat: 基础模块

注册登录
用户管理
角色管理
部门管理
消息管理
接口管理
菜单管理
字典管理
缓存管理
请求日志
系统设置
版本信息
代码生成
This commit is contained in:
tk
2023-11-17 18:54:31 +08:00
parent 18b4d7547a
commit d26e4c77cc
755 changed files with 30416 additions and 42743 deletions

View File

@ -8,17 +8,10 @@ using NetAdmin.SysComponent.Application.Services.Sys.Dependency;
namespace NetAdmin.SysComponent.Application.Services.Sys;
/// <inheritdoc cref="IDicContentService" />
public sealed class DicContentService : RepositoryService<Sys_DicContent, IDicContentService>, IDicContentService
public sealed class DicContentService(DefaultRepository<Sys_DicContent> rpo) //
: RepositoryService<Sys_DicContent, IDicContentService>(rpo), IDicContentService
{
/// <summary>
/// Initializes a new instance of the <see cref="DicContentService" /> class.
/// </summary>
public DicContentService(Repository<Sys_DicContent> rpo) //
: base(rpo) { }
/// <summary>
/// 批量删除字典内容
/// </summary>
/// <inheritdoc />
public async Task<int> BulkDeleteAsync(BulkReq<DelReq> req)
{
var sum = 0;
@ -29,9 +22,7 @@ public sealed class DicContentService : RepositoryService<Sys_DicContent, IDicCo
return sum;
}
/// <summary>
/// 创建字典内容
/// </summary>
/// <inheritdoc />
/// <exception cref="NetAdminInvalidOperationException">Dictionary_directory_does_not_exist</exception>
public async Task<QueryDicContentRsp> CreateAsync(CreateDicContentReq req)
{
@ -43,35 +34,26 @@ public sealed class DicContentService : RepositoryService<Sys_DicContent, IDicCo
return ret.Adapt<QueryDicContentRsp>();
}
/// <summary>
/// 删除字典内容
/// </summary>
/// <inheritdoc />
public Task<int> DeleteAsync(DelReq req)
{
return Rpo.DeleteAsync(a => a.Id == req.Id);
}
/// <summary>
/// 判断字典是否存在
/// </summary>
/// <exception cref="NotImplementedException">NotImplementedException</exception>
/// <inheritdoc />
public Task<bool> ExistAsync(QueryReq<QueryDicContentReq> req)
{
throw new NotImplementedException();
return QueryInternal(req).AnyAsync();
}
/// <summary>
/// 获取单个字典
/// </summary>
/// <exception cref="NotImplementedException">NotImplementedException</exception>
public Task<QueryDicContentRsp> GetAsync(QueryDicContentReq req)
/// <inheritdoc />
public async Task<QueryDicContentRsp> GetAsync(QueryDicContentReq req)
{
throw new NotImplementedException();
var ret = await QueryInternal(new QueryReq<QueryDicContentReq> { Filter = req }).ToOneAsync();
return ret.Adapt<QueryDicContentRsp>();
}
/// <summary>
/// 分页查询字典内容
/// </summary>
/// <inheritdoc />
public async Task<PagedQueryRsp<QueryDicContentRsp>> PagedQueryAsync(PagedQueryReq<QueryDicContentReq> req)
{
var list = await QueryInternal(req).Page(req.Page, req.PageSize).Count(out var total).ToListAsync();
@ -80,18 +62,14 @@ public sealed class DicContentService : RepositoryService<Sys_DicContent, IDicCo
, list.Adapt<IEnumerable<QueryDicContentRsp>>());
}
/// <summary>
/// 查询字典内容
/// </summary>
/// <inheritdoc />
public async Task<IEnumerable<QueryDicContentRsp>> QueryAsync(QueryReq<QueryDicContentReq> req)
{
var ret = await QueryInternal(req).Take(req.Count).ToListAsync();
return ret.Adapt<IEnumerable<QueryDicContentRsp>>();
}
/// <summary>
/// 更新字典内容
/// </summary>
/// <inheritdoc />
/// <exception cref="NetAdminInvalidOperationException">Dictionary_directory_does_not_exist</exception>
/// <exception cref="NetAdminUnexpectedException">NetAdminUnexpectedException</exception>
public async Task<QueryDicContentRsp> UpdateAsync(UpdateDicContentReq req)
@ -104,10 +82,16 @@ public sealed class DicContentService : RepositoryService<Sys_DicContent, IDicCo
throw new NetAdminUnexpectedException();
}
var ret = await Rpo.Select.Where(a => a.Id == req.Id).ToOneAsync();
var ret = await Rpo.Where(a => a.Id == req.Id).ToOneAsync();
return ret.Adapt<QueryDicContentRsp>();
}
/// <inheritdoc />
protected override Task<Sys_DicContent> UpdateForSqliteAsync(Sys_DicContent req)
{
throw new NotImplementedException();
}
private ISelect<Sys_DicContent> QueryInternal(QueryReq<QueryDicContentReq> req)
{
var ret = Rpo.Select.WhereDynamicFilter(req.DynamicFilter)