feat: 请求日志增加TraceId (#154)

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
2024-07-08 20:50:53 +08:00
committed by GitHub
parent be5b9a160d
commit aaea28389a
38 changed files with 150 additions and 138 deletions

View File

@ -13,4 +13,9 @@ public interface IDicContentService : IService, IDicContentModule
/// 编辑字典内容
/// </summary>
Task<QueryDicContentRsp> EditAsync(EditDicContentReq req);
/// <summary>
/// 通过分类键查询字典内容
/// </summary>
Task<List<QueryDicContentRsp>> QueryByCatalogCodeAsync(string catalogCode);
}

View File

@ -141,6 +141,17 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
return ret.Adapt<IEnumerable<QueryDicContentRsp>>();
}
/// <inheritdoc />
public async Task<List<QueryDicContentRsp>> QueryByCatalogCodeAsync(string catalogCode)
{
var ret = await Rpo.Orm.Select<Sys_DicContent>()
.Include(a => a.Catalog)
.Where(a => a.Catalog.Code == catalogCode)
.ToListAsync()
.ConfigureAwait(false);
return ret.Adapt<List<QueryDicContentRsp>>();
}
private ISelect<Sys_DicContent> QueryInternal(QueryReq<QueryDicContentReq> req)
{
var ret = Rpo.Select.WhereDynamicFilter(req.DynamicFilter).WhereDynamic(req.Filter);

View File

@ -279,17 +279,16 @@ public sealed class UserService(
public async Task<int> ResetPasswordAsync(ResetPasswordReq req)
{
req.ThrowIfInvalid();
if (await verifyCodeService.VerifyAsync(req.VerifySmsCodeReq).ConfigureAwait(false)) {
var dto = (await Rpo.Where(a => a.Mobile == req.VerifySmsCodeReq.DestDevice)
.ToOneAsync(a => new { a.Version, a.Id })
.ConfigureAwait(false)).Adapt<Sys_User>() with {
Password = req.PasswordText.Pwd()
.Guid()
};
return await UpdateAsync(dto, [nameof(Sys_User.Password)]).ConfigureAwait(false);
if (!await verifyCodeService.VerifyAsync(req.VerifySmsCodeReq).ConfigureAwait(false)) {
throw new NetAdminInvalidOperationException(Ln.);
}
throw new NetAdminInvalidOperationException(Ln.);
var dto = (await Rpo.Where(a => a.Mobile == req.VerifySmsCodeReq.DestDevice)
.ToOneAsync(a => new { a.Version, a.Id })
.ConfigureAwait(false)).Adapt<Sys_User>() with {
Password = req.PasswordText.Pwd().Guid()
};
return await UpdateAsync(dto, [nameof(Sys_User.Password)]).ConfigureAwait(false);
}
/// <inheritdoc />