Built motion from commit bab6f49e.|2.6.17
[motion2.git] / server / api / sound / sound.rpc.js
index 6558786..5bebbc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbfb=['debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','find','options','raw','where','attributes','include','map','model','ShowSound','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x4c6c97,_0x243a44){var _0x3f6ca7=function(_0x54e6b7){while(--_0x54e6b7){_0x4c6c97['push'](_0x4c6c97['shift']());}};_0x3f6ca7(++_0x243a44);}(_0xdbfb,0x122));var _0xbdbf=function(_0x39840e,_0x52683a){_0x39840e=_0x39840e-0x0;var _0xc179cf=_0xdbfb[_0x39840e];return _0xc179cf;};'use strict';var _=require(_0xbdbf('0x0'));var util=require(_0xbdbf('0x1'));var moment=require(_0xbdbf('0x2'));var BPromise=require(_0xbdbf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdbf('0x4'));var db=require(_0xbdbf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdbf('0x6'))(_0xbdbf('0x7'));var config=require(_0xbdbf('0x8'));var jayson=require(_0xbdbf('0x9'));var client=jayson[_0xbdbf('0xa')][_0xbdbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e52c2,_0x3e1f53,_0x31c9d0){return new BPromise(function(_0x6ab774,_0x4927ce){return client[_0xbdbf('0xc')](_0x3e52c2,_0x31c9d0)[_0xbdbf('0xd')](function(_0x2dc3c7){logger['info'](_0xbdbf('0xe'),_0x3e1f53,_0xbdbf('0xf'));logger[_0xbdbf('0x10')](_0xbdbf('0x11'),_0x3e1f53,_0xbdbf('0xf'),JSON[_0xbdbf('0x12')](_0x2dc3c7));if(_0x2dc3c7['error']){if(_0x2dc3c7[_0xbdbf('0x13')][_0xbdbf('0x14')]===0x1f4){logger[_0xbdbf('0x13')]('Sound,\x20%s,\x20%s',_0x3e1f53,_0x2dc3c7['error'][_0xbdbf('0x15')]);return _0x4927ce(_0x2dc3c7[_0xbdbf('0x13')]['message']);}logger['error']('Sound,\x20%s,\x20%s',_0x3e1f53,_0x2dc3c7['error'][_0xbdbf('0x15')]);return _0x6ab774(_0x2dc3c7[_0xbdbf('0x13')][_0xbdbf('0x15')]);}else{logger[_0xbdbf('0x16')](_0xbdbf('0xe'),_0x3e1f53,_0xbdbf('0xf'));_0x6ab774(_0x2dc3c7[_0xbdbf('0x17')][_0xbdbf('0x15')]);}})[_0xbdbf('0x18')](function(_0x97b7b8){logger[_0xbdbf('0x13')](_0xbdbf('0xe'),_0x3e1f53,_0x97b7b8);_0x4927ce(_0x97b7b8);});});}exports['ShowSound']=function(_0x5f107f){var _0x51ff4a=this;return new Promise(function(_0x5f1dc9,_0x36d953){return db['Sound'][_0xbdbf('0x19')]({'raw':_0x5f107f[_0xbdbf('0x1a')]?_0x5f107f[_0xbdbf('0x1a')][_0xbdbf('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f107f[_0xbdbf('0x1a')]?_0x5f107f[_0xbdbf('0x1a')][_0xbdbf('0x1c')]||null:null,'attributes':_0x5f107f[_0xbdbf('0x1a')]?_0x5f107f['options'][_0xbdbf('0x1d')]||null:null,'include':_0x5f107f[_0xbdbf('0x1a')]?_0x5f107f['options'][_0xbdbf('0x1e')]?_[_0xbdbf('0x1f')](_0x5f107f[_0xbdbf('0x1a')]['include'],function(_0x29b024){return{'model':db[_0x29b024[_0xbdbf('0x20')]],'as':_0x29b024['as'],'attributes':_0x29b024[_0xbdbf('0x1d')],'include':_0x29b024[_0xbdbf('0x1e')]?_['map'](_0x29b024['include'],function(_0x382522){return{'model':db[_0x382522[_0xbdbf('0x20')]],'as':_0x382522['as'],'attributes':_0x382522['attributes'],'include':_0x382522[_0xbdbf('0x1e')]?_[_0xbdbf('0x1f')](_0x382522[_0xbdbf('0x1e')],function(_0x1938b4){return{'model':db[_0x1938b4['model']],'as':_0x1938b4['as'],'attributes':_0x1938b4[_0xbdbf('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f7198){logger[_0xbdbf('0x16')](_0xbdbf('0x21'),_0x5f107f);logger['debug'](_0xbdbf('0x21'),_0x5f107f,JSON['stringify'](_0x2f7198));_0x5f1dc9(_0x2f7198);})[_0xbdbf('0x18')](function(_0x5bd1e9){logger[_0xbdbf('0x13')](_0xbdbf('0x21'),_0x5bd1e9[_0xbdbf('0x15')],_0x5f107f);_0x36d953(_0x51ff4a[_0xbdbf('0x13')](0x1f4,_0x5bd1e9['message']));});});};
\ No newline at end of file
+var _0xb6b2=['include','model','map','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','ShowSound','options','attributes'];(function(_0xdddc57,_0x14d9d7){var _0x3dc63d=function(_0x5f29eb){while(--_0x5f29eb){_0xdddc57['push'](_0xdddc57['shift']());}};_0x3dc63d(++_0x14d9d7);}(_0xb6b2,0x121));var _0x2b6b=function(_0x934a0d,_0x3ef612){_0x934a0d=_0x934a0d-0x0;var _0x2116ac=_0xb6b2[_0x934a0d];return _0x2116ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2b6b('0x0'));var BPromise=require(_0x2b6b('0x1'));var rs=require(_0x2b6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b6b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2b6b('0x4'));var config=require(_0x2b6b('0x5'));var jayson=require(_0x2b6b('0x6'));var client=jayson[_0x2b6b('0x7')][_0x2b6b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb86a0f,_0x4ba90d,_0x2ab343){return new BPromise(function(_0x4017f3,_0x6d654){return client['request'](_0xb86a0f,_0x2ab343)[_0x2b6b('0x9')](function(_0x44d93a){logger[_0x2b6b('0xa')](_0x2b6b('0xb'),_0x4ba90d,'request\x20sent');logger[_0x2b6b('0xc')]('Sound,\x20%s,\x20%s,\x20%s',_0x4ba90d,'request\x20sent',JSON[_0x2b6b('0xd')](_0x44d93a));if(_0x44d93a[_0x2b6b('0xe')]){if(_0x44d93a['error'][_0x2b6b('0xf')]===0x1f4){logger['error'](_0x2b6b('0xb'),_0x4ba90d,_0x44d93a[_0x2b6b('0xe')][_0x2b6b('0x10')]);return _0x6d654(_0x44d93a[_0x2b6b('0xe')]['message']);}logger[_0x2b6b('0xe')]('Sound,\x20%s,\x20%s',_0x4ba90d,_0x44d93a['error'][_0x2b6b('0x10')]);return _0x4017f3(_0x44d93a[_0x2b6b('0xe')][_0x2b6b('0x10')]);}else{logger['info'](_0x2b6b('0xb'),_0x4ba90d,_0x2b6b('0x11'));_0x4017f3(_0x44d93a[_0x2b6b('0x12')][_0x2b6b('0x10')]);}})[_0x2b6b('0x13')](function(_0x44257c){logger['error'](_0x2b6b('0xb'),_0x4ba90d,_0x44257c);_0x6d654(_0x44257c);});});}exports[_0x2b6b('0x14')]=function(_0x22d052){var _0x30f1dd=this;return new Promise(function(_0x26500b,_0x9ee361){return db['Sound']['find']({'raw':_0x22d052[_0x2b6b('0x15')]?_0x22d052['options']['raw']===undefined?!![]:![]:!![],'where':_0x22d052[_0x2b6b('0x15')]?_0x22d052[_0x2b6b('0x15')]['where']||null:null,'attributes':_0x22d052[_0x2b6b('0x15')]?_0x22d052[_0x2b6b('0x15')][_0x2b6b('0x16')]||null:null,'include':_0x22d052[_0x2b6b('0x15')]?_0x22d052[_0x2b6b('0x15')]['include']?_['map'](_0x22d052['options']['include'],function(_0x340aa8){return{'model':db[_0x340aa8['model']],'as':_0x340aa8['as'],'attributes':_0x340aa8[_0x2b6b('0x16')],'include':_0x340aa8[_0x2b6b('0x17')]?_['map'](_0x340aa8['include'],function(_0x101985){return{'model':db[_0x101985[_0x2b6b('0x18')]],'as':_0x101985['as'],'attributes':_0x101985['attributes'],'include':_0x101985[_0x2b6b('0x17')]?_[_0x2b6b('0x19')](_0x101985[_0x2b6b('0x17')],function(_0x26c944){return{'model':db[_0x26c944[_0x2b6b('0x18')]],'as':_0x26c944['as'],'attributes':_0x26c944[_0x2b6b('0x16')]};}):[]};}):[]};}):[]:[]})[_0x2b6b('0x9')](function(_0x2af795){logger[_0x2b6b('0xa')](_0x2b6b('0x14'),_0x22d052);logger[_0x2b6b('0xc')](_0x2b6b('0x14'),_0x22d052,JSON[_0x2b6b('0xd')](_0x2af795));_0x26500b(_0x2af795);})[_0x2b6b('0x13')](function(_0x27d8ee){logger[_0x2b6b('0xe')](_0x2b6b('0x14'),_0x27d8ee[_0x2b6b('0x10')],_0x22d052);_0x9ee361(_0x30f1dd[_0x2b6b('0xe')](0x1f4,_0x27d8ee['message']));});});};
\ No newline at end of file