collect_hy_book.js 696 B

12345678910111213141516171819202122232425
  1. //执行一个寻找黑岩任务
  2. const CMD = {}
  3. let hy_search_book = require('../src/api/hy/hy_search_book')
  4. CMD.runTask = async function(data){
  5. // console.log("执行一个寻找黑岩任务:",data)
  6. let book_info = await hy_search_book.search_id(data.book_id)
  7. let book_name = book_info.rows[0].name;
  8. let typeDesc = book_info.rows[0].typeDesc; //'中篇',
  9. let words = book_info.rows[0].words; //多少字
  10. if(typeDesc=="中篇"){
  11. data.genre = 2;
  12. }
  13. if(typeDesc=="长篇"){
  14. data.genre = 1;
  15. }
  16. if(typeDesc=="短篇"){
  17. data.genre = 3;
  18. }
  19. data.words = words
  20. data.book_name = book_name
  21. return data
  22. }
  23. module.exports = CMD;