"use strict"; /** * AI查询记录模型 */ module.exports = (dc) => { const DataTypes = dc.ORM; const sequelize = dc.orm; const AiQueryRecord = sequelize.define( "ai_query_record", { id: { type: DataTypes.INTEGER, allowNull: false, defaultValue: null, comment: "ID", field: "id", primaryKey: true, autoIncrement: true, }, question: { type: DataTypes.TEXT, allowNull: true, defaultValue: null, comment: "问题", field: "question", autoIncrement: false, }, time: { type: DataTypes.DATE, allowNull: true, defaultValue: null, comment: "时间", field: "time", autoIncrement: false, }, userId: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: "用户ID", primaryKey: false, field: "user_id", autoIncrement: false }, ipAddress: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: "此次请求的客户端ip地址", primaryKey: false, field: "ip_address", autoIncrement: false }, clientId: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: "使用的client_id", primaryKey: false, field: "client_id", autoIncrement: false }, feature: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: "功能", primaryKey: false, field: "feature", autoIncrement: false }, }, { tableName: "ai_query_record", timestamps: false, underscored: true, } ); dc.models.AiQueryRecord = AiQueryRecord; return AiQueryRecord; };