//执行一个寻找黑岩任务
const CMD = {}
let hy_search_book = require('../api/hy/hy_search_book')
CMD.runTask = function(data,call_back){
    // console.log("执行一个寻找黑岩任务:",data)
    hy_search_book.search_id(data.book_id,(book_info)=>{
        // console.log("黑岩:",book_info)
        let book_name = book_info.rows[0].name;
        let typeDesc = book_info.rows[0].typeDesc; //'中篇',
        let words = book_info.rows[0].words;  //多少字
        if(typeDesc=="中篇"){
            data.genre = 2;
        }
        if(typeDesc=="长篇"){
            data.genre = 1;
        }

        if(typeDesc=="短篇"){
            data.genre = 3;
        }
        data.words = words
        data.book_name = book_name
        call_back(data)
    })
}

module.exports = CMD;