123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- setInterval(() => {
- }, 15000);
- const ProcessManager = require('./ProcessManager');
- const helper = require('./src/helper');
- const HttpClient = require('./src/HttpClient');
- const redis_help = require('./src/use_redis');
- const tools = require('./tools');
- // function getPlatformInfoByI(PlatformConfig,tg_platform_id){
- // for (let index = 0; index < PlatformConfig.length; index++) {
- // const element = PlatformConfig[index];
- // if(element.tg_platform_id==tg_platform_id){
- // return element
- // }
- // }
- // return null
- // }
- // function getMainInfoById(MainConfig,main_id){
- // // console.log("MainConfig:",MainConfig)
- // for (let index = 0; index < MainConfig.length; index++) {
- // const element = MainConfig[index];
- // if(element.id==main_id){
- // return element
- // }
- // }
- // return null
- // }
- let isInit = false
- redis_help.connect( async (results)=>{
- if(results){
- if(isInit){
- return
- }
- isInit = true
- // main()
- }
- })
- // let response = helper.resolveDomain("clipvideoup.s6kuwan.com")
- // console.log("response:",response)
- // let MainConfig = await redis_help.getKeyValue("MainConfig")
- // MainConfig = JSON.parse(MainConfig)
- // let PlatformConfig = await redis_help.getKeyValue("PlatformConfig")
- // PlatformConfig = JSON.parse(PlatformConfig)
- // let PlatformInfo = getPlatformInfoByI(PlatformConfig,4)
- // let main_info = getMainInfoById(MainConfig,150)
- // let data = {
- // product_id:"11010288676",
- // product_name:"侍女有谋"
- // }
-
- // require("./5_CREATE_LINK_FACTORY/dz_create_link").runTask(data,main_info,PlatformInfo,()=>{
- // })
- // let data = await require('./src/api/dz/dz_search_book').search_id('11010288676')
- // console.log("data:",data)
- // require('./src/api/qm/qm_search_book').search_id('396740')
- // console.log("results:",await redis_help.getKeyValue("isPauseTask"))
- // let MainConfig = await redis_help.getKeyValue("MainConfig")
- // MainConfig = JSON.parse(MainConfig)
- // let PlatformConfig = await redis_help.getKeyValue("PlatformConfig")
- // PlatformConfig = JSON.parse(PlatformConfig)
- // let PlatformInfo = getPlatformInfoByI(PlatformConfig,3)
- // let main_info = getMainInfoById(MainConfig,151)
- // let data = {
- // product_id:"393425",
- // product_name:"转学生自称苗疆圣子,可我才是真圣子"
- // }
-
- // let {promotion_name} = await require("./5_CREATE_LINK_FACTORY/qm_create_link").runTask(data,main_info,PlatformInfo,()=>{
- // })
- // console.log("promotion_name:",promotion_name)
- // let n_data = await require("./src/api/qm/get_qm_promotion").getPromotionList(promotion_name)
- // console.log("get_qm_promotion:",n_data)
- // let get_hy_group_mapping = require('./src/api/hy/get_hy_group_mapping');
- // get_hy_group_mapping.get_group_mapping((data)=>{
- // if(data.code==200){
- // let list = data.data
- // }
- // console.log("get_hy_group_mapping:",data)
- // })
- // setTimeout( async ()=>{
- // let black_books = await redis_help.getKeyValue("all_black_books")
- // console.log("black_books:",black_books)
- // },5000)
- // let main = async function(){
- // let test = new HttpClient()
- // const postData = {
- // cmd:"create_link",
- // name:"台风夜老婆去救男秘书",
- // bookId:"1848991033902665730",
- // topUpTemplateId:"1854833762266247169",
- // passBackTemplateId:"6",
- // paidPoint:"9999999",
- // token:await tools.getHyToken()
- // };
- // let data = {
- // "name": postData.name,
- // "bookId": postData.bookId,
- // "passBackTemplateId": postData.passBackTemplateId,
- // "adPassbackTemplateId": "",
- // "topUpTemplateId": postData.topUpTemplateId,
- // "mediaChannel": "1",
- // "group": "35",
- // "paidPoint": postData.paidPoint,
- // "site": "5"
- // }
- // let res = await test.otherPost( helper.getHyCreateLinkOpt(postData.token) ,data)
- // console.log("res:",res)
- // let response = {
- // "message": "create_link successfully",
- // "received_data":{"originalId":res["data"]["originalId"],
- // "appId":res["data"]["appId"],
- // "launchPath":res["data"]["launchPath"],
- // "fullPath":res["data"]["fullPath"],
- // "wxMountLink":res["data"]["wxMountLink"]}
- // }
- // console.log("response:",response)
- // }
- // var main = function(){
- // require("./2_PRODUCT_FACTORY/PRODUCT_FACTORY")
- // require("./5_CREATE_LINK_FACTORY/CREATE_LINK_FACTORY")
- // require("./MAIN_SERVE_FACTORY/MAIN_SERVE_FACTORY")
- // require("./0_RECEIVE_FACTORY/RECEIVE_FACTORY")
- // require("./1_FILTER_FACTORY/FILTER_FACTORY")
- // }
- // let main = function(){
- // let manager = new ProcessManager()
- // manager.start()
- // manager.workers.forEach((v,k)=>{
- // if (v.process) {
- // v.process.send({
- // type: 'config',
- // data: { /* 配置数据 */ }
- // });
- // }
- // })
- // }
|