Built motion from commit cb845558.|2.6.34
[motion2.git] / server / api / sound / sound.rpc.js
index a828d57..d20774d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00db=['ShowSound','Sound','options','raw','where','attributes','map','model','include','catch','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0x00db,0x166));var _0xb00d=function(_0x5cdb47,_0x1e43d6){_0x5cdb47=_0x5cdb47-0x0;var _0x5c5e2b=_0x00db[_0x5cdb47];return _0x5c5e2b;};'use strict';var _=require('lodash');var util=require(_0xb00d('0x0'));var moment=require(_0xb00d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb00d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb00d('0x3'))(_0xb00d('0x4'));var config=require(_0xb00d('0x5'));var jayson=require(_0xb00d('0x6'));var client=jayson['client'][_0xb00d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x284ea7,_0x45b616,_0x3ce941){return new BPromise(function(_0x3b9f8a,_0x17c87f){return client[_0xb00d('0x8')](_0x284ea7,_0x3ce941)[_0xb00d('0x9')](function(_0x56a9cd){logger[_0xb00d('0xa')](_0xb00d('0xb'),_0x45b616,_0xb00d('0xc'));logger[_0xb00d('0xd')](_0xb00d('0xe'),_0x45b616,'request\x20sent',JSON[_0xb00d('0xf')](_0x56a9cd));if(_0x56a9cd[_0xb00d('0x10')]){if(_0x56a9cd[_0xb00d('0x10')]['code']===0x1f4){logger[_0xb00d('0x10')](_0xb00d('0xb'),_0x45b616,_0x56a9cd[_0xb00d('0x10')][_0xb00d('0x11')]);return _0x17c87f(_0x56a9cd['error'][_0xb00d('0x11')]);}logger[_0xb00d('0x10')](_0xb00d('0xb'),_0x45b616,_0x56a9cd[_0xb00d('0x10')][_0xb00d('0x11')]);return _0x3b9f8a(_0x56a9cd[_0xb00d('0x10')][_0xb00d('0x11')]);}else{logger[_0xb00d('0xa')](_0xb00d('0xb'),_0x45b616,_0xb00d('0xc'));_0x3b9f8a(_0x56a9cd[_0xb00d('0x12')]['message']);}})['catch'](function(_0x45f127){logger[_0xb00d('0x10')](_0xb00d('0xb'),_0x45b616,_0x45f127);_0x17c87f(_0x45f127);});});}exports[_0xb00d('0x13')]=function(_0x1fa748){var _0xd62938=this;return new Promise(function(_0x2c9a70,_0x5c16ea){return db[_0xb00d('0x14')]['find']({'raw':_0x1fa748[_0xb00d('0x15')]?_0x1fa748[_0xb00d('0x15')][_0xb00d('0x16')]===undefined?!![]:![]:!![],'where':_0x1fa748[_0xb00d('0x15')]?_0x1fa748['options'][_0xb00d('0x17')]||null:null,'attributes':_0x1fa748['options']?_0x1fa748['options'][_0xb00d('0x18')]||null:null,'include':_0x1fa748[_0xb00d('0x15')]?_0x1fa748[_0xb00d('0x15')]['include']?_[_0xb00d('0x19')](_0x1fa748[_0xb00d('0x15')]['include'],function(_0x548cb8){return{'model':db[_0x548cb8[_0xb00d('0x1a')]],'as':_0x548cb8['as'],'attributes':_0x548cb8['attributes'],'include':_0x548cb8[_0xb00d('0x1b')]?_['map'](_0x548cb8[_0xb00d('0x1b')],function(_0x22fe53){return{'model':db[_0x22fe53['model']],'as':_0x22fe53['as'],'attributes':_0x22fe53['attributes'],'include':_0x22fe53['include']?_[_0xb00d('0x19')](_0x22fe53[_0xb00d('0x1b')],function(_0x11dce4){return{'model':db[_0x11dce4[_0xb00d('0x1a')]],'as':_0x11dce4['as'],'attributes':_0x11dce4[_0xb00d('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb00d('0x9')](function(_0x7b9d6f){logger[_0xb00d('0xa')]('ShowSound',_0x1fa748);logger[_0xb00d('0xd')](_0xb00d('0x13'),_0x1fa748,JSON[_0xb00d('0xf')](_0x7b9d6f));_0x2c9a70(_0x7b9d6f);})[_0xb00d('0x1c')](function(_0x58d134){logger[_0xb00d('0x10')](_0xb00d('0x13'),_0x58d134[_0xb00d('0x11')],_0x1fa748);_0x5c16ea(_0xd62938[_0xb00d('0x10')](0x1f4,_0x58d134[_0xb00d('0x11')]));});});};
\ No newline at end of file
+var _0x72f3=['debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','find','options','raw','where','attributes','map','include','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x1d062d,_0x17fa78){var _0x40e450=function(_0x3fb53e){while(--_0x3fb53e){_0x1d062d['push'](_0x1d062d['shift']());}};_0x40e450(++_0x17fa78);}(_0x72f3,0xd8));var _0x372f=function(_0x2e4441,_0x366096){_0x2e4441=_0x2e4441-0x0;var _0x3f1c00=_0x72f3[_0x2e4441];return _0x3f1c00;};'use strict';var _=require(_0x372f('0x0'));var util=require(_0x372f('0x1'));var moment=require('moment');var BPromise=require(_0x372f('0x2'));var rs=require(_0x372f('0x3'));var fs=require('fs');var Redis=require(_0x372f('0x4'));var db=require(_0x372f('0x5'))['db'];var utils=require(_0x372f('0x6'));var logger=require('../../config/logger')(_0x372f('0x7'));var config=require(_0x372f('0x8'));var jayson=require(_0x372f('0x9'));var client=jayson[_0x372f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1663,_0x39188c,_0x410f9a){return new BPromise(function(_0x17f3dc,_0x47c0c4){return client[_0x372f('0xb')](_0x4d1663,_0x410f9a)[_0x372f('0xc')](function(_0x1d9bbb){logger['info'](_0x372f('0xd'),_0x39188c,_0x372f('0xe'));logger[_0x372f('0xf')](_0x372f('0x10'),_0x39188c,_0x372f('0xe'),JSON[_0x372f('0x11')](_0x1d9bbb));if(_0x1d9bbb[_0x372f('0x12')]){if(_0x1d9bbb['error'][_0x372f('0x13')]===0x1f4){logger[_0x372f('0x12')](_0x372f('0xd'),_0x39188c,_0x1d9bbb[_0x372f('0x12')]['message']);return _0x47c0c4(_0x1d9bbb[_0x372f('0x12')][_0x372f('0x14')]);}logger[_0x372f('0x12')]('Sound,\x20%s,\x20%s',_0x39188c,_0x1d9bbb['error'][_0x372f('0x14')]);return _0x17f3dc(_0x1d9bbb['error'][_0x372f('0x14')]);}else{logger[_0x372f('0x15')](_0x372f('0xd'),_0x39188c,_0x372f('0xe'));_0x17f3dc(_0x1d9bbb[_0x372f('0x16')][_0x372f('0x14')]);}})[_0x372f('0x17')](function(_0x2bc523){logger[_0x372f('0x12')](_0x372f('0xd'),_0x39188c,_0x2bc523);_0x47c0c4(_0x2bc523);});});}exports[_0x372f('0x18')]=function(_0x504956){var _0x418171=this;return new Promise(function(_0x229f0a,_0x1ff340){return db['Sound'][_0x372f('0x19')]({'raw':_0x504956['options']?_0x504956[_0x372f('0x1a')][_0x372f('0x1b')]===undefined?!![]:![]:!![],'where':_0x504956[_0x372f('0x1a')]?_0x504956[_0x372f('0x1a')][_0x372f('0x1c')]||null:null,'attributes':_0x504956[_0x372f('0x1a')]?_0x504956[_0x372f('0x1a')][_0x372f('0x1d')]||null:null,'include':_0x504956[_0x372f('0x1a')]?_0x504956[_0x372f('0x1a')]['include']?_[_0x372f('0x1e')](_0x504956[_0x372f('0x1a')][_0x372f('0x1f')],function(_0x2efa2d){return{'model':db[_0x2efa2d[_0x372f('0x20')]],'as':_0x2efa2d['as'],'attributes':_0x2efa2d[_0x372f('0x1d')],'include':_0x2efa2d[_0x372f('0x1f')]?_['map'](_0x2efa2d[_0x372f('0x1f')],function(_0x4773be){return{'model':db[_0x4773be['model']],'as':_0x4773be['as'],'attributes':_0x4773be['attributes'],'include':_0x4773be[_0x372f('0x1f')]?_[_0x372f('0x1e')](_0x4773be[_0x372f('0x1f')],function(_0x54a40b){return{'model':db[_0x54a40b[_0x372f('0x20')]],'as':_0x54a40b['as'],'attributes':_0x54a40b[_0x372f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x372f('0xc')](function(_0x40ab62){logger[_0x372f('0x15')](_0x372f('0x18'),_0x504956);logger['debug'](_0x372f('0x18'),_0x504956,JSON[_0x372f('0x11')](_0x40ab62));_0x229f0a(_0x40ab62);})['catch'](function(_0x7b42d5){logger[_0x372f('0x12')](_0x372f('0x18'),_0x7b42d5[_0x372f('0x14')],_0x504956);_0x1ff340(_0x418171[_0x372f('0x12')](0x1f4,_0x7b42d5['message']));});});};
\ No newline at end of file