collect_hy_book.js 811 B

1234567891011121314151617181920212223242526272829
  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. data.genre = 0
  11. if(typeDesc=="中篇"){
  12. data.genre = 2;
  13. }
  14. if(typeDesc=="长篇"){
  15. data.genre = 1;
  16. }
  17. if(typeDesc=="短篇"){
  18. data.genre = 3;
  19. }
  20. if(data.genre==0){
  21. console.log("获取黑岩书籍信息错误:",book_info)
  22. }
  23. data.words = words
  24. data.book_name = book_name
  25. return data
  26. }
  27. module.exports = CMD;