|
@@ -3,7 +3,8 @@ const rabbitMq = require('../src/mq/rabbit-mq');
|
|
|
const helper = require('../src/helper');
|
|
|
const mysql = require('mysql2/promise');
|
|
|
const crypto = require('crypto');
|
|
|
-const config = require('../etc/config.json')
|
|
|
+const config = require('../etc/config.json');
|
|
|
+const tools = require('../tools');
|
|
|
const dbConfig = config.isDebug?config.debug_mysql:config.release_mysql
|
|
|
|
|
|
// 时间戳转MySQL datetime格式
|
|
@@ -82,6 +83,7 @@ async function processVideoTitles(connection, titles) {
|
|
|
}
|
|
|
|
|
|
const insertOriginData = async(connection,values) =>{
|
|
|
+
|
|
|
const insertSQL = `
|
|
|
INSERT INTO origin_data
|
|
|
(video_id, materialId, title, video_link, publish_time,
|
|
@@ -117,7 +119,7 @@ const messageHandler = async (msg) => {
|
|
|
|
|
|
// 转换时间戳为MySQL datetime格式
|
|
|
const values = data.map(item => [
|
|
|
- item.contentId,
|
|
|
+ tools.getOriginVideoId(item.contentUrl),
|
|
|
item.contentId,
|
|
|
item.contentTitle,
|
|
|
item.contentUrl,
|