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.

100 lines
2.5 KiB

// 数据库连接配置
require('dotenv').config();
module.exports = {
db: {
host: '1.95.162.61',
port: 3306,
user: 'root',
password: 'schl@2025',
database: 'wechat_app'
},
// 数据库表结构配置
tables: {
users: {
name: 'users',
fields: {
id: 'id',
userId: 'userId',
company: 'company',
name: 'nickName',
phoneNumber: 'phoneNumber',
type: 'type',
city: 'city'
}
},
cartItems: {
name: 'cart_items',
fields: {
userId: 'userId',
productName: 'productName',
specification: 'specification',
quantity: 'quantity',
yolk: 'yolk'
}
},
products: {
name: 'products',
fields: {
sellerId: 'sellerId',
productName: 'productName',
specification: 'specification',
quantity: 'quantity',
yolk: 'yolk'
}
}
},
// 简道云配置
jiandaoyun: {
appId: '684bd1da61702bed58d15d13',
entryId: '693644f891a2fb633d1c0e8f',
apiKey: 'JgTzhmiwlwzz4LWl4dJ4FGZ6yr3VqxoW',
apiUrl: 'https://api.jiandaoyun.com/api/v1'
},
// 字段映射关系
fieldMapping: {
'userId': '_widget_1765164283327',
'company': '_widget_1765164283326',
'nickName': '_widget_1765164283341',
'phoneNumber': '_widget_1765164283342',
'type': '_widget_1765171392031',
'city': '_widget_1765164283330',
// cart_items表映射 (buyer相关)
'productName-buyer': '_widget_1765164283332',
'specification-buyer': '_widget_1765164283336',
'quantity-buyer': '_widget_1765164283337',
'grossWeight-buyer': '_widget_1765164283338',
'yolk-buyer': '_widget_1765164283339',
// products表映射 (sell相关)
'productName-sell': '_widget_1765178808518',
'specification-sell': '_widget_1765178808519',
'quantity-sell': '_widget_1765178808520',
'grossWeight-sell': '_widget_1765178808521',
'yolk-sell': '_widget_1765178808522'
},
// 同步配置
sync: {
// 增量同步模式:true - 只同步新增/未同步数据,false - 同步所有数据
incremental: true,
// 同步状态字段
statusField: 'sync_status',
// 最后同步时间字段
timeField: 'last_sync_time',
// 已同步状态值
syncedValue: 1,
// 未同步状态值
unsyncedValue: 0,
// 自动同步配置
autoSync: {
// 是否启用自动同步
enabled: true,
// 同步间隔时间(单位:分钟)
interval: 5
}
}
};