ai-query对接新版freesun-agent接口的分支
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

82 lines
2.1 KiB

"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;
};