YiAi/YiAiQuickDeploy/dist/modules/app/app.service.js
2024-02-06 13:43:30 +08:00

1 line
18 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';function _0x4914(_0x4d910b,_0x23e3a7){const _0x5ba008=_0x5ba0();return _0x4914=function(_0x491446,_0x5757ba){_0x491446=_0x491446-0x1c5;let _0x1ed339=_0x5ba008[_0x491446];return _0x1ed339;},_0x4914(_0x4d910b,_0x23e3a7);}const _0x42d425=_0x4914;(function(_0x404837,_0x393d9d){const _0x31a23e=_0x4914,_0x35fb43=_0x404837();while(!![]){try{const _0x12d9db=parseInt(_0x31a23e(0x1e5))/0x1*(-parseInt(_0x31a23e(0x1da))/0x2)+parseInt(_0x31a23e(0x1d3))/0x3*(-parseInt(_0x31a23e(0x1d1))/0x4)+-parseInt(_0x31a23e(0x209))/0x5+-parseInt(_0x31a23e(0x1fa))/0x6*(-parseInt(_0x31a23e(0x202))/0x7)+parseInt(_0x31a23e(0x206))/0x8*(parseInt(_0x31a23e(0x203))/0x9)+parseInt(_0x31a23e(0x21f))/0xa+parseInt(_0x31a23e(0x207))/0xb*(parseInt(_0x31a23e(0x1f8))/0xc);if(_0x12d9db===_0x393d9d)break;else _0x35fb43['push'](_0x35fb43['shift']());}catch(_0x5843ac){_0x35fb43['push'](_0x35fb43['shift']());}}}(_0x5ba0,0x57943));function _0x5ba0(){const _0x33ede0=['该应用名称已存在!','coverImg','findOne','super','106593IHvNVY','删除App成功','delApp','affected','delMineApp','@nestjs/typeorm','缺失必要参数!','AppService','createAppCat','name','appCatsList','mineApps','object','__metadata','auditFail','appEntity','split','userId','删除应用成功!','12YCihDc','appCatsEntity','30sIMNuq','typeorm','您正在操作一个不存在的资源!','******','appId','删除失败!','findAndCount','./appCats.entity','318619syYNnt','9sfJjSf','delAppCat','Not','5059888dKiZIi','5630999AUAbqY','function','2698415TAYelg','该应用不存在!','BAD_REQUEST','取消收藏失败!','该分类名称已存在!','appCount','customApp','修改成功','InjectRepository','role','user','demoData','UserAppsEntity','collect','preset','map','该分类下存在App不可删除','删除App失败','取消收藏成功!','catId','update','HttpException','2160070pzXQlR','MoreThan','des','应用审核通过','find','Repository','userAppsEntity','save','count','您正在编辑一个不存在的应用!','frontAppList','system','forEach','Like','appList','catName','decorate','DESC','112fgoaka','metadata','62463uQAOdH','修改失败!','delete','该分类不存在!','length','HttpStatus','已将应用加入到我的个人工作台!','2kTeVop','AppCatsEntity','__param','getOwnPropertyDescriptor','./userApps.entity','status','includes'];_0x5ba0=function(){return _0x33ede0;};return _0x5ba0();}var __decorate=this&&this['__decorate']||function(_0x366eba,_0x306488,_0x5bbd8c,_0x2aada9){const _0x441d0b=_0x4914;var _0x501e53=arguments[_0x441d0b(0x1d7)],_0x1ef06d=_0x501e53<0x3?_0x306488:_0x2aada9===null?_0x2aada9=Object[_0x441d0b(0x1dd)](_0x306488,_0x5bbd8c):_0x2aada9,_0x3dd0bf;if(typeof Reflect==='object'&&typeof Reflect[_0x441d0b(0x1cf)]===_0x441d0b(0x208))_0x1ef06d=Reflect['decorate'](_0x366eba,_0x306488,_0x5bbd8c,_0x2aada9);else{for(var _0x26cac5=_0x366eba[_0x441d0b(0x1d7)]-0x1;_0x26cac5>=0x0;_0x26cac5--)if(_0x3dd0bf=_0x366eba[_0x26cac5])_0x1ef06d=(_0x501e53<0x3?_0x3dd0bf(_0x1ef06d):_0x501e53>0x3?_0x3dd0bf(_0x306488,_0x5bbd8c,_0x1ef06d):_0x3dd0bf(_0x306488,_0x5bbd8c))||_0x1ef06d;}return _0x501e53>0x3&&_0x1ef06d&&Object['defineProperty'](_0x306488,_0x5bbd8c,_0x1ef06d),_0x1ef06d;},__metadata=this&&this[_0x42d425(0x1f2)]||function(_0x163482,_0x455686){const _0x48f3f6=_0x42d425;if(typeof Reflect===_0x48f3f6(0x1f1)&&typeof Reflect[_0x48f3f6(0x1d2)]===_0x48f3f6(0x208))return Reflect[_0x48f3f6(0x1d2)](_0x163482,_0x455686);},__param=this&&this[_0x42d425(0x1dc)]||function(_0x17ed5e,_0x1b1a1e){return function(_0x5ed9c4,_0x8009e){_0x1b1a1e(_0x5ed9c4,_0x8009e,_0x17ed5e);};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0x42d425(0x1ec)]=void 0x0;const common_1=require('@nestjs/common'),appCats_entity_1=require(_0x42d425(0x201)),typeorm_1=require(_0x42d425(0x1fb)),typeorm_2=require(_0x42d425(0x1ea)),app_entity_1=require('./app.entity'),userApps_entity_1=require(_0x42d425(0x1de));let AppService=class AppService{constructor(_0x58f6d1,_0x1a45a3,_0x5290b0){const _0x3be0d5=_0x42d425;this['appCatsEntity']=_0x58f6d1,this[_0x3be0d5(0x1f4)]=_0x1a45a3,this['userAppsEntity']=_0x5290b0;}async[_0x42d425(0x1ed)](_0x243df4){const _0x3246e6=_0x42d425,{name:_0x4eff43}=_0x243df4,_0x2a3969=await this['appCatsEntity']['findOne']({'where':{'name':_0x4eff43}});if(_0x2a3969)throw new common_1[(_0x3246e6(0x21e))](_0x3246e6(0x20d),common_1[_0x3246e6(0x1d8)][_0x3246e6(0x20b)]);return await this['appCatsEntity'][_0x3246e6(0x1c6)](_0x243df4);}async[_0x42d425(0x204)](_0x48f735){const _0x2b54a8=_0x42d425,{id:_0x32e09a}=_0x48f735,_0x555d8b=await this['appCatsEntity'][_0x2b54a8(0x1e3)]({'where':{'id':_0x32e09a}});if(!_0x555d8b)throw new common_1['HttpException'](_0x2b54a8(0x1d6),common_1[_0x2b54a8(0x1d8)][_0x2b54a8(0x20b)]);const _0xbea3fd=await this[_0x2b54a8(0x1f4)][_0x2b54a8(0x1c7)]({'where':{'catId':_0x32e09a}});if(_0xbea3fd>0x0)throw new common_1[(_0x2b54a8(0x21e))](_0x2b54a8(0x219),common_1[_0x2b54a8(0x1d8)][_0x2b54a8(0x20b)]);const _0x35a1b=await this[_0x2b54a8(0x1f9)]['delete'](_0x32e09a);if(_0x35a1b[_0x2b54a8(0x1e8)]>0x0)return'删除成功';throw new common_1[(_0x2b54a8(0x21e))](_0x2b54a8(0x1ff),common_1[_0x2b54a8(0x1d8)][_0x2b54a8(0x20b)]);}async['updateAppCats'](_0x8dd67b){const _0x12c876=_0x42d425,{id:_0x3d89ee,name:_0x18e0bd}=_0x8dd67b,_0x15eff5=await this[_0x12c876(0x1f9)][_0x12c876(0x1e3)]({'where':{'name':_0x18e0bd,'id':(0x0,typeorm_1[_0x12c876(0x205)])(_0x3d89ee)}});if(_0x15eff5)throw new common_1[(_0x12c876(0x21e))]('该分类名称已存在!',common_1['HttpStatus'][_0x12c876(0x20b)]);const _0x47c69f=await this['appCatsEntity'][_0x12c876(0x21d)]({'id':_0x3d89ee},_0x8dd67b);if(_0x47c69f[_0x12c876(0x1e8)]>0x0)return _0x12c876(0x210);throw new common_1[(_0x12c876(0x21e))]('修改失败!',common_1['HttpStatus']['BAD_REQUEST']);}async['queryOneCat'](_0x2b0799){const _0x476a17=_0x42d425,{id:_0x2ff02a}=_0x2b0799;if(!_0x2ff02a)throw new common_1['HttpException'](_0x476a17(0x1eb),common_1[_0x476a17(0x1d8)][_0x476a17(0x20b)]);const _0x382501=await this[_0x476a17(0x1f4)]['findOne']({'where':{'id':_0x2ff02a}}),{demoData:_0x58a09c,coverImg:_0x2fcb9a,des:_0x36d097,name:_0x2f3663}=_0x382501;return{'demoData':_0x58a09c?_0x58a09c[_0x476a17(0x1f5)]('\x0a'):[],'coverImg':_0x2fcb9a,'des':_0x36d097,'name':_0x2f3663};}async[_0x42d425(0x1ef)](_0x59878e){const _0x5ae047=_0x42d425,{page:page=0x1,size:size=0xa,name:_0x4c178c,status:_0x34a3a2}=_0x59878e,_0x1c0724={};_0x4c178c&&(_0x1c0724[_0x5ae047(0x1ee)]=(0x0,typeorm_1['Like'])('%'+_0x4c178c+'%')),[0x0,0x1,'0','1'][_0x5ae047(0x1e0)](_0x34a3a2)&&(_0x1c0724['status']=_0x34a3a2);const [_0x299023,_0x1e7971]=await this[_0x5ae047(0x1f9)][_0x5ae047(0x200)]({'where':_0x1c0724,'order':{'order':_0x5ae047(0x1d0)},'skip':(page-0x1)*size,'take':size}),_0x415005=_0x299023[_0x5ae047(0x218)](_0x2e15fc=>_0x2e15fc['id']),_0x2001e9=await this[_0x5ae047(0x1f4)][_0x5ae047(0x223)]({'where':{'catId':(0x0,typeorm_1['In'])(_0x415005)}}),_0x131f5e={};return _0x2001e9[_0x5ae047(0x1cb)](_0x333c6f=>{const _0x5bd983=_0x5ae047;_0x131f5e[_0x333c6f[_0x5bd983(0x21c)]]?_0x131f5e[_0x333c6f[_0x5bd983(0x21c)]]+=0x1:_0x131f5e[_0x333c6f[_0x5bd983(0x21c)]]=0x1;}),_0x299023[_0x5ae047(0x1cb)](_0x1b2b0f=>_0x1b2b0f[_0x5ae047(0x20e)]=_0x131f5e[_0x1b2b0f['id']]||0x0),{'rows':_0x299023,'count':_0x1e7971};}async[_0x42d425(0x1cd)](_0x136842,_0x1ad9d7,_0x23eb1e='id'){const _0x1cbe69=_0x42d425;var _0x33cf61;const {page:page=0x1,size:size=0xa,name:_0x213557,status:_0x13daea,catId:_0x4c51eb,role:_0x2d4afe}=_0x1ad9d7,_0x4bf917={};_0x213557&&(_0x4bf917[_0x1cbe69(0x1ee)]=(0x0,typeorm_1[_0x1cbe69(0x1cc)])('%'+_0x213557+'%')),_0x4c51eb&&(_0x4bf917[_0x1cbe69(0x21c)]=_0x4c51eb),_0x2d4afe&&(_0x4bf917[_0x1cbe69(0x212)]=_0x2d4afe),_0x13daea&&(_0x4bf917[_0x1cbe69(0x1df)]=_0x13daea);const [_0x12e024,_0x4b0677]=await this[_0x1cbe69(0x1f4)]['findAndCount']({'where':_0x4bf917,'order':{[_0x23eb1e]:_0x1cbe69(0x1d0)},'skip':(page-0x1)*size,'take':size}),_0x1fc260=_0x12e024[_0x1cbe69(0x218)](_0x486824=>_0x486824[_0x1cbe69(0x21c)]),_0x37bdfe=await this['appCatsEntity'][_0x1cbe69(0x223)]({'where':{'id':(0x0,typeorm_1['In'])(_0x1fc260)}});return _0x12e024[_0x1cbe69(0x1cb)](_0x111211=>{const _0x19f897=_0x1cbe69,_0x2bf6fc=_0x37bdfe[_0x19f897(0x223)](_0x54292f=>_0x54292f['id']===_0x111211[_0x19f897(0x21c)]);_0x111211[_0x19f897(0x1ce)]=_0x2bf6fc?_0x2bf6fc[_0x19f897(0x1ee)]:'';}),((_0x33cf61=_0x136842===null||_0x136842===void 0x0?void 0x0:_0x136842[_0x1cbe69(0x213)])===null||_0x33cf61===void 0x0?void 0x0:_0x33cf61['role'])!==_0x1cbe69(0x1e4)&&_0x12e024['forEach'](_0x57b888=>{const _0x41d515=_0x1cbe69;delete _0x57b888[_0x41d515(0x217)];}),{'rows':_0x12e024,'count':_0x4b0677};}async[_0x42d425(0x1c9)](_0x2064aa,_0x37b083,_0x861e13='id'){const _0x3e300c=_0x42d425;var _0x23bd51;const {page:page=0x1,size:size=0x3e8,name:_0x247221,catId:_0x4d5ad0,role:_0x15b805}=_0x37b083,_0x5cf69c=[{'status':(0x0,typeorm_1['In'])([0x1,0x4]),'userId':(0x0,typeorm_1['IsNull'])(),'public':![]},{'userId':(0x0,typeorm_1[_0x3e300c(0x220)])(0x0),'public':!![]}],[_0x342c3f,_0x48604d]=await this[_0x3e300c(0x1f4)][_0x3e300c(0x200)]({'where':_0x5cf69c,'order':{'order':_0x3e300c(0x1d0)},'skip':(page-0x1)*size,'take':size}),_0x258abe=_0x342c3f[_0x3e300c(0x218)](_0x4c4747=>_0x4c4747[_0x3e300c(0x21c)]),_0x139ad3=await this[_0x3e300c(0x1f9)]['find']({'where':{'id':(0x0,typeorm_1['In'])(_0x258abe)}});return _0x342c3f[_0x3e300c(0x1cb)](_0x34a500=>{const _0xafbfe4=_0x3e300c,_0x12d154=_0x139ad3[_0xafbfe4(0x223)](_0x14fa80=>_0x14fa80['id']===_0x34a500[_0xafbfe4(0x21c)]);_0x34a500[_0xafbfe4(0x1ce)]=_0x12d154?_0x12d154[_0xafbfe4(0x1ee)]:'';}),((_0x23bd51=_0x2064aa===null||_0x2064aa===void 0x0?void 0x0:_0x2064aa[_0x3e300c(0x213)])===null||_0x23bd51===void 0x0?void 0x0:_0x23bd51[_0x3e300c(0x212)])!==_0x3e300c(0x1e4)&&_0x342c3f[_0x3e300c(0x1cb)](_0x56e7f6=>{delete _0x56e7f6['preset'];}),{'rows':_0x342c3f,'count':_0x48604d};}async['createApp'](_0x36e33e){const _0x491200=_0x42d425,{name:_0xc9f456,catId:_0x197de8}=_0x36e33e;_0x36e33e[_0x491200(0x212)]=_0x491200(0x1ca);const _0x10bc2=await this[_0x491200(0x1f4)]['findOne']({'where':{'name':_0xc9f456}});if(_0x10bc2)throw new common_1['HttpException'](_0x491200(0x1e1),common_1[_0x491200(0x1d8)][_0x491200(0x20b)]);const _0x285d00=await this['appCatsEntity'][_0x491200(0x1e3)]({'where':{'id':_0x197de8}});if(!_0x285d00)throw new common_1['HttpException'](_0x491200(0x1d6),common_1['HttpStatus'][_0x491200(0x20b)]);return await this[_0x491200(0x1f4)][_0x491200(0x1c6)](_0x36e33e);}async[_0x42d425(0x20f)](_0x344ed4,_0x19aa09){const _0x280079=_0x42d425,{id:_0x986444}=_0x19aa09[_0x280079(0x213)],{name:_0x53be31,catId:_0x1200a9,des:_0x12b3b4,preset:_0x4a53d9,coverImg:_0x5e0427,demoData:_0x4627ce,public:_0x9e36d1,appId:_0x51ca08}=_0x344ed4;if(_0x51ca08){const _0xe06011=await this['appEntity']['findOne']({'where':{'id':_0x51ca08,'userId':_0x986444}});if(!_0xe06011)throw new common_1[(_0x280079(0x21e))](_0x280079(0x1c8),common_1[_0x280079(0x1d8)][_0x280079(0x20b)]);const _0x2251db={'name':_0x53be31,'catId':_0x1200a9,'des':_0x12b3b4,'preset':_0x4a53d9,'coverImg':_0x5e0427,'demoData':_0x4627ce,'public':_0x9e36d1,'status':_0x9e36d1?0x3:0x1},_0x2c1fb7=await this[_0x280079(0x1f4)][_0x280079(0x21d)]({'id':_0x51ca08,'userId':_0x986444},_0x2251db);if(_0x2c1fb7[_0x280079(0x1e8)])return _0x280079(0x210);else throw new common_1[(_0x280079(0x21e))](_0x280079(0x1d4),common_1[_0x280079(0x1d8)][_0x280079(0x20b)]);}if(!_0x51ca08){const _0x2e7c29=await this[_0x280079(0x1f9)][_0x280079(0x1e3)]({'where':{'id':_0x1200a9}});if(!_0x2e7c29)throw new common_1[(_0x280079(0x21e))](_0x280079(0x1d6),common_1['HttpStatus'][_0x280079(0x20b)]);const _0x58a533=await this['appEntity'][_0x280079(0x1e3)]({'where':{'name':_0x53be31}});if(_0x58a533)throw new common_1[(_0x280079(0x21e))](_0x280079(0x1e1),common_1[_0x280079(0x1d8)][_0x280079(0x20b)]);const _0x36a0e5={'name':_0x53be31,'catId':_0x1200a9,'des':_0x12b3b4,'preset':_0x4a53d9,'coverImg':_0x5e0427,'status':_0x9e36d1?0x3:0x1,'demoData':_0x4627ce,'public':_0x9e36d1,'role':'user','userId':_0x986444},_0x3ff3cd=await this[_0x280079(0x1f4)]['save'](_0x36a0e5),_0x529d2e={'appId':_0x3ff3cd['id'],'userId':_0x986444,'appType':_0x280079(0x213),'public':_0x9e36d1,'status':_0x9e36d1?0x3:0x1,'catId':_0x1200a9};return this[_0x280079(0x1c5)][_0x280079(0x1c6)](_0x529d2e);}}async['updateApp'](_0xa481b9){const _0x41211b=_0x42d425,{id:_0x3190e9,name:_0x26980d,catId:_0x3f12cb,status:_0x3583d8}=_0xa481b9,_0x58ba96=await this['appEntity'][_0x41211b(0x1e3)]({'where':{'name':_0x26980d,'id':(0x0,typeorm_1[_0x41211b(0x205)])(_0x3190e9)}});if(_0x58ba96)throw new common_1['HttpException'](_0x41211b(0x1e1),common_1['HttpStatus'][_0x41211b(0x20b)]);const _0x267fa5=await this['appCatsEntity'][_0x41211b(0x1e3)]({'where':{'id':_0x3f12cb}});if(!_0x267fa5)throw new common_1[(_0x41211b(0x21e))](_0x41211b(0x1d6),common_1['HttpStatus'][_0x41211b(0x20b)]);const _0x286624=await this[_0x41211b(0x1f4)][_0x41211b(0x1e3)]({'where':{'id':_0x3190e9}});_0x286624[_0x41211b(0x1df)]!==_0xa481b9['status']&&await this['userAppsEntity']['update']({'appId':_0x3190e9},{'status':_0x3583d8});const _0x4f5140=await this[_0x41211b(0x1f4)][_0x41211b(0x21d)]({'id':_0x3190e9},_0xa481b9);if(_0x4f5140[_0x41211b(0x1e8)]>0x0)return'修改App信息成功';throw new common_1['HttpException']('修改App信息失败',common_1[_0x41211b(0x1d8)][_0x41211b(0x20b)]);}async[_0x42d425(0x1e7)](_0x447736){const _0x3f3ab1=_0x42d425,{id:_0x457796}=_0x447736,_0x4062bb=await this[_0x3f3ab1(0x1f4)]['findOne']({'where':{'id':_0x457796}});if(!_0x4062bb)throw new common_1[(_0x3f3ab1(0x21e))](_0x3f3ab1(0x20a),common_1[_0x3f3ab1(0x1d8)][_0x3f3ab1(0x20b)]);const _0x400967=await this[_0x3f3ab1(0x1c5)][_0x3f3ab1(0x1c7)]({'where':{'appId':_0x457796}});if(_0x400967>0x0)throw new common_1['HttpException']('该应用已被用户关联使用中,不可删除!',common_1[_0x3f3ab1(0x1d8)][_0x3f3ab1(0x20b)]);const _0x4e5b6a=await this[_0x3f3ab1(0x1f4)]['delete'](_0x457796);if(_0x4e5b6a['affected']>0x0)return _0x3f3ab1(0x1e6);throw new common_1[(_0x3f3ab1(0x21e))](_0x3f3ab1(0x21a),common_1[_0x3f3ab1(0x1d8)][_0x3f3ab1(0x20b)]);}async['auditPass'](_0xc77d99){const _0x2a4f77=_0x42d425,{id:_0x5291ba}=_0xc77d99,_0x1fa0a0=await this[_0x2a4f77(0x1f4)][_0x2a4f77(0x1e3)]({'where':{'id':_0x5291ba,'status':0x3}});if(!_0x1fa0a0)throw new common_1['HttpException'](_0x2a4f77(0x20a),common_1[_0x2a4f77(0x1d8)][_0x2a4f77(0x20b)]);return await this['appEntity'][_0x2a4f77(0x21d)]({'id':_0x5291ba},{'status':0x4}),await this[_0x2a4f77(0x1c5)][_0x2a4f77(0x21d)]({'appId':_0x5291ba},{'status':0x4}),_0x2a4f77(0x222);}async[_0x42d425(0x1f3)](_0x321e79){const _0x4e7ace=_0x42d425,{id:_0x24eb53}=_0x321e79,_0x3bff95=await this[_0x4e7ace(0x1f4)][_0x4e7ace(0x1e3)]({'where':{'id':_0x24eb53,'status':0x3}});if(!_0x3bff95)throw new common_1[(_0x4e7ace(0x21e))](_0x4e7ace(0x20a),common_1[_0x4e7ace(0x1d8)][_0x4e7ace(0x20b)]);return await this[_0x4e7ace(0x1f4)]['update']({'id':_0x24eb53},{'status':0x5}),await this[_0x4e7ace(0x1c5)][_0x4e7ace(0x21d)]({'appId':_0x24eb53},{'status':0x5}),'应用审核拒绝完成';}async[_0x42d425(0x1e9)](_0xbcd40a,_0x4d3414){const _0x44b3d0=_0x42d425,{id:_0x1d8504}=_0xbcd40a,_0x245b86=await this[_0x44b3d0(0x1f4)][_0x44b3d0(0x1e3)]({'where':{'id':_0x1d8504,'userId':_0x4d3414[_0x44b3d0(0x213)]['id']}});if(!_0x245b86)throw new common_1['HttpException'](_0x44b3d0(0x1fc),common_1['HttpStatus']['BAD_REQUEST']);return await this['appEntity'][_0x44b3d0(0x1d5)](_0x1d8504),await this[_0x44b3d0(0x1c5)]['delete']({'appId':_0x1d8504,'userId':_0x4d3414[_0x44b3d0(0x213)]['id']}),_0x44b3d0(0x1f7);}async[_0x42d425(0x216)](_0x1ad3fd,_0x107088){const _0x46cd3c=_0x42d425,{appId:_0xb03ad6}=_0x1ad3fd,{id:_0x4a3d71}=_0x107088[_0x46cd3c(0x213)],_0x7b6b7f=await this['userAppsEntity']['findOne']({'where':{'appId':_0xb03ad6,'userId':_0x4a3d71}});if(_0x7b6b7f){const _0x55d533=await this[_0x46cd3c(0x1c5)][_0x46cd3c(0x1d5)]({'appId':_0xb03ad6,'userId':_0x4a3d71});if(_0x55d533[_0x46cd3c(0x1e8)]>0x0)return _0x46cd3c(0x21b);else throw new common_1['HttpException'](_0x46cd3c(0x20c),common_1['HttpStatus']['BAD_REQUEST']);}const _0x1d6cb0=await this[_0x46cd3c(0x1f4)]['findOne']({'where':{'id':_0xb03ad6}}),{id:_0x5823ff,role:_0x8b3db1,catId:_0x5bfa12}=_0x1d6cb0,_0x32da36={'userId':_0x4a3d71,'appId':_0x5823ff,'catId':_0x5bfa12,'appRole':_0x8b3db1,'public':!![],'status':0x1};return await this[_0x46cd3c(0x1c5)]['save'](_0x32da36),_0x46cd3c(0x1d9);}async[_0x42d425(0x1f0)](_0x2858d9,_0x4fdf75={'page':0x1,'size':0x1e}){const _0x494b36=_0x42d425,{id:_0x10dff3}=_0x2858d9[_0x494b36(0x213)],{page:page=0x1,size:size=0x1e}=_0x4fdf75,[_0x4806f1,_0x5cbc3e]=await this[_0x494b36(0x1c5)][_0x494b36(0x200)]({'where':{'userId':_0x10dff3,'status':(0x0,typeorm_1['In'])([0x1,0x3,0x4,0x5])},'order':{'id':'DESC'},'skip':(page-0x1)*size,'take':size}),_0x3172a4=_0x4806f1[_0x494b36(0x218)](_0x5108b4=>_0x5108b4[_0x494b36(0x1fe)]),_0x34ab4e=await this[_0x494b36(0x1f4)][_0x494b36(0x223)]({'where':{'id':(0x0,typeorm_1['In'])(_0x3172a4)}});return _0x4806f1[_0x494b36(0x1cb)](_0x2b428a=>{const _0x45a28b=_0x494b36,_0x42aa9d=_0x34ab4e[_0x45a28b(0x223)](_0x3e7ce1=>_0x3e7ce1['id']===_0x2b428a['appId']);_0x2b428a['appName']=_0x42aa9d?_0x42aa9d[_0x45a28b(0x1ee)]:'',_0x2b428a['appRole']=_0x42aa9d?_0x42aa9d['role']:'',_0x2b428a['appDes']=_0x42aa9d?_0x42aa9d[_0x45a28b(0x221)]:'',_0x2b428a[_0x45a28b(0x1e2)]=_0x42aa9d?_0x42aa9d[_0x45a28b(0x1e2)]:'',_0x2b428a[_0x45a28b(0x214)]=_0x42aa9d?_0x42aa9d[_0x45a28b(0x214)]:'',_0x2b428a[_0x45a28b(0x217)]=_0x42aa9d[_0x45a28b(0x1f6)]===_0x10dff3?_0x42aa9d['preset']:_0x45a28b(0x1fd);}),{'rows':_0x4806f1,'count':_0x5cbc3e};}};AppService=__decorate([(0x0,common_1['Injectable'])(),__param(0x0,(0x0,typeorm_2['InjectRepository'])(appCats_entity_1[_0x42d425(0x1db)])),__param(0x1,(0x0,typeorm_2[_0x42d425(0x211)])(app_entity_1['AppEntity'])),__param(0x2,(0x0,typeorm_2[_0x42d425(0x211)])(userApps_entity_1[_0x42d425(0x215)])),__metadata('design:paramtypes',[typeorm_1['Repository'],typeorm_1[_0x42d425(0x224)],typeorm_1[_0x42d425(0x224)]])],AppService),exports[_0x42d425(0x1ec)]=AppService;