import { Column, Model, Table, DataType, CreatedAt } from "sequelize-typescript"; @Table({ tableName: "sys_operation_log", comment: "系统操作日志表", timestamps: true, createdAt: "created_at", updatedAt: false }) export default class SysOperationLog extends Model { @Column({ type: DataType.BIGINT, autoIncrement: true, primaryKey: true }) id!: number; @Column({ type: DataType.BIGINT, field: "user_id", comment: "操作用户ID" }) userId!: number; @Column({ type: DataType.STRING(64), field: "module", comment: "操作模块" }) module!: string; @Column({ type: DataType.STRING(64), field: "action", comment: "操作动作" }) action!: string; @Column({ type: DataType.STRING(256), field: "method", comment: "请求方法(GET/POST/PUT/DELETE等)" }) method!: string; @Column({ type: DataType.TEXT, field: "params", comment: "请求参数(JSON格式)" }) params!: string; @Column({ type: DataType.STRING(64), field: "ip", comment: "操作IP(支持IPv6)" }) ip!: string; @CreatedAt created_at!: Date; }