mirror of
https://github.com/xiaoyiweb/YiAi.git
synced 2025-09-23 11:46:38 +08:00
1 line
6.0 KiB
JavaScript
1 line
6.0 KiB
JavaScript
'use strict';function _0x5047(){const _0x9ad1bc=['push','4361658ZNvyXJ','add','__param','function','addDrawQueue','缺少必要参数!','9AQActS','3970FOmBDB','design:paramtypes','createRandomUid','mjTimeoutMs','__decorate','MJDRAW','BAD_REQUEST','assign','100850ksHqgc','4137rypTFa','jobIds','validateBalance','4ADYewh','user','userBalanceService','MidjourneyService','decorate','mjDrawQueue','../midjourney/midjourney.service','midjourneyService','__esModule','750120jIiNAl','@nestjs/common','mjDraw','getQueue','1659603iRFXNw','UPSCALE','UserBalanceService','59052NeYEcf','../../common/utils','checkLimit','length','4yjBlYo','1089aNhbUB','@nestjs/bull','globalConfigService','HttpStatus','__metadata','getOwnPropertyDescriptor','../userBalance/userBalance.service','onApplicationBootstrap','../globalConfig/globalConfig.service','object','getConfigs','6yscyqM','IMAGINE','HttpException','defineProperty','QueueService','GlobalConfigService','metadata','clean','addMjDrawQueue'];_0x5047=function(){return _0x9ad1bc;};return _0x5047();}const _0x35b0bd=_0x50d2;(function(_0xbc50e,_0x362de4){const _0x14fa41=_0x50d2,_0x59cf17=_0xbc50e();while(!![]){try{const _0x210c37=-parseInt(_0x14fa41(0x1ed))/0x1*(-parseInt(_0x14fa41(0x204))/0x2)+parseInt(_0x14fa41(0x1fd))/0x3*(parseInt(_0x14fa41(0x1f0))/0x4)+-parseInt(_0x14fa41(0x1ec))/0x5*(parseInt(_0x14fa41(0x210))/0x6)+-parseInt(_0x14fa41(0x21a))/0x7+-parseInt(_0x14fa41(0x1f9))/0x8+parseInt(_0x14fa41(0x1e3))/0x9*(parseInt(_0x14fa41(0x1e4))/0xa)+-parseInt(_0x14fa41(0x205))/0xb*(-parseInt(_0x14fa41(0x200))/0xc);if(_0x210c37===_0x362de4)break;else _0x59cf17['push'](_0x59cf17['shift']());}catch(_0x5aa95c){_0x59cf17['push'](_0x59cf17['shift']());}}}(_0x5047,0x4c2d6));var __decorate=this&&this[_0x35b0bd(0x1e8)]||function(_0x21f0c6,_0x4b662c,_0x488000,_0x136d15){const _0x311db6=_0x35b0bd;var _0xe730cc=arguments[_0x311db6(0x203)],_0x14d5c4=_0xe730cc<0x3?_0x4b662c:_0x136d15===null?_0x136d15=Object[_0x311db6(0x20a)](_0x4b662c,_0x488000):_0x136d15,_0x5ac26c;if(typeof Reflect===_0x311db6(0x20e)&&typeof Reflect[_0x311db6(0x1f4)]===_0x311db6(0x1e0))_0x14d5c4=Reflect[_0x311db6(0x1f4)](_0x21f0c6,_0x4b662c,_0x488000,_0x136d15);else{for(var _0x2e5cc5=_0x21f0c6[_0x311db6(0x203)]-0x1;_0x2e5cc5>=0x0;_0x2e5cc5--)if(_0x5ac26c=_0x21f0c6[_0x2e5cc5])_0x14d5c4=(_0xe730cc<0x3?_0x5ac26c(_0x14d5c4):_0xe730cc>0x3?_0x5ac26c(_0x4b662c,_0x488000,_0x14d5c4):_0x5ac26c(_0x4b662c,_0x488000))||_0x14d5c4;}return _0xe730cc>0x3&&_0x14d5c4&&Object[_0x311db6(0x213)](_0x4b662c,_0x488000,_0x14d5c4),_0x14d5c4;},__metadata=this&&this[_0x35b0bd(0x209)]||function(_0x5ef6cf,_0xaa3fb2){const _0x1073df=_0x35b0bd;if(typeof Reflect===_0x1073df(0x20e)&&typeof Reflect[_0x1073df(0x216)]===_0x1073df(0x1e0))return Reflect[_0x1073df(0x216)](_0x5ef6cf,_0xaa3fb2);},__param=this&&this[_0x35b0bd(0x1df)]||function(_0x30e05f,_0x209e0b){return function(_0x173d0,_0x29999d){_0x209e0b(_0x173d0,_0x29999d,_0x30e05f);};};Object[_0x35b0bd(0x213)](exports,_0x35b0bd(0x1f8),{'value':!![]}),exports[_0x35b0bd(0x214)]=void 0x0;const common_1=require(_0x35b0bd(0x1fa)),bull_1=require(_0x35b0bd(0x206)),utils_1=require(_0x35b0bd(0x201)),midjourney_service_1=require(_0x35b0bd(0x1f6)),userBalance_service_1=require(_0x35b0bd(0x20b)),globalConfig_service_1=require(_0x35b0bd(0x20d));let QueueService=class QueueService{constructor(_0xe9ca6e,_0x370ab9,_0x2113f9,_0x386019){const _0x318995=_0x35b0bd;this['mjDrawQueue']=_0xe9ca6e,this[_0x318995(0x1f7)]=_0x370ab9,this['userBalanceService']=_0x2113f9,this[_0x318995(0x207)]=_0x386019,this[_0x318995(0x1ee)]=[];}async[_0x35b0bd(0x20c)](){const _0x5dca55=_0x35b0bd;await this['mjDrawQueue'][_0x5dca55(0x217)](0x0,'active'),await this[_0x5dca55(0x1f7)]['cleanQueue']();}async[_0x35b0bd(0x218)](_0x342e9e,_0x1a0852){const _0x386703=_0x35b0bd,{imgUrl:_0x5b83d0,orderId:_0xcd9b3f,action:_0x24699f,drawId:_0x495a86}=_0x342e9e;await this[_0x386703(0x1f7)][_0x386703(0x202)](_0x1a0852),await this[_0x386703(0x1f2)][_0x386703(0x1ef)](_0x1a0852,_0x386703(0x1fb),_0x24699f===_0x386703(0x1fe)?0x1:0x4);if(_0x24699f===_0x386703(0x211)){const _0x2b6297=''+(0x0,utils_1[_0x386703(0x1e6)])(),_0xaf6857=Object[_0x386703(0x1eb)](Object[_0x386703(0x1eb)]({},_0x342e9e),{'userId':_0x1a0852[_0x386703(0x1f1)]['id'],'randomDrawId':_0x2b6297}),_0x598fb2=await this['midjourneyService'][_0x386703(0x1e1)](_0xaf6857),_0x4f0b15=await this[_0x386703(0x207)][_0x386703(0x20f)]([_0x386703(0x1e7)])||0x30d40,_0x471a7d=await this[_0x386703(0x1f5)][_0x386703(0x1de)](_0x386703(0x1fb),{'id':_0x598fb2['id'],'action':_0x24699f,'userId':_0x1a0852[_0x386703(0x1f1)]['id']},{'delay':0x3e8,'timeout':+_0x4f0b15});return this[_0x386703(0x1ee)]['push'](_0x471a7d['id']),!![];}else{const {orderId:_0x221bd5,action:_0x12a553,drawId:_0x2dd2ed}=_0x342e9e,_0x168d22=await this['midjourneyService']['getDrawActionDetail'](_0x12a553,_0x2dd2ed,_0x221bd5),_0x3030c9=Object['assign'](Object[_0x386703(0x1eb)](Object[_0x386703(0x1eb)]({},_0x342e9e),{'userId':_0x1a0852[_0x386703(0x1f1)]['id']}),_0x168d22),_0x2e33ba=await this[_0x386703(0x1f7)][_0x386703(0x1e1)](_0x3030c9),_0x74f3ce=await this['globalConfigService'][_0x386703(0x20f)]([_0x386703(0x1e7)])||0x30d40,_0x5c5b66=await this['mjDrawQueue'][_0x386703(0x1de)](_0x386703(0x1fb),{'id':_0x2e33ba['id'],'action':_0x12a553,'userId':_0x1a0852['user']['id']},{'delay':0x3e8,'timeout':+_0x74f3ce});this[_0x386703(0x1ee)][_0x386703(0x219)](_0x5c5b66['id']);return;}if(!_0x495a86||!_0xcd9b3f)throw new common_1[(_0x386703(0x212))](_0x386703(0x1e2),common_1[_0x386703(0x208)][_0x386703(0x1ea)]);}async[_0x35b0bd(0x1fc)](){const _0x574e4f=_0x35b0bd;return{'jobIds':this[_0x574e4f(0x1ee)]};}};function _0x50d2(_0x197ded,_0x684163){const _0x504714=_0x5047();return _0x50d2=function(_0x50d2c2,_0x489759){_0x50d2c2=_0x50d2c2-0x1de;let _0x2b00ee=_0x504714[_0x50d2c2];return _0x2b00ee;},_0x50d2(_0x197ded,_0x684163);}QueueService=__decorate([__param(0x0,(0x0,bull_1['InjectQueue'])(_0x35b0bd(0x1e9))),__metadata(_0x35b0bd(0x1e5),[Object,midjourney_service_1[_0x35b0bd(0x1f3)],userBalance_service_1[_0x35b0bd(0x1ff)],globalConfig_service_1[_0x35b0bd(0x215)]])],QueueService),exports[_0x35b0bd(0x214)]=QueueService; |