//执行一个寻找黑岩任务
const CMD = {}
let hy_search_book = require('../src/api/hy/hy_search_book')
CMD.runTask = async function(data){
    // console.log("执行一个寻找黑岩任务:",data)
    let book_info = await  hy_search_book.search_id(data.book_id)
    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(typeDesc=="长篇"){
        data.genre = 1;
    }

    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;