YiAi/YiAiQuickDeploy/dist/modules/app/app.service.js
2024-07-02 16:38:26 +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 _0x2c7797=_0x4d7d;(function(_0x3c9ab9,_0x31019b){const _0x316843=_0x4d7d,_0x5872da=_0x3c9ab9();while(!![]){try{const _0x89041f=-parseInt(_0x316843(0x10a))/0x1+-parseInt(_0x316843(0xcc))/0x2+parseInt(_0x316843(0xea))/0x3*(parseInt(_0x316843(0x106))/0x4)+-parseInt(_0x316843(0x111))/0x5+-parseInt(_0x316843(0x115))/0x6+-parseInt(_0x316843(0x10f))/0x7*(-parseInt(_0x316843(0xec))/0x8)+parseInt(_0x316843(0xf4))/0x9;if(_0x89041f===_0x31019b)break;else _0x5872da['push'](_0x5872da['shift']());}catch(_0x1d6d1a){_0x5872da['push'](_0x5872da['shift']());}}}(_0x3b5b,0xd94a1));var __decorate=this&&this['__decorate']||function(_0x57403e,_0x324283,_0x305f70,_0x22e250){const _0x25409d=_0x4d7d;var _0x99643b=arguments['length'],_0x434f5f=_0x99643b<0x3?_0x324283:_0x22e250===null?_0x22e250=Object[_0x25409d(0x11e)](_0x324283,_0x305f70):_0x22e250,_0x5b6ff9;if(typeof Reflect===_0x25409d(0xe0)&&typeof Reflect[_0x25409d(0xd5)]==='function')_0x434f5f=Reflect[_0x25409d(0xd5)](_0x57403e,_0x324283,_0x305f70,_0x22e250);else{for(var _0x1af05a=_0x57403e['length']-0x1;_0x1af05a>=0x0;_0x1af05a--)if(_0x5b6ff9=_0x57403e[_0x1af05a])_0x434f5f=(_0x99643b<0x3?_0x5b6ff9(_0x434f5f):_0x99643b>0x3?_0x5b6ff9(_0x324283,_0x305f70,_0x434f5f):_0x5b6ff9(_0x324283,_0x305f70))||_0x434f5f;}return _0x99643b>0x3&&_0x434f5f&&Object['defineProperty'](_0x324283,_0x305f70,_0x434f5f),_0x434f5f;},__metadata=this&&this[_0x2c7797(0xcd)]||function(_0x25099b,_0xa3318e){const _0x102a0d=_0x2c7797;if(typeof Reflect===_0x102a0d(0xe0)&&typeof Reflect[_0x102a0d(0xee)]===_0x102a0d(0xf7))return Reflect[_0x102a0d(0xee)](_0x25099b,_0xa3318e);},__param=this&&this['__param']||function(_0x3c2d23,_0x3feed0){return function(_0xfa8434,_0x46d848){_0x3feed0(_0xfa8434,_0x46d848,_0x3c2d23);};};function _0x4d7d(_0x4cd049,_0x5ec7b6){const _0x3b5b5b=_0x3b5b();return _0x4d7d=function(_0x4d7dd2,_0x319460){_0x4d7dd2=_0x4d7dd2-0xc4;let _0xa97b81=_0x3b5b5b[_0x4d7dd2];return _0xa97b81;},_0x4d7d(_0x4cd049,_0x5ec7b6);}Object[_0x2c7797(0xe7)](exports,_0x2c7797(0x10b),{'value':!![]}),exports[_0x2c7797(0x113)]=void 0x0;const common_1=require('@nestjs/common'),appCats_entity_1=require(_0x2c7797(0xc4)),typeorm_1=require(_0x2c7797(0xce)),typeorm_2=require(_0x2c7797(0xc9)),app_entity_1=require('./app.entity'),userApps_entity_1=require(_0x2c7797(0xd7));function _0x3b5b(){const _0x4fb873=['./appCats.entity','修改成功','delMineApp','name','UserAppsEntity','@nestjs/typeorm','des','appName','1392670jcYiqz','__metadata','typeorm','该分类下存在App不可删除','mineApps','appId','HttpException','该应用名称已存在!','status','decorate','删除成功','./userApps.entity','您正在操作一个不存在的资源!','forEach','findOne','delApp','******','findAndCount','system','该分类名称已存在!','object','已将应用加入到我的个人工作台!','appDes','coverImg','IsNull','修改失败!','preset','defineProperty','appRole','auditFail','6EifpBx','map','7504uBUxVL','appCatsList','metadata','customApp','删除应用成功!','MoreThan','update','应用审核拒绝完成','33079653bKZNbO','删除App成功','save','function','demoData','catId','删除App失败','Like','删除失败!','appCount','appList','AppEntity','BAD_REQUEST','您正在编辑一个不存在的应用!','userAppsEntity','Repository','appEntity','InjectRepository','1994092qXgzeC','count','取消收藏失败!','frontAppList','1333393dZmRDM','__esModule','super','Not','delete','4396uFwovK','role','4001620GqdZbW','该分类不存在!','AppService','该应用已被用户关联使用中,不可删除!','9249348ktBmdu','该应用不存在!','取消收藏成功!','catName','appCatsEntity','修改App信息成功','Injectable','find','design:paramtypes','getOwnPropertyDescriptor','includes','DESC','HttpStatus','user','delAppCat','affected'];_0x3b5b=function(){return _0x4fb873;};return _0x3b5b();}let AppService=class AppService{constructor(_0x2ca764,_0x18c80e,_0x2d1c03){const _0x4f3c00=_0x2c7797;this[_0x4f3c00(0x119)]=_0x2ca764,this['appEntity']=_0x18c80e,this[_0x4f3c00(0x102)]=_0x2d1c03;}async['createAppCat'](_0x4cf5b9){const _0x4ebb3b=_0x2c7797,{name:_0x47db80}=_0x4cf5b9,_0x50cefa=await this[_0x4ebb3b(0x119)][_0x4ebb3b(0xda)]({'where':{'name':_0x47db80}});if(_0x50cefa)throw new common_1[(_0x4ebb3b(0xd2))](_0x4ebb3b(0xdf),common_1[_0x4ebb3b(0x121)][_0x4ebb3b(0x100)]);return await this[_0x4ebb3b(0x119)][_0x4ebb3b(0xf6)](_0x4cf5b9);}async[_0x2c7797(0x123)](_0x356942){const _0xc596d4=_0x2c7797,{id:_0x597348}=_0x356942,_0xb10de1=await this[_0xc596d4(0x119)][_0xc596d4(0xda)]({'where':{'id':_0x597348}});if(!_0xb10de1)throw new common_1[(_0xc596d4(0xd2))](_0xc596d4(0x112),common_1[_0xc596d4(0x121)][_0xc596d4(0x100)]);const _0x40f1a3=await this[_0xc596d4(0x104)][_0xc596d4(0x107)]({'where':{'catId':_0x597348}});if(_0x40f1a3>0x0)throw new common_1[(_0xc596d4(0xd2))](_0xc596d4(0xcf),common_1[_0xc596d4(0x121)]['BAD_REQUEST']);const _0x137d39=await this[_0xc596d4(0x119)]['delete'](_0x597348);if(_0x137d39[_0xc596d4(0x124)]>0x0)return _0xc596d4(0xd6);throw new common_1['HttpException'](_0xc596d4(0xfc),common_1[_0xc596d4(0x121)][_0xc596d4(0x100)]);}async['updateAppCats'](_0x2878bb){const _0x26c761=_0x2c7797,{id:_0x5f2e34,name:_0x3b6692}=_0x2878bb,_0x4046e6=await this[_0x26c761(0x119)][_0x26c761(0xda)]({'where':{'name':_0x3b6692,'id':(0x0,typeorm_1[_0x26c761(0x10d)])(_0x5f2e34)}});if(_0x4046e6)throw new common_1[(_0x26c761(0xd2))](_0x26c761(0xdf),common_1[_0x26c761(0x121)][_0x26c761(0x100)]);const _0x16ab9a=await this[_0x26c761(0x119)][_0x26c761(0xf2)]({'id':_0x5f2e34},_0x2878bb);if(_0x16ab9a[_0x26c761(0x124)]>0x0)return _0x26c761(0xc5);throw new common_1[(_0x26c761(0xd2))](_0x26c761(0xe5),common_1[_0x26c761(0x121)]['BAD_REQUEST']);}async['queryOneCat'](_0x2c6d61){const _0xdb7a07=_0x2c7797,{id:_0x46e30b}=_0x2c6d61;if(!_0x46e30b)throw new common_1[(_0xdb7a07(0xd2))]('缺失必要参数!',common_1['HttpStatus'][_0xdb7a07(0x100)]);const _0x2644e5=await this[_0xdb7a07(0x104)][_0xdb7a07(0xda)]({'where':{'id':_0x46e30b}}),{demoData:_0x5e613e,coverImg:_0x49d7ea,des:_0x1fad79,name:_0xa65824}=_0x2644e5;return{'demoData':_0x5e613e?_0x5e613e['split']('\x0a'):[],'coverImg':_0x49d7ea,'des':_0x1fad79,'name':_0xa65824};}async[_0x2c7797(0xed)](_0x314bad){const _0x2d7aec=_0x2c7797,{page:page=0x1,size:size=0xa,name:_0x3e530f,status:_0x2fb4dd}=_0x314bad,_0x4be4cc={};_0x3e530f&&(_0x4be4cc[_0x2d7aec(0xc7)]=(0x0,typeorm_1[_0x2d7aec(0xfb)])('%'+_0x3e530f+'%')),[0x0,0x1,'0','1'][_0x2d7aec(0x11f)](_0x2fb4dd)&&(_0x4be4cc[_0x2d7aec(0xd4)]=_0x2fb4dd);const [_0x5b7f94,_0x173188]=await this['appCatsEntity'][_0x2d7aec(0xdd)]({'where':_0x4be4cc,'order':{'order':_0x2d7aec(0x120)},'skip':(page-0x1)*size,'take':size}),_0x2999ab=_0x5b7f94[_0x2d7aec(0xeb)](_0xc6bf3f=>_0xc6bf3f['id']),_0x30799e=await this['appEntity'][_0x2d7aec(0x11c)]({'where':{'catId':(0x0,typeorm_1['In'])(_0x2999ab)}}),_0xbce0eb={};return _0x30799e['forEach'](_0x4080c4=>{const _0x3f88ad=_0x2d7aec;_0xbce0eb[_0x4080c4[_0x3f88ad(0xf9)]]?_0xbce0eb[_0x4080c4[_0x3f88ad(0xf9)]]+=0x1:_0xbce0eb[_0x4080c4[_0x3f88ad(0xf9)]]=0x1;}),_0x5b7f94[_0x2d7aec(0xd9)](_0x5f3ea8=>_0x5f3ea8[_0x2d7aec(0xfd)]=_0xbce0eb[_0x5f3ea8['id']]||0x0),{'rows':_0x5b7f94,'count':_0x173188};}async[_0x2c7797(0xfe)](_0x42fdc2,_0x5daef4,_0x41f61b='id'){const _0x1fb48e=_0x2c7797;var _0x10e657;const {page:page=0x1,size:size=0xa,name:_0x3dbf50,status:_0x5327de,catId:_0x3fcfb3,role:_0x3e1552}=_0x5daef4,_0x1d7277={};_0x3dbf50&&(_0x1d7277['name']=(0x0,typeorm_1[_0x1fb48e(0xfb)])('%'+_0x3dbf50+'%')),_0x3fcfb3&&(_0x1d7277[_0x1fb48e(0xf9)]=_0x3fcfb3),_0x3e1552&&(_0x1d7277[_0x1fb48e(0x110)]=_0x3e1552),_0x5327de&&(_0x1d7277[_0x1fb48e(0xd4)]=_0x5327de);const [_0xa1308,_0x2cd2da]=await this[_0x1fb48e(0x104)][_0x1fb48e(0xdd)]({'where':_0x1d7277,'order':{[_0x41f61b]:_0x1fb48e(0x120)},'skip':(page-0x1)*size,'take':size}),_0x1f3034=_0xa1308['map'](_0x4d8f37=>_0x4d8f37['catId']),_0x4a176d=await this[_0x1fb48e(0x119)]['find']({'where':{'id':(0x0,typeorm_1['In'])(_0x1f3034)}});return _0xa1308['forEach'](_0xecbe0e=>{const _0x2358d7=_0x1fb48e,_0x3d076b=_0x4a176d[_0x2358d7(0x11c)](_0x5480d7=>_0x5480d7['id']===_0xecbe0e['catId']);_0xecbe0e[_0x2358d7(0x118)]=_0x3d076b?_0x3d076b['name']:'';}),((_0x10e657=_0x42fdc2===null||_0x42fdc2===void 0x0?void 0x0:_0x42fdc2[_0x1fb48e(0x122)])===null||_0x10e657===void 0x0?void 0x0:_0x10e657['role'])!==_0x1fb48e(0x10c)&&_0xa1308[_0x1fb48e(0xd9)](_0x963d48=>{const _0x485011=_0x1fb48e;delete _0x963d48[_0x485011(0xe6)];}),{'rows':_0xa1308,'count':_0x2cd2da};}async[_0x2c7797(0x109)](_0xea3912,_0x1721d8,_0x33dd27='id'){const _0x512ad8=_0x2c7797;var _0x29c758;const {page:page=0x1,size:size=0x3e8,name:_0x8d3b5e,catId:_0x256666,role:_0x3a0440}=_0x1721d8,_0x3542ad=[{'status':(0x0,typeorm_1['In'])([0x1,0x4]),'userId':(0x0,typeorm_1[_0x512ad8(0xe4)])(),'public':![]},{'userId':(0x0,typeorm_1[_0x512ad8(0xf1)])(0x0),'public':!![]}],[_0x4482dc,_0x99de13]=await this[_0x512ad8(0x104)][_0x512ad8(0xdd)]({'where':_0x3542ad,'order':{'order':_0x512ad8(0x120)},'skip':(page-0x1)*size,'take':size}),_0x4a9aa8=_0x4482dc[_0x512ad8(0xeb)](_0x548cdf=>_0x548cdf['catId']),_0x109a1d=await this[_0x512ad8(0x119)][_0x512ad8(0x11c)]({'where':{'id':(0x0,typeorm_1['In'])(_0x4a9aa8)}});return _0x4482dc['forEach'](_0x3bf683=>{const _0x15937d=_0x512ad8,_0x2b2e3f=_0x109a1d['find'](_0x423ff6=>_0x423ff6['id']===_0x3bf683['catId']);_0x3bf683[_0x15937d(0x118)]=_0x2b2e3f?_0x2b2e3f[_0x15937d(0xc7)]:'';}),((_0x29c758=_0xea3912===null||_0xea3912===void 0x0?void 0x0:_0xea3912[_0x512ad8(0x122)])===null||_0x29c758===void 0x0?void 0x0:_0x29c758[_0x512ad8(0x110)])!=='super'&&_0x4482dc[_0x512ad8(0xd9)](_0x2d79f8=>{const _0x90afb3=_0x512ad8;delete _0x2d79f8[_0x90afb3(0xe6)];}),{'rows':_0x4482dc,'count':_0x99de13};}async['createApp'](_0x14ec8e){const _0x22e390=_0x2c7797,{name:_0x3b67ba,catId:_0x9bd982}=_0x14ec8e;_0x14ec8e[_0x22e390(0x110)]=_0x22e390(0xde);const _0xb6dff6=await this['appEntity']['findOne']({'where':{'name':_0x3b67ba}});if(_0xb6dff6)throw new common_1[(_0x22e390(0xd2))](_0x22e390(0xd3),common_1[_0x22e390(0x121)][_0x22e390(0x100)]);const _0x3fe502=await this[_0x22e390(0x119)][_0x22e390(0xda)]({'where':{'id':_0x9bd982}});if(!_0x3fe502)throw new common_1[(_0x22e390(0xd2))](_0x22e390(0x112),common_1[_0x22e390(0x121)][_0x22e390(0x100)]);return await this[_0x22e390(0x104)][_0x22e390(0xf6)](_0x14ec8e);}async[_0x2c7797(0xef)](_0xcfbe19,_0xd0ea91){const _0x3c39ae=_0x2c7797,{id:_0x30c7df}=_0xd0ea91[_0x3c39ae(0x122)],{name:_0x24b516,catId:_0xc4824f,des:_0x55af0a,preset:_0xe28acf,coverImg:_0x173f52,demoData:_0x2b9ee4,public:_0x10bec1,appId:_0x3da21d}=_0xcfbe19;if(_0x3da21d){const _0x4c2e4c=await this[_0x3c39ae(0x104)][_0x3c39ae(0xda)]({'where':{'id':_0x3da21d,'userId':_0x30c7df}});if(!_0x4c2e4c)throw new common_1['HttpException'](_0x3c39ae(0x101),common_1[_0x3c39ae(0x121)][_0x3c39ae(0x100)]);const _0x5a30ef={'name':_0x24b516,'catId':_0xc4824f,'des':_0x55af0a,'preset':_0xe28acf,'coverImg':_0x173f52,'demoData':_0x2b9ee4,'public':_0x10bec1,'status':_0x10bec1?0x3:0x1},_0x47ca55=await this[_0x3c39ae(0x104)][_0x3c39ae(0xf2)]({'id':_0x3da21d,'userId':_0x30c7df},_0x5a30ef);if(_0x47ca55[_0x3c39ae(0x124)])return'修改成功';else throw new common_1[(_0x3c39ae(0xd2))](_0x3c39ae(0xe5),common_1[_0x3c39ae(0x121)][_0x3c39ae(0x100)]);}if(!_0x3da21d){const _0x109aa6=await this[_0x3c39ae(0x119)][_0x3c39ae(0xda)]({'where':{'id':_0xc4824f}});if(!_0x109aa6)throw new common_1['HttpException']('该分类不存在!',common_1[_0x3c39ae(0x121)][_0x3c39ae(0x100)]);const _0x2299c7=await this[_0x3c39ae(0x104)][_0x3c39ae(0xda)]({'where':{'name':_0x24b516}});if(_0x2299c7)throw new common_1[(_0x3c39ae(0xd2))](_0x3c39ae(0xd3),common_1[_0x3c39ae(0x121)]['BAD_REQUEST']);const _0x1b296f={'name':_0x24b516,'catId':_0xc4824f,'des':_0x55af0a,'preset':_0xe28acf,'coverImg':_0x173f52,'status':_0x10bec1?0x3:0x1,'demoData':_0x2b9ee4,'public':_0x10bec1,'role':'user','userId':_0x30c7df},_0x492ffa=await this[_0x3c39ae(0x104)]['save'](_0x1b296f),_0xe477bc={'appId':_0x492ffa['id'],'userId':_0x30c7df,'appType':_0x3c39ae(0x122),'public':_0x10bec1,'status':_0x10bec1?0x3:0x1,'catId':_0xc4824f};return this['userAppsEntity'][_0x3c39ae(0xf6)](_0xe477bc);}}async['updateApp'](_0x2fd55b){const _0x5ab32e=_0x2c7797,{id:_0x5f54db,name:_0x113ad7,catId:_0xc89196,status:_0x97259b}=_0x2fd55b,_0x57b30d=await this[_0x5ab32e(0x104)][_0x5ab32e(0xda)]({'where':{'name':_0x113ad7,'id':(0x0,typeorm_1[_0x5ab32e(0x10d)])(_0x5f54db)}});if(_0x57b30d)throw new common_1[(_0x5ab32e(0xd2))]('该应用名称已存在!',common_1['HttpStatus']['BAD_REQUEST']);const _0x34719a=await this[_0x5ab32e(0x119)][_0x5ab32e(0xda)]({'where':{'id':_0xc89196}});if(!_0x34719a)throw new common_1[(_0x5ab32e(0xd2))]('该分类不存在!',common_1[_0x5ab32e(0x121)][_0x5ab32e(0x100)]);const _0x471c65=await this[_0x5ab32e(0x104)]['findOne']({'where':{'id':_0x5f54db}});_0x471c65[_0x5ab32e(0xd4)]!==_0x2fd55b['status']&&await this[_0x5ab32e(0x102)][_0x5ab32e(0xf2)]({'appId':_0x5f54db},{'status':_0x97259b});const _0x2ba31a=await this['appEntity'][_0x5ab32e(0xf2)]({'id':_0x5f54db},_0x2fd55b);if(_0x2ba31a['affected']>0x0)return _0x5ab32e(0x11a);throw new common_1[(_0x5ab32e(0xd2))]('修改App信息失败',common_1[_0x5ab32e(0x121)][_0x5ab32e(0x100)]);}async[_0x2c7797(0xdb)](_0x57bfe0){const _0x403eca=_0x2c7797,{id:_0x2dabf9}=_0x57bfe0,_0x301c96=await this[_0x403eca(0x104)][_0x403eca(0xda)]({'where':{'id':_0x2dabf9}});if(!_0x301c96)throw new common_1[(_0x403eca(0xd2))](_0x403eca(0x116),common_1[_0x403eca(0x121)][_0x403eca(0x100)]);const _0x47b08b=await this[_0x403eca(0x102)][_0x403eca(0x107)]({'where':{'appId':_0x2dabf9}});if(_0x47b08b>0x0)throw new common_1[(_0x403eca(0xd2))](_0x403eca(0x114),common_1[_0x403eca(0x121)]['BAD_REQUEST']);const _0xa3ea5c=await this[_0x403eca(0x104)][_0x403eca(0x10e)](_0x2dabf9);if(_0xa3ea5c[_0x403eca(0x124)]>0x0)return _0x403eca(0xf5);throw new common_1[(_0x403eca(0xd2))](_0x403eca(0xfa),common_1[_0x403eca(0x121)][_0x403eca(0x100)]);}async['auditPass'](_0x2ed244){const _0x58d987=_0x2c7797,{id:_0x33fd55}=_0x2ed244,_0x273c99=await this[_0x58d987(0x104)][_0x58d987(0xda)]({'where':{'id':_0x33fd55,'status':0x3}});if(!_0x273c99)throw new common_1[(_0x58d987(0xd2))](_0x58d987(0x116),common_1[_0x58d987(0x121)][_0x58d987(0x100)]);return await this[_0x58d987(0x104)]['update']({'id':_0x33fd55},{'status':0x4}),await this[_0x58d987(0x102)][_0x58d987(0xf2)]({'appId':_0x33fd55},{'status':0x4}),'应用审核通过';}async[_0x2c7797(0xe9)](_0x4bd583){const _0x13f72a=_0x2c7797,{id:_0x3f7863}=_0x4bd583,_0x4a4ab7=await this[_0x13f72a(0x104)][_0x13f72a(0xda)]({'where':{'id':_0x3f7863,'status':0x3}});if(!_0x4a4ab7)throw new common_1[(_0x13f72a(0xd2))](_0x13f72a(0x116),common_1['HttpStatus'][_0x13f72a(0x100)]);return await this['appEntity'][_0x13f72a(0xf2)]({'id':_0x3f7863},{'status':0x5}),await this[_0x13f72a(0x102)][_0x13f72a(0xf2)]({'appId':_0x3f7863},{'status':0x5}),_0x13f72a(0xf3);}async[_0x2c7797(0xc6)](_0x3416e5,_0x22ac66){const _0x427563=_0x2c7797,{id:_0x4ac2a8}=_0x3416e5,_0x772fb5=await this[_0x427563(0x104)][_0x427563(0xda)]({'where':{'id':_0x4ac2a8,'userId':_0x22ac66[_0x427563(0x122)]['id']}});if(!_0x772fb5)throw new common_1[(_0x427563(0xd2))](_0x427563(0xd8),common_1['HttpStatus'][_0x427563(0x100)]);return await this['appEntity'][_0x427563(0x10e)](_0x4ac2a8),await this['userAppsEntity']['delete']({'appId':_0x4ac2a8,'userId':_0x22ac66[_0x427563(0x122)]['id']}),_0x427563(0xf0);}async['collect'](_0x110f95,_0x557ba8){const _0x5204d2=_0x2c7797,{appId:_0xc75e43}=_0x110f95,{id:_0xebe444}=_0x557ba8[_0x5204d2(0x122)],_0x10b736=await this[_0x5204d2(0x102)][_0x5204d2(0xda)]({'where':{'appId':_0xc75e43,'userId':_0xebe444}});if(_0x10b736){const _0x404321=await this['userAppsEntity']['delete']({'appId':_0xc75e43,'userId':_0xebe444});if(_0x404321['affected']>0x0)return _0x5204d2(0x117);else throw new common_1[(_0x5204d2(0xd2))](_0x5204d2(0x108),common_1['HttpStatus'][_0x5204d2(0x100)]);}const _0xf17bbf=await this[_0x5204d2(0x104)][_0x5204d2(0xda)]({'where':{'id':_0xc75e43}}),{id:_0x566602,role:_0x13a50e,catId:_0x4d7ae8}=_0xf17bbf,_0x34a46b={'userId':_0xebe444,'appId':_0x566602,'catId':_0x4d7ae8,'appRole':_0x13a50e,'public':!![],'status':0x1};return await this[_0x5204d2(0x102)][_0x5204d2(0xf6)](_0x34a46b),_0x5204d2(0xe1);}async[_0x2c7797(0xd0)](_0x53f93d,_0x1420d9={'page':0x1,'size':0x1e}){const _0x51bcd1=_0x2c7797,{id:_0x5f050e}=_0x53f93d[_0x51bcd1(0x122)],{page:page=0x1,size:size=0x1e}=_0x1420d9,[_0x4e6cce,_0x37adca]=await this[_0x51bcd1(0x102)]['findAndCount']({'where':{'userId':_0x5f050e,'status':(0x0,typeorm_1['In'])([0x1,0x3,0x4,0x5])},'order':{'id':_0x51bcd1(0x120)},'skip':(page-0x1)*size,'take':size}),_0x394ae3=_0x4e6cce['map'](_0x10489b=>_0x10489b[_0x51bcd1(0xd1)]),_0x509ea0=await this[_0x51bcd1(0x104)][_0x51bcd1(0x11c)]({'where':{'id':(0x0,typeorm_1['In'])(_0x394ae3)}});return _0x4e6cce[_0x51bcd1(0xd9)](_0x107eb4=>{const _0x337857=_0x51bcd1,_0x2a1e74=_0x509ea0[_0x337857(0x11c)](_0x32fa96=>_0x32fa96['id']===_0x107eb4['appId']);_0x107eb4[_0x337857(0xcb)]=_0x2a1e74?_0x2a1e74[_0x337857(0xc7)]:'',_0x107eb4[_0x337857(0xe8)]=_0x2a1e74?_0x2a1e74[_0x337857(0x110)]:'',_0x107eb4[_0x337857(0xe2)]=_0x2a1e74?_0x2a1e74[_0x337857(0xca)]:'',_0x107eb4[_0x337857(0xe3)]=_0x2a1e74?_0x2a1e74[_0x337857(0xe3)]:'',_0x107eb4[_0x337857(0xf8)]=_0x2a1e74?_0x2a1e74[_0x337857(0xf8)]:'',_0x107eb4[_0x337857(0xe6)]=_0x2a1e74['userId']===_0x5f050e?_0x2a1e74[_0x337857(0xe6)]:_0x337857(0xdc);}),{'rows':_0x4e6cce,'count':_0x37adca};}};AppService=__decorate([(0x0,common_1[_0x2c7797(0x11b)])(),__param(0x0,(0x0,typeorm_2[_0x2c7797(0x105)])(appCats_entity_1['AppCatsEntity'])),__param(0x1,(0x0,typeorm_2['InjectRepository'])(app_entity_1[_0x2c7797(0xff)])),__param(0x2,(0x0,typeorm_2[_0x2c7797(0x105)])(userApps_entity_1[_0x2c7797(0xc8)])),__metadata(_0x2c7797(0x11d),[typeorm_1['Repository'],typeorm_1[_0x2c7797(0x103)],typeorm_1[_0x2c7797(0x103)]])],AppService),exports['AppService']=AppService;