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;
|
||||
@ -28,6 +29,7 @@ public class MedalController : BaseController
|
||||
/// </summary>
|
||||
/// <param name="input">勋章信息</param>
|
||||
/// <returns>创建的勋章信息</returns>
|
||||
[OperationLog(OperationLogActionType.Create, OperationLogTargetType.Medal)]
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<MedalOutput>> CreateAsync([FromBody] MedalInput input)
|
||||
{
|
||||
@ -54,6 +56,7 @@ public class MedalController : BaseController
|
||||
/// <param name="id">勋章ID</param>
|
||||
/// <param name="input">勋章信息</param>
|
||||
/// <returns>更新后的勋章信息</returns>
|
||||
[OperationLog(OperationLogActionType.Update, OperationLogTargetType.Medal)]
|
||||
[HttpPut("{id}")]
|
||||
public async Task<BaseResponse<MedalOutput>> UpdateAsync(long id, [FromBody] MedalInput input)
|
||||
{
|
||||
@ -79,6 +82,7 @@ public class MedalController : BaseController
|
||||
/// </summary>
|
||||
/// <param name="id">勋章ID</param>
|
||||
/// <returns>操作结果</returns>
|
||||
[OperationLog(OperationLogActionType.Delete, OperationLogTargetType.Medal)]
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<BaseResponse<object>> DeleteAsync(long id)
|
||||
{
|
||||
@ -155,6 +159,7 @@ public class MedalController : BaseController
|
||||
/// <param name="id">勋章ID</param>
|
||||
/// <param name="status">状态: 0=禁用, 1=启用</param>
|
||||
/// <returns>操作结果</returns>
|
||||
[OperationLog(OperationLogActionType.StatusChange, OperationLogTargetType.Medal)]
|
||||
[HttpPut("{id}/status")]
|
||||
public async Task<BaseResponse<bool>> UpdateStatusAsync(long id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user