//执行一个寻找黑岩任务 const CMD = {} const { head } = require('request') let hy_search_book = require('../src/api/hy/hy_search_book') const helper = require('../src/helper') CMD.runTask = async function(data){ // console.log("执行一个寻找黑岩任务:",data) let book_info = await hy_search_book.search_id(data.book_id) if(book_info==undefined||book_info==null){ return null } if(book_info.rows==null||book_info.rows==undefined){ return null } if(book_info.rows.length<=0){ return null } let book_name = book_info.rows[0].name; let typeDesc = book_info.rows[0].typeDesc; //'中篇', let words = book_info.rows[0].words; //多少字 data.genre = 0 // if(typeDesc=="中篇"){ // data.genre = 2; // } if(words>100000){ data.genre = 1; }else{ data.genre = 3; } data.is_c500 = false if(helper.checkChannel(book_name,'C500')||helper.checkChannel(book_name,'C400')){ //番茄免费短篇 data.is_c500 = true data.genre = 3; } // if(typeDesc=="长篇"){ // data.genre = 1; // }else{ // data.genre = 3; // } // if(typeDesc=="短篇"){ // data.genre = 3; // } if(data.genre==0){ console.log("获取黑岩书籍信息错误:",book_info) } data.words = words data.book_name = book_name return data } module.exports = CMD;