package com. test. entity ; import jakarta. persistence. * ;
import lombok. * ;
import org. hibernate. annotations. Comment ; import java. time. Instant ;
import java. util. Objects ; @Comment ( "操作日志表" )
@Entity
@Table ( name = "sys_operation_log" , schema = "controllerLogToDB" )
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString
public class SysOperationLog { @Id @GeneratedValue ( strategy = GenerationType . IDENTITY ) @Column ( name = "id" , nullable = false ) private Long id; @Comment ( "操作模块" ) @Column ( name = "module" , length = 50 ) private String module ; @Comment ( "操作类型" ) @Column ( name = "type" , length = 50 ) private String type; @Comment ( "操作描述" ) @Column ( name = "description" ) private String description; @Comment ( "请求方法" ) @Column ( name = "method" , length = 100 ) private String method; @Comment ( "请求路径" ) @Column ( name = "request_url" ) private String requestUrl; @Comment ( "请求方式" ) @Column ( name = "request_method" , length = 20 ) private String requestMethod; @Comment ( "请求参数" ) @Lob @Column ( name = "request_params" ) private String requestParams; @Comment ( "响应结果" ) @Lob @Column ( name = "response_result" , columnDefinition = "TEXT" ) private String responseResult; @Comment ( "操作用户" ) @Column ( name = "username" , length = 50 ) private String username; @Comment ( "IP地址" ) @Column ( name = "ip_address" , length = 50 ) private String ipAddress; @Comment ( "操作状态(0-失败,1-成功)" ) @Column ( name = "status" ) private Integer status; @Comment ( "错误信息" ) @Lob @Column ( name = "error_msg" ) private String errorMsg; @Comment ( "创建时间" ) @Column ( name = "create_time" ) private Instant createTime; @Comment ( "执行时长(毫秒)" ) @Column ( name = "duration" ) private Long duration; @Override public boolean equals ( Object o) { if ( this == o) return true ; if ( o == null || getClass ( ) != o. getClass ( ) ) return false ; SysOperationLog that = ( SysOperationLog ) o; return Objects . equals ( id, that. id) && Objects . equals ( module , that. module ) && Objects . equals ( type, that. type) && Objects . equals ( description, that. description) && Objects . equals ( method, that. method) && Objects . equals ( requestUrl, that. requestUrl) && Objects . equals ( requestMethod, that. requestMethod) && Objects . equals ( requestParams, that. requestParams) && Objects . equals ( responseResult, that. responseResult) && Objects . equals ( username, that. username) && Objects . equals ( ipAddress, that. ipAddress) && Objects . equals ( status, that. status) && Objects . equals ( errorMsg, that. errorMsg) && Objects . equals ( createTime, that. createTime) && Objects . equals ( duration, that. duration) ; } @Override public int hashCode ( ) { return Objects . hash ( id, module , type, description, method, requestUrl, requestMethod, requestParams, responseResult, username, ipAddress, status, errorMsg, createTime, duration) ; }
}