Springboot log module skill

From jiushiwon/wg-skills · View interactive version

Springboot log module skill is an AI agent skill from the GitHub repository jiushiwon/wg-skills. Spring Boot 日志审计模块技能。面向已有 Spring Boot 项目,提供操作日志、登录日志、审计追踪等能力的快速集成。触发词:"日志模块"、"审计模块"、"操作日志"、"登录日志"、"log module"、"audit log"。

How to use this skill

Skill file

Spring Boot Log Module Skill

面向已有 Spring Boot 项目的开发者,快速集成日志和审计能力。

能力清单

| 能力 | 说明 |

|------|------|

| 操作日志 | 记录用户操作 |

| 登录日志 | 记录登录登出 |

| 审计追踪 | 敏感操作审计 |

| 日志查询 | 分页查询、导出 |

实体

@Data
@Entity
@Table(name = "wg_operation_log")
public class OperationLog {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private Long userId;
    private String username;
    private String module;
    private String operation;
    private String method;
    private String path;
    @Column(columnDefinition = "TEXT")
    private String params;
    @Column(columnDefinition = "TEXT")
    private String result;
    private String ip;
    private String location;
    private Integer duration;
    private LocalDateTime createdAt;
}

@Data
@Entity
@Table(name = "wg_login_log")
public class LoginLog {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private Long userId;
    private String username;
    private Integer status;
    private String ip;
    private String location;
    private String userAgent;
    private String message;
    private LocalDateTime createdAt;
}

注解方式记录日志

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface OperationLog {
    String module() default "";
    String operation() default "";
}
@Aspect
@Component
public class OperationLogAspect {
    
    @Around("@annotation(operationLog)")
    public Object around(ProceedingJoinPoint joinPoint, OperationLog operationLog) {
        // 记录操作
    }
}

不做

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.