06d9cca3979672c0e1816c62467d960a0d2c143c
[motion-next.git] / server / api / smsAccount / smsAccount.rpc.js
1 const a545_0x1688=['include','rpc','error','model','./smsAccount.socket','attributes','SmsAccount','register','catch','map','info','message','where','options','ShowSmsAccount','raw'];(function(_0x34a2d7,_0x1688eb){const _0x33ff7a=function(_0x4439c6){while(--_0x4439c6){_0x34a2d7['push'](_0x34a2d7['shift']());}};_0x33ff7a(++_0x1688eb);}(a545_0x1688,0x1df));const a545_0x33ff=function(_0x34a2d7,_0x1688eb){_0x34a2d7=_0x34a2d7-0x0;let _0x33ff7a=a545_0x1688[_0x34a2d7];return _0x33ff7a;};const _0x8e8cfb=a545_0x33ff;'use strict';const db=require('../../mysqldb')['db'],logger=require('../../config/logger')(_0x8e8cfb('0x2')),_=require('lodash'),{getSocket}=require('../../rediscache'),socket=getSocket();require(_0x8e8cfb('0x5'))[_0x8e8cfb('0x8')](socket),exports[_0x8e8cfb('0xf')]=function(_0x4439c6){const _0x171410=this;return new Promise(function(_0x9af83f,_0x3978fa){const _0x5a382f=a545_0x33ff;return db[_0x5a382f('0x7')]['findOne']({'raw':_0x4439c6['options']?_0x4439c6['options'][_0x5a382f('0x0')]===undefined?!![]:![]:!![],'where':_0x4439c6[_0x5a382f('0xe')]?_0x4439c6[_0x5a382f('0xe')][_0x5a382f('0xd')]||null:null,'attributes':_0x4439c6[_0x5a382f('0xe')]?_0x4439c6['options']['attributes']||null:null,'include':_0x4439c6[_0x5a382f('0xe')]?_0x4439c6['options']['include']?_[_0x5a382f('0xa')](_0x4439c6[_0x5a382f('0xe')][_0x5a382f('0x1')],function(_0xdec4f1){const _0x42abd1=_0x5a382f;return{'model':db[_0xdec4f1['model']],'as':_0xdec4f1['as'],'attributes':_0xdec4f1[_0x42abd1('0x6')],'include':_0xdec4f1['include']?_[_0x42abd1('0xa')](_0xdec4f1[_0x42abd1('0x1')],function(_0x1f795b){const _0x560973=_0x42abd1;return{'model':db[_0x1f795b[_0x560973('0x4')]],'as':_0x1f795b['as'],'attributes':_0x1f795b[_0x560973('0x6')],'include':_0x1f795b[_0x560973('0x1')]?_[_0x560973('0xa')](_0x1f795b['include'],function(_0xa76b6a){const _0xe7c20d=_0x560973;return{'model':db[_0xa76b6a[_0xe7c20d('0x4')]],'as':_0xa76b6a['as'],'attributes':_0xa76b6a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x54b17f){const _0x297754=_0x5a382f;logger[_0x297754('0xb')](_0x297754('0xf'),_0x4439c6),logger['debug'](_0x297754('0xf'),_0x4439c6,JSON['stringify'](_0x54b17f)),_0x9af83f(_0x54b17f);})[_0x5a382f('0x9')](function(_0x23c987){const _0x4574c0=_0x5a382f;logger[_0x4574c0('0x3')](_0x4574c0('0xf'),_0x23c987[_0x4574c0('0xc')],_0x4439c6),_0x3978fa(_0x171410[_0x4574c0('0x3')](0x1f4,_0x23c987[_0x4574c0('0xc')]));});});};