feat: 新增操作日志功能并优化定时任务配置
1. 新增OperationLogAttribute与OperationLogActionFilter,实现自动化操作日志记录 2. 新增OperationLogRecordInput输入模型,重构IOperationLogService日志接口 3. 为所有业务控制器接口添加操作日志注解 4. 调整期刊AI批改任务的执行周期与方法适配异步调用 5. 优化Hangfire定时任务注册逻辑,支持异步任务 6. 补充完善操作日志类型与目标类型枚举
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using QYZH.InteractiveMagazine.Infrastructure.Middleware;
|
||||
using QYZH.InteractiveMagazine.IService;
|
||||
using QYZH.InteractiveMagazine.Models.Common;
|
||||
using QYZH.InteractiveMagazine.Models.Dto;
|
||||
@ -29,6 +30,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 创建宠物模板
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Create, OperationLogTargetType.Pet)]
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<PetTemplateOutput>> CreateTemplateAsync([FromBody] PetTemplateInput input)
|
||||
{
|
||||
@ -52,6 +54,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 更新宠物模板
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Update, OperationLogTargetType.Pet)]
|
||||
[HttpPut("{id}")]
|
||||
public async Task<BaseResponse<PetTemplateOutput>> UpdateTemplateAsync(long id, [FromBody] PetTemplateInput input)
|
||||
{
|
||||
@ -75,6 +78,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 删除宠物模板
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Delete, OperationLogTargetType.Pet)]
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<BaseResponse<object>> DeleteTemplateAsync(long id)
|
||||
{
|
||||
@ -144,6 +148,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 更新宠物模板状态(启用/禁用)
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.StatusChange, OperationLogTargetType.Pet)]
|
||||
[HttpPut("{id}/status")]
|
||||
public async Task<BaseResponse<object>> UpdateTemplateStatusAsync(long id)
|
||||
{
|
||||
@ -169,6 +174,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 创建进化阶段
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Create, OperationLogTargetType.PetEvolution)]
|
||||
[HttpPost("evolution")]
|
||||
public async Task<BaseResponse<PetEvolutionOutput>> CreateEvolutionAsync([FromBody] PetEvolutionInput input)
|
||||
{
|
||||
@ -192,6 +198,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 更新进化阶段
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Update, OperationLogTargetType.PetEvolution)]
|
||||
[HttpPut("evolution/{id}")]
|
||||
public async Task<BaseResponse<PetEvolutionOutput>> UpdateEvolutionAsync(long id, [FromBody] PetEvolutionInput input)
|
||||
{
|
||||
@ -215,6 +222,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 删除进化阶段
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Delete, OperationLogTargetType.PetEvolution)]
|
||||
[HttpDelete("evolution/{id}")]
|
||||
public async Task<BaseResponse<object>> DeleteEvolutionAsync(long id)
|
||||
{
|
||||
@ -286,6 +294,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 创建皮肤
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Create, OperationLogTargetType.PetSkin)]
|
||||
[HttpPost("skin")]
|
||||
public async Task<BaseResponse<PetSkinOutput>> CreateSkinAsync([FromBody] PetSkinInput input)
|
||||
{
|
||||
@ -309,6 +318,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 更新皮肤
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Update, OperationLogTargetType.PetSkin)]
|
||||
[HttpPut("skin/{id}")]
|
||||
public async Task<BaseResponse<PetSkinOutput>> UpdateSkinAsync(long id, [FromBody] PetSkinInput input)
|
||||
{
|
||||
@ -332,6 +342,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 删除皮肤
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Delete, OperationLogTargetType.PetSkin)]
|
||||
[HttpDelete("skin/{id}")]
|
||||
public async Task<BaseResponse<object>> DeleteSkinAsync(long id)
|
||||
{
|
||||
@ -403,6 +414,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 创建皮肤图片
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Create, OperationLogTargetType.PetSkinImage)]
|
||||
[HttpPost("skin-image")]
|
||||
public async Task<BaseResponse<PetSkinImageOutput>> CreateSkinImageAsync([FromBody] PetSkinImageInput input)
|
||||
{
|
||||
@ -426,6 +438,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 更新皮肤图片
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Update, OperationLogTargetType.PetSkinImage)]
|
||||
[HttpPut("skin-image/{id}")]
|
||||
public async Task<BaseResponse<PetSkinImageOutput>> UpdateSkinImageAsync(long id, [FromBody] PetSkinImageInput input)
|
||||
{
|
||||
@ -449,6 +462,7 @@ public class PetManageController : BaseController
|
||||
/// <summary>
|
||||
/// 删除皮肤图片
|
||||
/// </summary>
|
||||
[OperationLog(OperationLogActionType.Delete, OperationLogTargetType.PetSkinImage)]
|
||||
[HttpDelete("skin-image/{id}")]
|
||||
public async Task<BaseResponse<object>> DeleteSkinImageAsync(long id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user