YiAi/YiAiQuickDeploy/dist/modules/app/app.service.js
2024-02-05 23:18:50 +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';const _0x323e2f=_0x47d1;(function(_0x2792fd,_0x2bb984){const _0xe18023=_0x47d1,_0x54640c=_0x2792fd();while(!![]){try{const _0x1d0c65=-parseInt(_0xe18023(0x1d5))/0x1+parseInt(_0xe18023(0x1de))/0x2+-parseInt(_0xe18023(0x1b2))/0x3*(-parseInt(_0xe18023(0x1ae))/0x4)+-parseInt(_0xe18023(0x1b6))/0x5*(parseInt(_0xe18023(0x1b0))/0x6)+-parseInt(_0xe18023(0x1a4))/0x7*(-parseInt(_0xe18023(0x1cc))/0x8)+parseInt(_0xe18023(0x1d9))/0x9*(-parseInt(_0xe18023(0x1d4))/0xa)+-parseInt(_0xe18023(0x192))/0xb;if(_0x1d0c65===_0x2bb984)break;else _0x54640c['push'](_0x54640c['shift']());}catch(_0x1b376d){_0x54640c['push'](_0x54640c['shift']());}}}(_0x1587,0xab8bd));var __decorate=this&&this[_0x323e2f(0x1ea)]||function(_0x25c53f,_0x59e61e,_0x49f783,_0xe004b4){const _0x5606a6=_0x323e2f;var _0x2761d6=arguments[_0x5606a6(0x1bd)],_0x578a3a=_0x2761d6<0x3?_0x59e61e:_0xe004b4===null?_0xe004b4=Object[_0x5606a6(0x1c6)](_0x59e61e,_0x49f783):_0xe004b4,_0x2e4b0d;if(typeof Reflect===_0x5606a6(0x1e5)&&typeof Reflect[_0x5606a6(0x193)]===_0x5606a6(0x1c3))_0x578a3a=Reflect[_0x5606a6(0x193)](_0x25c53f,_0x59e61e,_0x49f783,_0xe004b4);else{for(var _0xa8cbb6=_0x25c53f[_0x5606a6(0x1bd)]-0x1;_0xa8cbb6>=0x0;_0xa8cbb6--)if(_0x2e4b0d=_0x25c53f[_0xa8cbb6])_0x578a3a=(_0x2761d6<0x3?_0x2e4b0d(_0x578a3a):_0x2761d6>0x3?_0x2e4b0d(_0x59e61e,_0x49f783,_0x578a3a):_0x2e4b0d(_0x59e61e,_0x49f783))||_0x578a3a;}return _0x2761d6>0x3&&_0x578a3a&&Object[_0x5606a6(0x1c5)](_0x59e61e,_0x49f783,_0x578a3a),_0x578a3a;},__metadata=this&&this[_0x323e2f(0x1e0)]||function(_0x135e6c,_0x5a0bdf){const _0xb46307=_0x323e2f;if(typeof Reflect==='object'&&typeof Reflect[_0xb46307(0x19c)]===_0xb46307(0x1c3))return Reflect['metadata'](_0x135e6c,_0x5a0bdf);},__param=this&&this[_0x323e2f(0x1a1)]||function(_0x124569,_0x580e34){return function(_0x28db80,_0x15c86c){_0x580e34(_0x28db80,_0x15c86c,_0x124569);};};function _0x1587(){const _0x5cf768=['该应用已被用户关联使用中,不可删除!','userId','2047954khhdXj','delMineApp','__metadata','preset','AppEntity','auditPass','catId','object','该分类名称已存在!','appCatsEntity','updateApp','split','__decorate','design:paramtypes','删除应用成功!','customApp','@nestjs/typeorm','修改App信息失败','super','HttpException','修改App信息成功','findOne','5740823YuDokh','decorate','InjectRepository','该分类不存在!','appEntity','./userApps.entity','该分类下存在App不可删除','IsNull','DESC','catName','metadata','affected','queryOneCat','userAppsEntity','该应用不存在!','__param','Not','******','469zjIMtX','appCatsList','createApp','BAD_REQUEST','Injectable','findAndCount','user','appRole','mineApps','name','392PTNGBh','createAppCat','54JXVUiI','des','23658eNfadj','save','typeorm','应用审核通过','620515OdIEhH','coverImg','find','Repository','delApp','@nestjs/common','./app.entity','length','appId','count','status','AppService','role','function','取消收藏成功!','defineProperty','getOwnPropertyDescriptor','已将应用加入到我的个人工作台!','forEach','appCount','system','修改失败!','142768yRRzVF','includes','修改成功','HttpStatus','Like','应用审核拒绝完成','delete','collect','590cSbFNt','294477gmYNDr','map','__esModule','删除App失败','54387cquqXl','update','该应用名称已存在!'];_0x1587=function(){return _0x5cf768;};return _0x1587();}function _0x47d1(_0x381bbb,_0x427b33){const _0x158710=_0x1587();return _0x47d1=function(_0x47d18e,_0x17718c){_0x47d18e=_0x47d18e-0x18e;let _0x5e4180=_0x158710[_0x47d18e];return _0x5e4180;},_0x47d1(_0x381bbb,_0x427b33);}Object['defineProperty'](exports,_0x323e2f(0x1d7),{'value':!![]}),exports[_0x323e2f(0x1c1)]=void 0x0;const common_1=require(_0x323e2f(0x1bb)),appCats_entity_1=require('./appCats.entity'),typeorm_1=require(_0x323e2f(0x1b4)),typeorm_2=require(_0x323e2f(0x1ee)),app_entity_1=require(_0x323e2f(0x1bc)),userApps_entity_1=require(_0x323e2f(0x197));let AppService=class AppService{constructor(_0x181e7a,_0xb6b460,_0x552ee5){const _0x5b1320=_0x323e2f;this[_0x5b1320(0x1e7)]=_0x181e7a,this[_0x5b1320(0x196)]=_0xb6b460,this[_0x5b1320(0x19f)]=_0x552ee5;}async[_0x323e2f(0x1af)](_0x5a499a){const _0x53c2a8=_0x323e2f,{name:_0x1c8f6b}=_0x5a499a,_0x5f45c6=await this[_0x53c2a8(0x1e7)][_0x53c2a8(0x191)]({'where':{'name':_0x1c8f6b}});if(_0x5f45c6)throw new common_1[(_0x53c2a8(0x18f))](_0x53c2a8(0x1e6),common_1[_0x53c2a8(0x1cf)][_0x53c2a8(0x1a7)]);return await this[_0x53c2a8(0x1e7)][_0x53c2a8(0x1b3)](_0x5a499a);}async['delAppCat'](_0x270aa1){const _0x1bd135=_0x323e2f,{id:_0x5894bb}=_0x270aa1,_0x5505ff=await this[_0x1bd135(0x1e7)]['findOne']({'where':{'id':_0x5894bb}});if(!_0x5505ff)throw new common_1[(_0x1bd135(0x18f))](_0x1bd135(0x195),common_1[_0x1bd135(0x1cf)][_0x1bd135(0x1a7)]);const _0x1f0835=await this['appEntity'][_0x1bd135(0x1bf)]({'where':{'catId':_0x5894bb}});if(_0x1f0835>0x0)throw new common_1[(_0x1bd135(0x18f))](_0x1bd135(0x198),common_1[_0x1bd135(0x1cf)][_0x1bd135(0x1a7)]);const _0xc32eb2=await this[_0x1bd135(0x1e7)][_0x1bd135(0x1d2)](_0x5894bb);if(_0xc32eb2[_0x1bd135(0x19d)]>0x0)return'删除成功';throw new common_1[(_0x1bd135(0x18f))]('删除失败!',common_1['HttpStatus'][_0x1bd135(0x1a7)]);}async['updateAppCats'](_0x29e0c5){const _0x490742=_0x323e2f,{id:_0x5c8bdd,name:_0x5027b7}=_0x29e0c5,_0x464aa3=await this[_0x490742(0x1e7)][_0x490742(0x191)]({'where':{'name':_0x5027b7,'id':(0x0,typeorm_1[_0x490742(0x1a2)])(_0x5c8bdd)}});if(_0x464aa3)throw new common_1[(_0x490742(0x18f))](_0x490742(0x1e6),common_1[_0x490742(0x1cf)][_0x490742(0x1a7)]);const _0x364ff3=await this[_0x490742(0x1e7)]['update']({'id':_0x5c8bdd},_0x29e0c5);if(_0x364ff3[_0x490742(0x19d)]>0x0)return _0x490742(0x1ce);throw new common_1[(_0x490742(0x18f))](_0x490742(0x1cb),common_1['HttpStatus'][_0x490742(0x1a7)]);}async[_0x323e2f(0x19e)](_0x2f16e8){const _0x3e8514=_0x323e2f,{id:_0x243574}=_0x2f16e8;if(!_0x243574)throw new common_1['HttpException']('缺失必要参数!',common_1[_0x3e8514(0x1cf)][_0x3e8514(0x1a7)]);const _0x17c5d5=await this[_0x3e8514(0x196)][_0x3e8514(0x191)]({'where':{'id':_0x243574}}),{demoData:_0x4586ef,coverImg:_0x22d88d,des:_0x1773e1,name:_0x219a87}=_0x17c5d5;return{'demoData':_0x4586ef?_0x4586ef[_0x3e8514(0x1e9)]('\x0a'):[],'coverImg':_0x22d88d,'des':_0x1773e1,'name':_0x219a87};}async[_0x323e2f(0x1a5)](_0x432131){const _0x1f759c=_0x323e2f,{page:page=0x1,size:size=0xa,name:_0x5e5951,status:_0x2ce6f2}=_0x432131,_0x4855aa={};_0x5e5951&&(_0x4855aa['name']=(0x0,typeorm_1[_0x1f759c(0x1d0)])('%'+_0x5e5951+'%')),[0x0,0x1,'0','1'][_0x1f759c(0x1cd)](_0x2ce6f2)&&(_0x4855aa[_0x1f759c(0x1c0)]=_0x2ce6f2);const [_0xfafc9,_0x115217]=await this[_0x1f759c(0x1e7)][_0x1f759c(0x1a9)]({'where':_0x4855aa,'order':{'order':_0x1f759c(0x19a)},'skip':(page-0x1)*size,'take':size}),_0x4bc253=_0xfafc9[_0x1f759c(0x1d6)](_0xa99be3=>_0xa99be3['id']),_0x326452=await this[_0x1f759c(0x196)][_0x1f759c(0x1b8)]({'where':{'catId':(0x0,typeorm_1['In'])(_0x4bc253)}}),_0x51ddb4={};return _0x326452[_0x1f759c(0x1c8)](_0x3933d7=>{const _0x497fa1=_0x1f759c;_0x51ddb4[_0x3933d7['catId']]?_0x51ddb4[_0x3933d7[_0x497fa1(0x1e4)]]+=0x1:_0x51ddb4[_0x3933d7[_0x497fa1(0x1e4)]]=0x1;}),_0xfafc9['forEach'](_0x58cdb1=>_0x58cdb1[_0x1f759c(0x1c9)]=_0x51ddb4[_0x58cdb1['id']]||0x0),{'rows':_0xfafc9,'count':_0x115217};}async['appList'](_0x29d723,_0x244862,_0x47e6f4='id'){const _0x404ea0=_0x323e2f;var _0x34be7a;const {page:page=0x1,size:size=0xa,name:_0x3599c9,status:_0x139d3e,catId:_0xa0f08c,role:_0xee2ba0}=_0x244862,_0x2eeb65={};_0x3599c9&&(_0x2eeb65[_0x404ea0(0x1ad)]=(0x0,typeorm_1[_0x404ea0(0x1d0)])('%'+_0x3599c9+'%')),_0xa0f08c&&(_0x2eeb65[_0x404ea0(0x1e4)]=_0xa0f08c),_0xee2ba0&&(_0x2eeb65['role']=_0xee2ba0),_0x139d3e&&(_0x2eeb65[_0x404ea0(0x1c0)]=_0x139d3e);const [_0x175243,_0x11a73f]=await this['appEntity']['findAndCount']({'where':_0x2eeb65,'order':{[_0x47e6f4]:_0x404ea0(0x19a)},'skip':(page-0x1)*size,'take':size}),_0x4ae397=_0x175243[_0x404ea0(0x1d6)](_0x548b11=>_0x548b11['catId']),_0x150337=await this[_0x404ea0(0x1e7)][_0x404ea0(0x1b8)]({'where':{'id':(0x0,typeorm_1['In'])(_0x4ae397)}});return _0x175243[_0x404ea0(0x1c8)](_0x3563d7=>{const _0x212148=_0x404ea0,_0x1cd4b7=_0x150337[_0x212148(0x1b8)](_0x3a9fcc=>_0x3a9fcc['id']===_0x3563d7['catId']);_0x3563d7[_0x212148(0x19b)]=_0x1cd4b7?_0x1cd4b7[_0x212148(0x1ad)]:'';}),((_0x34be7a=_0x29d723===null||_0x29d723===void 0x0?void 0x0:_0x29d723[_0x404ea0(0x1aa)])===null||_0x34be7a===void 0x0?void 0x0:_0x34be7a[_0x404ea0(0x1c2)])!==_0x404ea0(0x18e)&&_0x175243[_0x404ea0(0x1c8)](_0x1ebbe5=>{const _0x3b1c6a=_0x404ea0;delete _0x1ebbe5[_0x3b1c6a(0x1e1)];}),{'rows':_0x175243,'count':_0x11a73f};}async['frontAppList'](_0x384947,_0x4cec8a,_0x2c5353='id'){const _0x8a7436=_0x323e2f;var _0x3b8eea;const {page:page=0x1,size:size=0x3e8,name:_0x248934,catId:_0x5465df,role:_0x4312a8}=_0x4cec8a,_0x23c24b=[{'status':(0x0,typeorm_1['In'])([0x1,0x4]),'userId':(0x0,typeorm_1[_0x8a7436(0x199)])(),'public':![]},{'userId':(0x0,typeorm_1['MoreThan'])(0x0),'public':!![]}],[_0x4ffa4b,_0x72ecc7]=await this[_0x8a7436(0x196)][_0x8a7436(0x1a9)]({'where':_0x23c24b,'order':{'order':'DESC'},'skip':(page-0x1)*size,'take':size}),_0x3044f7=_0x4ffa4b['map'](_0x3344e8=>_0x3344e8[_0x8a7436(0x1e4)]),_0x445ce5=await this[_0x8a7436(0x1e7)][_0x8a7436(0x1b8)]({'where':{'id':(0x0,typeorm_1['In'])(_0x3044f7)}});return _0x4ffa4b['forEach'](_0x397900=>{const _0x426fb8=_0x8a7436,_0x272d87=_0x445ce5['find'](_0x58ec54=>_0x58ec54['id']===_0x397900[_0x426fb8(0x1e4)]);_0x397900['catName']=_0x272d87?_0x272d87['name']:'';}),((_0x3b8eea=_0x384947===null||_0x384947===void 0x0?void 0x0:_0x384947[_0x8a7436(0x1aa)])===null||_0x3b8eea===void 0x0?void 0x0:_0x3b8eea[_0x8a7436(0x1c2)])!==_0x8a7436(0x18e)&&_0x4ffa4b[_0x8a7436(0x1c8)](_0xae64e0=>{const _0x577af0=_0x8a7436;delete _0xae64e0[_0x577af0(0x1e1)];}),{'rows':_0x4ffa4b,'count':_0x72ecc7};}async[_0x323e2f(0x1a6)](_0x1aab91){const _0x26c6da=_0x323e2f,{name:_0x3f8c47,catId:_0x1da41f}=_0x1aab91;_0x1aab91[_0x26c6da(0x1c2)]=_0x26c6da(0x1ca);const _0x1cc4ee=await this[_0x26c6da(0x196)][_0x26c6da(0x191)]({'where':{'name':_0x3f8c47}});if(_0x1cc4ee)throw new common_1['HttpException']('该应用名称已存在!',common_1[_0x26c6da(0x1cf)]['BAD_REQUEST']);const _0x281122=await this[_0x26c6da(0x1e7)]['findOne']({'where':{'id':_0x1da41f}});if(!_0x281122)throw new common_1[(_0x26c6da(0x18f))]('该分类不存在!',common_1['HttpStatus']['BAD_REQUEST']);return await this[_0x26c6da(0x196)][_0x26c6da(0x1b3)](_0x1aab91);}async[_0x323e2f(0x1ed)](_0x16a315,_0x564b31){const _0x159a7f=_0x323e2f,{id:_0x1cecdf}=_0x564b31[_0x159a7f(0x1aa)],{name:_0x2e6898,catId:_0x10fe1c,des:_0x58fc20,preset:_0x307161,coverImg:_0x85af15,demoData:_0x115d43,public:_0x92f8e1,appId:_0x3bf3e8}=_0x16a315;if(_0x3bf3e8){const _0x877bb5=await this['appEntity']['findOne']({'where':{'id':_0x3bf3e8,'userId':_0x1cecdf}});if(!_0x877bb5)throw new common_1[(_0x159a7f(0x18f))]('您正在编辑一个不存在的应用!',common_1[_0x159a7f(0x1cf)][_0x159a7f(0x1a7)]);const _0x469f31={'name':_0x2e6898,'catId':_0x10fe1c,'des':_0x58fc20,'preset':_0x307161,'coverImg':_0x85af15,'demoData':_0x115d43,'public':_0x92f8e1,'status':_0x92f8e1?0x3:0x1},_0x18102c=await this[_0x159a7f(0x196)]['update']({'id':_0x3bf3e8,'userId':_0x1cecdf},_0x469f31);if(_0x18102c[_0x159a7f(0x19d)])return'修改成功';else throw new common_1[(_0x159a7f(0x18f))]('修改失败!',common_1[_0x159a7f(0x1cf)]['BAD_REQUEST']);}if(!_0x3bf3e8){const _0x52fd29=await this[_0x159a7f(0x1e7)][_0x159a7f(0x191)]({'where':{'id':_0x10fe1c}});if(!_0x52fd29)throw new common_1['HttpException'](_0x159a7f(0x195),common_1[_0x159a7f(0x1cf)][_0x159a7f(0x1a7)]);const _0x1db42d=await this[_0x159a7f(0x196)]['findOne']({'where':{'name':_0x2e6898}});if(_0x1db42d)throw new common_1[(_0x159a7f(0x18f))](_0x159a7f(0x1db),common_1[_0x159a7f(0x1cf)]['BAD_REQUEST']);const _0xfe0360={'name':_0x2e6898,'catId':_0x10fe1c,'des':_0x58fc20,'preset':_0x307161,'coverImg':_0x85af15,'status':_0x92f8e1?0x3:0x1,'demoData':_0x115d43,'public':_0x92f8e1,'role':_0x159a7f(0x1aa),'userId':_0x1cecdf},_0x27a4f9=await this[_0x159a7f(0x196)][_0x159a7f(0x1b3)](_0xfe0360),_0x1c9a72={'appId':_0x27a4f9['id'],'userId':_0x1cecdf,'appType':_0x159a7f(0x1aa),'public':_0x92f8e1,'status':_0x92f8e1?0x3:0x1,'catId':_0x10fe1c};return this['userAppsEntity']['save'](_0x1c9a72);}}async[_0x323e2f(0x1e8)](_0x91b496){const _0x202391=_0x323e2f,{id:_0x2b193a,name:_0x1060a2,catId:_0x35b962,status:_0x11c8cf}=_0x91b496,_0x99d100=await this[_0x202391(0x196)]['findOne']({'where':{'name':_0x1060a2,'id':(0x0,typeorm_1[_0x202391(0x1a2)])(_0x2b193a)}});if(_0x99d100)throw new common_1[(_0x202391(0x18f))](_0x202391(0x1db),common_1['HttpStatus']['BAD_REQUEST']);const _0x57eac3=await this[_0x202391(0x1e7)][_0x202391(0x191)]({'where':{'id':_0x35b962}});if(!_0x57eac3)throw new common_1[(_0x202391(0x18f))](_0x202391(0x195),common_1[_0x202391(0x1cf)][_0x202391(0x1a7)]);const _0xfe3e49=await this[_0x202391(0x196)]['findOne']({'where':{'id':_0x2b193a}});_0xfe3e49[_0x202391(0x1c0)]!==_0x91b496[_0x202391(0x1c0)]&&await this[_0x202391(0x19f)][_0x202391(0x1da)]({'appId':_0x2b193a},{'status':_0x11c8cf});const _0x23a11c=await this[_0x202391(0x196)][_0x202391(0x1da)]({'id':_0x2b193a},_0x91b496);if(_0x23a11c[_0x202391(0x19d)]>0x0)return _0x202391(0x190);throw new common_1[(_0x202391(0x18f))](_0x202391(0x1ef),common_1[_0x202391(0x1cf)][_0x202391(0x1a7)]);}async[_0x323e2f(0x1ba)](_0x2b3628){const _0x2d64d1=_0x323e2f,{id:_0x113b4a}=_0x2b3628,_0x4d02a0=await this['appEntity'][_0x2d64d1(0x191)]({'where':{'id':_0x113b4a}});if(!_0x4d02a0)throw new common_1[(_0x2d64d1(0x18f))]('该应用不存在!',common_1[_0x2d64d1(0x1cf)][_0x2d64d1(0x1a7)]);const _0x205328=await this[_0x2d64d1(0x19f)][_0x2d64d1(0x1bf)]({'where':{'appId':_0x113b4a}});if(_0x205328>0x0)throw new common_1[(_0x2d64d1(0x18f))](_0x2d64d1(0x1dc),common_1[_0x2d64d1(0x1cf)][_0x2d64d1(0x1a7)]);const _0x2ea216=await this[_0x2d64d1(0x196)]['delete'](_0x113b4a);if(_0x2ea216[_0x2d64d1(0x19d)]>0x0)return'删除App成功';throw new common_1[(_0x2d64d1(0x18f))](_0x2d64d1(0x1d8),common_1[_0x2d64d1(0x1cf)][_0x2d64d1(0x1a7)]);}async[_0x323e2f(0x1e3)](_0x45d86d){const _0x225d0d=_0x323e2f,{id:_0x434f3a}=_0x45d86d,_0x562b2a=await this[_0x225d0d(0x196)][_0x225d0d(0x191)]({'where':{'id':_0x434f3a,'status':0x3}});if(!_0x562b2a)throw new common_1[(_0x225d0d(0x18f))]('该应用不存在!',common_1[_0x225d0d(0x1cf)][_0x225d0d(0x1a7)]);return await this['appEntity']['update']({'id':_0x434f3a},{'status':0x4}),await this[_0x225d0d(0x19f)]['update']({'appId':_0x434f3a},{'status':0x4}),_0x225d0d(0x1b5);}async['auditFail'](_0x42640a){const _0xfca0d5=_0x323e2f,{id:_0x565be7}=_0x42640a,_0x4b9ded=await this[_0xfca0d5(0x196)][_0xfca0d5(0x191)]({'where':{'id':_0x565be7,'status':0x3}});if(!_0x4b9ded)throw new common_1[(_0xfca0d5(0x18f))](_0xfca0d5(0x1a0),common_1[_0xfca0d5(0x1cf)]['BAD_REQUEST']);return await this[_0xfca0d5(0x196)]['update']({'id':_0x565be7},{'status':0x5}),await this[_0xfca0d5(0x19f)][_0xfca0d5(0x1da)]({'appId':_0x565be7},{'status':0x5}),_0xfca0d5(0x1d1);}async[_0x323e2f(0x1df)](_0x229781,_0x3ef5d4){const _0x5b1d48=_0x323e2f,{id:_0xdcc4c4}=_0x229781,_0x4d08c2=await this[_0x5b1d48(0x196)]['findOne']({'where':{'id':_0xdcc4c4,'userId':_0x3ef5d4[_0x5b1d48(0x1aa)]['id']}});if(!_0x4d08c2)throw new common_1[(_0x5b1d48(0x18f))]('您正在操作一个不存在的资源!',common_1[_0x5b1d48(0x1cf)][_0x5b1d48(0x1a7)]);return await this[_0x5b1d48(0x196)][_0x5b1d48(0x1d2)](_0xdcc4c4),await this[_0x5b1d48(0x19f)][_0x5b1d48(0x1d2)]({'appId':_0xdcc4c4,'userId':_0x3ef5d4[_0x5b1d48(0x1aa)]['id']}),_0x5b1d48(0x1ec);}async[_0x323e2f(0x1d3)](_0x539e4f,_0x27eb40){const _0xf39576=_0x323e2f,{appId:_0x4fd0b0}=_0x539e4f,{id:_0x22ee93}=_0x27eb40[_0xf39576(0x1aa)],_0x14ab09=await this[_0xf39576(0x19f)][_0xf39576(0x191)]({'where':{'appId':_0x4fd0b0,'userId':_0x22ee93}});if(_0x14ab09){const _0x17b73d=await this[_0xf39576(0x19f)][_0xf39576(0x1d2)]({'appId':_0x4fd0b0,'userId':_0x22ee93});if(_0x17b73d['affected']>0x0)return _0xf39576(0x1c4);else throw new common_1['HttpException']('取消收藏失败!',common_1[_0xf39576(0x1cf)]['BAD_REQUEST']);}const _0x49719d=await this[_0xf39576(0x196)][_0xf39576(0x191)]({'where':{'id':_0x4fd0b0}}),{id:_0x5bb9db,role:_0x141cc5,catId:_0x27d00a}=_0x49719d,_0x320b21={'userId':_0x22ee93,'appId':_0x5bb9db,'catId':_0x27d00a,'appRole':_0x141cc5,'public':!![],'status':0x1};return await this[_0xf39576(0x19f)]['save'](_0x320b21),_0xf39576(0x1c7);}async[_0x323e2f(0x1ac)](_0x302ab9,_0xa8d51d={'page':0x1,'size':0x1e}){const _0x3fb2ab=_0x323e2f,{id:_0x4ada51}=_0x302ab9['user'],{page:page=0x1,size:size=0x1e}=_0xa8d51d,[_0x200520,_0x146af8]=await this[_0x3fb2ab(0x19f)]['findAndCount']({'where':{'userId':_0x4ada51,'status':(0x0,typeorm_1['In'])([0x1,0x3,0x4,0x5])},'order':{'id':_0x3fb2ab(0x19a)},'skip':(page-0x1)*size,'take':size}),_0x2bf6f7=_0x200520[_0x3fb2ab(0x1d6)](_0x32dd49=>_0x32dd49[_0x3fb2ab(0x1be)]),_0x121835=await this['appEntity'][_0x3fb2ab(0x1b8)]({'where':{'id':(0x0,typeorm_1['In'])(_0x2bf6f7)}});return _0x200520[_0x3fb2ab(0x1c8)](_0x1420bc=>{const _0x38900b=_0x3fb2ab,_0x113c57=_0x121835['find'](_0x5b129a=>_0x5b129a['id']===_0x1420bc[_0x38900b(0x1be)]);_0x1420bc['appName']=_0x113c57?_0x113c57[_0x38900b(0x1ad)]:'',_0x1420bc[_0x38900b(0x1ab)]=_0x113c57?_0x113c57[_0x38900b(0x1c2)]:'',_0x1420bc['appDes']=_0x113c57?_0x113c57[_0x38900b(0x1b1)]:'',_0x1420bc[_0x38900b(0x1b7)]=_0x113c57?_0x113c57[_0x38900b(0x1b7)]:'',_0x1420bc['demoData']=_0x113c57?_0x113c57['demoData']:'',_0x1420bc[_0x38900b(0x1e1)]=_0x113c57[_0x38900b(0x1dd)]===_0x4ada51?_0x113c57[_0x38900b(0x1e1)]:_0x38900b(0x1a3);}),{'rows':_0x200520,'count':_0x146af8};}};AppService=__decorate([(0x0,common_1[_0x323e2f(0x1a8)])(),__param(0x0,(0x0,typeorm_2[_0x323e2f(0x194)])(appCats_entity_1['AppCatsEntity'])),__param(0x1,(0x0,typeorm_2[_0x323e2f(0x194)])(app_entity_1[_0x323e2f(0x1e2)])),__param(0x2,(0x0,typeorm_2[_0x323e2f(0x194)])(userApps_entity_1['UserAppsEntity'])),__metadata(_0x323e2f(0x1eb),[typeorm_1[_0x323e2f(0x1b9)],typeorm_1['Repository'],typeorm_1[_0x323e2f(0x1b9)]])],AppService),exports[_0x323e2f(0x1c1)]=AppService;