Files
autoAiWorkSys/api/model/chat_records.js
张成 dfd3119163 1
2026-02-28 10:38:28 +08:00

110 lines
2.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const Sequelize = require('sequelize');
/**
* 聊天会话列表表模型
* 按 Boss 「好友/会话」列表维度存储,会话摘要信息
*/
module.exports = (db) => {
const chat_records = db.define('chat_records', {
// 设备与平台
sn_code: {
comment: '设备SN码',
type: Sequelize.STRING(50),
allowNull: false,
defaultValue: ''
},
platform: {
comment: '平台: boss-Boss直聘, liepin-猎聘',
type: Sequelize.STRING(20),
allowNull: false,
defaultValue: 'boss'
},
// Boss 会话列表字段(与接口 friend 对象对应)
friendId: {
comment: '好友ID',
type: Sequelize.BIGINT,
allowNull: false
},
friendSource: {
comment: '好友来源',
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: 0
},
encryptFriendId: {
comment: '好友加密ID',
type: Sequelize.STRING(100),
allowNull: false,
defaultValue: ''
},
name: {
comment: 'HR姓名',
type: Sequelize.STRING(50),
allowNull: true,
defaultValue: ''
},
updateTime: {
comment: '最后更新时间(毫秒时间戳)',
type: Sequelize.BIGINT,
allowNull: true
},
brandName: {
comment: '公司名称',
type: Sequelize.STRING(200),
allowNull: true,
defaultValue: ''
},
jobName: {
comment: '职位名称',
type: Sequelize.STRING(200),
allowNull: true,
defaultValue: ''
},
jobTypeDesc: {
comment: '职位类型描述',
type: Sequelize.STRING(100),
allowNull: true,
defaultValue: ''
},
jobCity: {
comment: '职位城市',
type: Sequelize.STRING(100),
allowNull: true,
defaultValue: ''
},
positionName: {
comment: '岗位名称/方向',
type: Sequelize.STRING(200),
allowNull: true,
defaultValue: ''
},
bossTitle: {
comment: 'Boss/HR 职位头衔',
type: Sequelize.STRING(100),
allowNull: true,
defaultValue: ''
},
waterLevel: {
comment: '水位Boss 优先级标记)',
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: 0
}
}, {
timestamps: false,
indexes: [
{ unique: false, fields: ['sn_code'] },
{ unique: false, fields: ['platform'] },
{ unique: false, fields: ['friendId'] },
{ unique: false, fields: ['encryptFriendId'] }
]
});
// chat_records.sync({ force: true });
return chat_records;
};