mirror of
https://github.com/xiaoyiweb/YiAi.git
synced 2025-09-26 05:06:39 +08:00
1 line
6.3 KiB
JavaScript
1 line
6.3 KiB
JavaScript
'use strict';function _0x5403(){const _0x59484d=['8dbNOFF','22AVInKB','autoReplyKes','2119707OtihjJ','forEach','loadAutoReplyList','更新问题成功','446934cArbFN','getOwnPropertyDescriptor','4537715iosqjA','__metadata','HttpStatus','update','function','InjectRepository','添加问题成功!','HttpException','find','typeorm','autoReplyFuzzyMatch','__decorate','prompt','addAutoreply','decorate','defineProperty','checkAutoReply','metadata','updateAutoreply','@nestjs/typeorm','Repository','keys','4CrryOB','onModuleInit','__param','length','includes','delete','status','2452hfobvt','affected','AutoreplyService','findOne','Like','BAD_REQUEST','object','1112601EppEdI','2810220SUKEHN','queryAutoreply','该问题不存在,请检查您的提交信息','findAndCount','删除失败','7621821GSziRb','10Nmeseu','14BYIXud','answer','37sHyQSv','autoReplyMap','delAutoreply','autoReplyEntity','删除问题成功','./autoreplay.entity','65UjBlmG'];_0x5403=function(){return _0x59484d;};return _0x5403();}const _0x453c90=_0x5a27;(function(_0x8f10b9,_0x47903d){const _0x2d1bd7=_0x5a27,_0x2e0dbc=_0x8f10b9();while(!![]){try{const _0x547165=parseInt(_0x2d1bd7(0x13d))/0x1*(-parseInt(_0x2d1bd7(0x12c))/0x2)+-parseInt(_0x2d1bd7(0x147))/0x3*(-parseInt(_0x2d1bd7(0x125))/0x4)+parseInt(_0x2d1bd7(0x143))/0x5*(-parseInt(_0x2d1bd7(0x14b))/0x6)+parseInt(_0x2d1bd7(0x133))/0x7*(-parseInt(_0x2d1bd7(0x144))/0x8)+parseInt(_0x2d1bd7(0x139))/0x9*(parseInt(_0x2d1bd7(0x13a))/0xa)+parseInt(_0x2d1bd7(0x145))/0xb*(parseInt(_0x2d1bd7(0x134))/0xc)+-parseInt(_0x2d1bd7(0x14d))/0xd*(parseInt(_0x2d1bd7(0x13b))/0xe);if(_0x547165===_0x47903d)break;else _0x2e0dbc['push'](_0x2e0dbc['shift']());}catch(_0x536fe7){_0x2e0dbc['push'](_0x2e0dbc['shift']());}}}(_0x5403,0x7a17b));var __decorate=this&&this[_0x453c90(0x11a)]||function(_0x323210,_0x36b043,_0x5e0f98,_0x2e2bbb){const _0x4d6555=_0x453c90;var _0xf5996c=arguments[_0x4d6555(0x128)],_0x20b9b0=_0xf5996c<0x3?_0x36b043:_0x2e2bbb===null?_0x2e2bbb=Object[_0x4d6555(0x14c)](_0x36b043,_0x5e0f98):_0x2e2bbb,_0x1dbf18;if(typeof Reflect===_0x4d6555(0x132)&&typeof Reflect[_0x4d6555(0x11d)]===_0x4d6555(0x113))_0x20b9b0=Reflect[_0x4d6555(0x11d)](_0x323210,_0x36b043,_0x5e0f98,_0x2e2bbb);else{for(var _0x5a640a=_0x323210[_0x4d6555(0x128)]-0x1;_0x5a640a>=0x0;_0x5a640a--)if(_0x1dbf18=_0x323210[_0x5a640a])_0x20b9b0=(_0xf5996c<0x3?_0x1dbf18(_0x20b9b0):_0xf5996c>0x3?_0x1dbf18(_0x36b043,_0x5e0f98,_0x20b9b0):_0x1dbf18(_0x36b043,_0x5e0f98))||_0x20b9b0;}return _0xf5996c>0x3&&_0x20b9b0&&Object[_0x4d6555(0x11e)](_0x36b043,_0x5e0f98,_0x20b9b0),_0x20b9b0;},__metadata=this&&this[_0x453c90(0x14e)]||function(_0x1cabe5,_0x475154){const _0x4f7d55=_0x453c90;if(typeof Reflect===_0x4f7d55(0x132)&&typeof Reflect[_0x4f7d55(0x120)]==='function')return Reflect['metadata'](_0x1cabe5,_0x475154);},__param=this&&this[_0x453c90(0x127)]||function(_0x101748,_0x2c061b){return function(_0x5d2fa9,_0x4534b1){_0x2c061b(_0x5d2fa9,_0x4534b1,_0x101748);};};Object[_0x453c90(0x11e)](exports,'__esModule',{'value':!![]}),exports['AutoreplyService']=void 0x0;function _0x5a27(_0x4b4362,_0x1dd0e8){const _0x54034e=_0x5403();return _0x5a27=function(_0x5a2756,_0x713b6d){_0x5a2756=_0x5a2756-0x113;let _0x4c7a=_0x54034e[_0x5a2756];return _0x4c7a;},_0x5a27(_0x4b4362,_0x1dd0e8);}const common_1=require('@nestjs/common'),autoreplay_entity_1=require(_0x453c90(0x142)),typeorm_1=require(_0x453c90(0x118)),typeorm_2=require(_0x453c90(0x122));let AutoreplyService=class AutoreplyService{constructor(_0x6e230f){const _0xf2bd8=_0x453c90;this[_0xf2bd8(0x140)]=_0x6e230f,this[_0xf2bd8(0x146)]=[],this[_0xf2bd8(0x13e)]={},this[_0xf2bd8(0x119)]=!![];}async[_0x453c90(0x126)](){this['loadAutoReplyList']();}async['loadAutoReplyList'](){const _0x49aee2=_0x453c90,_0xb051da=await this[_0x49aee2(0x140)]['find']({'where':{'status':0x1},'select':[_0x49aee2(0x11b),'answer']});this['autoReplyMap']={},_0xb051da[_0x49aee2(0x148)](_0x2f483e=>this['autoReplyMap'][_0x2f483e['prompt']]=_0x2f483e[_0x49aee2(0x13c)]),this[_0x49aee2(0x146)]=Object[_0x49aee2(0x124)](this[_0x49aee2(0x13e)]);}async[_0x453c90(0x11f)](_0x1f5e46){const _0x59656=_0x453c90;let _0x1f230b=_0x1f5e46;return this[_0x59656(0x119)]&&(_0x1f230b=this[_0x59656(0x146)][_0x59656(0x117)](_0x414cbc=>_0x414cbc['includes'](_0x1f5e46))),_0x1f230b?this['autoReplyMap'][_0x1f230b]:'';}async[_0x453c90(0x135)](_0x44b155){const _0x4cf39b=_0x453c90,{page:page=0x1,size:size=0xa,prompt:_0x14a2b6,status:_0x5f2a9e}=_0x44b155,_0x3a5100={};[0x0,0x1,'0','1'][_0x4cf39b(0x129)](_0x5f2a9e)&&(_0x3a5100[_0x4cf39b(0x12b)]=_0x5f2a9e),_0x14a2b6&&(_0x3a5100[_0x4cf39b(0x11b)]=(0x0,typeorm_1[_0x4cf39b(0x130)])('%'+_0x14a2b6+'%'));const [_0x10a3a0,_0x3457a6]=await this['autoReplyEntity'][_0x4cf39b(0x137)]({'where':_0x3a5100,'skip':(page-0x1)*size,'take':size,'order':{'id':'DESC'}});return{'rows':_0x10a3a0,'count':_0x3457a6};}async[_0x453c90(0x11c)](_0xe26fe9){const _0x483d2c=_0x453c90,{prompt:_0x378b54}=_0xe26fe9,_0x1acae1=await this['autoReplyEntity'][_0x483d2c(0x12f)]({'where':{'prompt':_0x378b54}});if(_0x1acae1)throw new common_1['HttpException']('该问题已存在,请检查您的提交信息',common_1['HttpStatus'][_0x483d2c(0x131)]);return await this[_0x483d2c(0x140)]['save'](_0xe26fe9),await this[_0x483d2c(0x149)](),_0x483d2c(0x115);}async[_0x453c90(0x121)](_0x26ff45){const _0x8bce2=_0x453c90,{id:_0x10e8ed}=_0x26ff45,_0x559817=await this[_0x8bce2(0x140)][_0x8bce2(0x150)]({'id':_0x10e8ed},_0x26ff45);if(_0x559817['affected']>0x0)return await this[_0x8bce2(0x149)](),_0x8bce2(0x14a);throw new common_1[(_0x8bce2(0x116))]('更新失败',common_1[_0x8bce2(0x14f)]['BAD_REQUEST']);}async[_0x453c90(0x13f)](_0x43cd70){const _0x1a9ef4=_0x453c90,{id:_0x5e92d8}=_0x43cd70,_0x115c39=await this[_0x1a9ef4(0x140)]['findOne']({'where':{'id':_0x5e92d8}});if(!_0x115c39)throw new common_1[(_0x1a9ef4(0x116))](_0x1a9ef4(0x136),common_1[_0x1a9ef4(0x14f)][_0x1a9ef4(0x131)]);const _0x928138=await this[_0x1a9ef4(0x140)][_0x1a9ef4(0x12a)]({'id':_0x5e92d8});if(_0x928138[_0x1a9ef4(0x12d)]>0x0)return await this[_0x1a9ef4(0x149)](),_0x1a9ef4(0x141);throw new common_1[(_0x1a9ef4(0x116))](_0x1a9ef4(0x138),common_1[_0x1a9ef4(0x14f)][_0x1a9ef4(0x131)]);}};AutoreplyService=__decorate([(0x0,common_1['Injectable'])(),__param(0x0,(0x0,typeorm_2[_0x453c90(0x114)])(autoreplay_entity_1['AutoReplyEntity'])),__metadata('design:paramtypes',[typeorm_1[_0x453c90(0x123)]])],AutoreplyService),exports[_0x453c90(0x12e)]=AutoreplyService; |