mirror of
https://github.com/xiaoyiweb/YiAi.git
synced 2025-09-26 13:16:39 +08:00
1 line
5.8 KiB
JavaScript
1 line
5.8 KiB
JavaScript
'use strict';const _0x5e462f=_0x1cab;(function(_0x2db3c8,_0x284a21){const _0x4ce8cb=_0x1cab,_0x7ba626=_0x2db3c8();while(!![]){try{const _0x5e327d=-parseInt(_0x4ce8cb(0x80))/0x1+parseInt(_0x4ce8cb(0x98))/0x2*(-parseInt(_0x4ce8cb(0xb1))/0x3)+-parseInt(_0x4ce8cb(0x77))/0x4+parseInt(_0x4ce8cb(0x84))/0x5*(-parseInt(_0x4ce8cb(0x9a))/0x6)+-parseInt(_0x4ce8cb(0x7f))/0x7*(-parseInt(_0x4ce8cb(0x7b))/0x8)+parseInt(_0x4ce8cb(0x94))/0x9*(-parseInt(_0x4ce8cb(0xb0))/0xa)+parseInt(_0x4ce8cb(0xa0))/0xb*(parseInt(_0x4ce8cb(0xac))/0xc);if(_0x5e327d===_0x284a21)break;else _0x7ba626['push'](_0x7ba626['shift']());}catch(_0x4cc7ed){_0x7ba626['push'](_0x7ba626['shift']());}}}(_0xf5ef,0x2537e));function _0x1cab(_0x3cf48d,_0x60d3f6){const _0xf5ef91=_0xf5ef();return _0x1cab=function(_0x1cab04,_0x322887){_0x1cab04=_0x1cab04-0x77;let _0x551e00=_0xf5ef91[_0x1cab04];return _0x551e00;},_0x1cab(_0x3cf48d,_0x60d3f6);}var __decorate=this&&this[_0x5e462f(0x78)]||function(_0x46f7a4,_0x471ac6,_0x4419c8,_0x568fc9){const _0xe8ee3f=_0x5e462f;var _0x4c18d6=arguments[_0xe8ee3f(0x90)],_0x4430ed=_0x4c18d6<0x3?_0x471ac6:_0x568fc9===null?_0x568fc9=Object[_0xe8ee3f(0xa8)](_0x471ac6,_0x4419c8):_0x568fc9,_0x12209d;if(typeof Reflect===_0xe8ee3f(0xab)&&typeof Reflect['decorate']==='function')_0x4430ed=Reflect[_0xe8ee3f(0x9d)](_0x46f7a4,_0x471ac6,_0x4419c8,_0x568fc9);else{for(var _0x165b05=_0x46f7a4[_0xe8ee3f(0x90)]-0x1;_0x165b05>=0x0;_0x165b05--)if(_0x12209d=_0x46f7a4[_0x165b05])_0x4430ed=(_0x4c18d6<0x3?_0x12209d(_0x4430ed):_0x4c18d6>0x3?_0x12209d(_0x471ac6,_0x4419c8,_0x4430ed):_0x12209d(_0x471ac6,_0x4419c8))||_0x4430ed;}return _0x4c18d6>0x3&&_0x4430ed&&Object[_0xe8ee3f(0x99)](_0x471ac6,_0x4419c8,_0x4430ed),_0x4430ed;},__metadata=this&&this[_0x5e462f(0x97)]||function(_0x2862fa,_0x26ef3b){const _0x277a33=_0x5e462f;if(typeof Reflect===_0x277a33(0xab)&&typeof Reflect[_0x277a33(0x87)]===_0x277a33(0xa7))return Reflect[_0x277a33(0x87)](_0x2862fa,_0x26ef3b);},__param=this&&this['__param']||function(_0x1044c6,_0x379758){return function(_0x308e0b,_0x23cc15){_0x379758(_0x308e0b,_0x23cc15,_0x1044c6);};};Object['defineProperty'](exports,_0x5e462f(0x85),{'value':!![]}),exports[_0x5e462f(0x93)]=void 0x0;const common_1=require(_0x5e462f(0x7e)),bull_1=require(_0x5e462f(0xa4)),utils_1=require(_0x5e462f(0xa5)),midjourney_service_1=require(_0x5e462f(0x9f)),userBalance_service_1=require('../userBalance/userBalance.service'),globalConfig_service_1=require(_0x5e462f(0x8b));let QueueService=class QueueService{constructor(_0x25b6a2,_0x4146a7,_0x1f9cc7,_0x1e86e3){const _0x2f7a22=_0x5e462f;this[_0x2f7a22(0xa1)]=_0x25b6a2,this[_0x2f7a22(0x83)]=_0x4146a7,this[_0x2f7a22(0x89)]=_0x1f9cc7,this[_0x2f7a22(0xb2)]=_0x1e86e3,this[_0x2f7a22(0xa3)]=[];}async[_0x5e462f(0x8c)](){const _0x406a6b=_0x5e462f;await this[_0x406a6b(0xa1)][_0x406a6b(0x8d)](0x0,_0x406a6b(0x88)),await this[_0x406a6b(0x83)][_0x406a6b(0x81)]();}async[_0x5e462f(0x9b)](_0x333884,_0x3f2112){const _0xeeb077=_0x5e462f,{imgUrl:_0x1cb6ea,orderId:_0x3dc03f,action:_0x56dd9c,drawId:_0x38541e}=_0x333884;await this[_0xeeb077(0x83)][_0xeeb077(0x92)](_0x3f2112),await this['userBalanceService'][_0xeeb077(0xae)](_0x3f2112,_0xeeb077(0x7c),_0x56dd9c===_0xeeb077(0xaf)?0x1:0x4);if(_0x56dd9c===_0xeeb077(0xa9)){const _0x5c7b69=''+(0x0,utils_1[_0xeeb077(0x8f)])(),_0x3ea577=Object['assign'](Object['assign']({},_0x333884),{'userId':_0x3f2112['user']['id'],'randomDrawId':_0x5c7b69}),_0x286aa8=await this[_0xeeb077(0x83)][_0xeeb077(0x8e)](_0x3ea577),_0x200a43=await this[_0xeeb077(0xb2)][_0xeeb077(0x91)](['mjTimeoutMs'])||0x30d40,_0x2c21e0=await this[_0xeeb077(0xa1)]['add'](_0xeeb077(0x7c),{'id':_0x286aa8['id'],'action':_0x56dd9c,'userId':_0x3f2112[_0xeeb077(0x82)]['id']},{'delay':0x3e8,'timeout':+_0x200a43});return this['jobIds'][_0xeeb077(0x7d)](_0x2c21e0['id']),!![];}else{const {orderId:_0x21c585,action:_0x38cb49,drawId:_0x564aa7}=_0x333884,_0x223a7c=await this[_0xeeb077(0x83)]['getDrawActionDetail'](_0x38cb49,_0x564aa7,_0x21c585),_0x5793a1=Object[_0xeeb077(0x9c)](Object['assign'](Object[_0xeeb077(0x9c)]({},_0x333884),{'userId':_0x3f2112[_0xeeb077(0x82)]['id']}),_0x223a7c),_0x5f26a3=await this[_0xeeb077(0x83)][_0xeeb077(0x8e)](_0x5793a1),_0x42e5e7=await this[_0xeeb077(0xb2)][_0xeeb077(0x91)]([_0xeeb077(0x7a)])||0x30d40,_0x37cbf1=await this[_0xeeb077(0xa1)][_0xeeb077(0x95)](_0xeeb077(0x7c),{'id':_0x5f26a3['id'],'action':_0x38cb49,'userId':_0x3f2112[_0xeeb077(0x82)]['id']},{'delay':0x3e8,'timeout':+_0x42e5e7});this[_0xeeb077(0xa3)][_0xeeb077(0x7d)](_0x37cbf1['id']);return;}if(!_0x38541e||!_0x3dc03f)throw new common_1[(_0xeeb077(0x96))](_0xeeb077(0x8a),common_1[_0xeeb077(0x79)]['BAD_REQUEST']);}async['getQueue'](){return{'jobIds':this['jobIds']};}};function _0xf5ef(){const _0x3b79f1=['1857rDttJn','globalConfigService','799636LXHTOk','__decorate','HttpStatus','mjTimeoutMs','120ptPGPk','mjDraw','push','@nestjs/common','126322fVoqOP','269456uGemwL','cleanQueue','user','midjourneyService','5leONVc','__esModule','InjectQueue','metadata','active','userBalanceService','缺少必要参数!','../globalConfig/globalConfig.service','onApplicationBootstrap','clean','addDrawQueue','createRandomUid','length','getConfigs','checkLimit','QueueService','25587lLVvTc','add','HttpException','__metadata','942BUxjnR','defineProperty','84450ZeFqFM','addMjDrawQueue','assign','decorate','design:paramtypes','../midjourney/midjourney.service','1016389feBIGs','mjDrawQueue','MJDRAW','jobIds','@nestjs/bull','../../common/utils','UserBalanceService','function','getOwnPropertyDescriptor','IMAGINE','MidjourneyService','object','96ZufomM','GlobalConfigService','validateBalance','UPSCALE','290yMkQDt'];_0xf5ef=function(){return _0x3b79f1;};return _0xf5ef();}QueueService=__decorate([__param(0x0,(0x0,bull_1[_0x5e462f(0x86)])(_0x5e462f(0xa2))),__metadata(_0x5e462f(0x9e),[Object,midjourney_service_1[_0x5e462f(0xaa)],userBalance_service_1[_0x5e462f(0xa6)],globalConfig_service_1[_0x5e462f(0xad)]])],QueueService),exports[_0x5e462f(0x93)]=QueueService; |