refactor: 抽象操作日志模块

This commit is contained in:
陈淳
2023-02-22 16:49:24 +08:00
parent fa4e0b3752
commit 99aa7d3361
43 changed files with 415 additions and 212 deletions

View File

@@ -171,6 +171,13 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Yi.RBAC.Application.Identity.UserService.UpdateProfileAsync(Yi.RBAC.Application.Contracts.Identity.Dtos.User.ProfileUpdateInputVo)">
<summary>
更新个人中心
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Yi.RBAC.Application.Identity.UserService.UpdateStateAsync(System.Int64,System.Boolean)">
<summary>
更新状态
@@ -179,15 +186,17 @@
<param name="state"></param>
<returns></returns>
</member>
<member name="T:Yi.RBAC.Application.Logs.OperationLogService">
<summary>
OperationLog服务实现
</summary>
</member>
<member name="T:Yi.RBAC.Application.Setting.ConfigService">
<summary>
Config服务实现
</summary>
</member>
<member name="M:Yi.RBAC.Application.Setting.ConfigService.GetListAsync(Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigGetListInputVo)">
<summary>
多查
</summary>
<param name="input"></param>
<returns></returns>
</member>
</members>
</doc>

View File

@@ -12,6 +12,8 @@ using SqlSugar;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Yi.Framework.Auth.JwtBearer.Authorization;
using Yi.RBAC.Application.Contracts.Identity.Dtos.User;
using Yi.Framework.Core.CurrentUsers;
namespace Yi.RBAC.Application.Identity
{
@@ -31,6 +33,9 @@ namespace Yi.RBAC.Application.Identity
[Autowired]
private IUserRepository _userRepository { get; set; }
[Autowired]
private ICurrentUser _currentUser { get; set; }
/// <summary>
/// 查询用户
/// </summary>
@@ -135,6 +140,20 @@ namespace Yi.RBAC.Application.Identity
return await MapToGetOutputDtoAsync(entity);
}
/// <summary>
/// 更新个人中心
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<UserGetOutputDto> UpdateProfileAsync(ProfileUpdateInputVo input)
{
var entity = await _repository.GetByIdAsync(_currentUser.Id);
_mapper.Map(input, entity);
await _repository.UpdateAsync(entity);
var dto = _mapper.Map<UserGetOutputDto>(entity);
return dto;
}
/// <summary>
/// 更新状态
/// </summary>
@@ -142,7 +161,7 @@ namespace Yi.RBAC.Application.Identity
/// <param name="state"></param>
/// <returns></returns>
[Route("/api/user/{id}/{state}")]
public async Task<UserGetOutputDto> UpdateStateAsync([FromRoute] long id,[FromRoute] bool state)
public async Task<UserGetOutputDto> UpdateStateAsync([FromRoute] long id, [FromRoute] bool state)
{
var entity = await _repository.GetByIdAsync(id);
if (entity is null)

View File

@@ -1,23 +0,0 @@
using Yi.RBAC.Application.Contracts.Logs;
using NET.AutoWebApi.Setting;
using Yi.RBAC.Application.Contracts.Logs.Dtos;
using Yi.RBAC.Domain.Logs.Entities;
using Yi.Framework.Ddd.Services;
using Yi.Framework.Model.RABC.Entitys;
using Yi.Framework.Ddd.Dtos;
namespace Yi.RBAC.Application.Logs
{
/// <summary>
/// OperationLog服务实现
/// </summary>
[AppService]
public class OperationLogService : CrudAppService<OperationLogEntity, OperationLogGetListOutputDto, long, OperationLogGetListInputVo >,
IOperationLogService, IAutoApiService
{
public override Task<PagedResultDto<OperationLogGetListOutputDto>> GetListAsync(OperationLogGetListInputVo input)
{
return base.GetListAsync(input);
}
}
}

View File

@@ -19,6 +19,11 @@ namespace Yi.RBAC.Application.Setting
public class ConfigService : CrudAppService<ConfigEntity, ConfigGetOutputDto, ConfigGetListOutputDto, long, ConfigGetListInputVo, ConfigCreateInputVo, ConfigUpdateInputVo>,
IConfigService, IAutoApiService
{
/// <summary>
/// 多查
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<PagedResultDto<ConfigGetListOutputDto>> GetListAsync(ConfigGetListInputVo input)
{
var entity = await MapToEntityAsync(input);