Built motion from commit 25580385.|2.6.2
[motion2.git] / server / api / sound / sound.rpc.js
index 1ca30d0..71a16cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4e8=['request','then','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','client'];(function(_0x1abbb8,_0x3638d7){var _0x388130=function(_0x33bcc4){while(--_0x33bcc4){_0x1abbb8['push'](_0x1abbb8['shift']());}};_0x388130(++_0x3638d7);}(_0xa4e8,0xd1));var _0x8a4e=function(_0xcb6f41,_0x4759f1){_0xcb6f41=_0xcb6f41-0x0;var _0x21ced7=_0xa4e8[_0xcb6f41];return _0x21ced7;};'use strict';var _=require(_0x8a4e('0x0'));var util=require('util');var moment=require(_0x8a4e('0x1'));var BPromise=require(_0x8a4e('0x2'));var rs=require(_0x8a4e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a4e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8a4e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a4e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50e5fb,_0x4a2392,_0xf497f4){return new BPromise(function(_0xe0289c,_0x406338){return client[_0x8a4e('0x7')](_0x50e5fb,_0xf497f4)[_0x8a4e('0x8')](function(_0x5c3266){logger['info'](_0x8a4e('0x9'),_0x4a2392,_0x8a4e('0xa'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x4a2392,_0x8a4e('0xa'),JSON[_0x8a4e('0xb')](_0x5c3266));if(_0x5c3266[_0x8a4e('0xc')]){if(_0x5c3266['error']['code']===0x1f4){logger['error'](_0x8a4e('0x9'),_0x4a2392,_0x5c3266[_0x8a4e('0xc')][_0x8a4e('0xd')]);return _0x406338(_0x5c3266['error'][_0x8a4e('0xd')]);}logger[_0x8a4e('0xc')](_0x8a4e('0x9'),_0x4a2392,_0x5c3266[_0x8a4e('0xc')]['message']);return _0xe0289c(_0x5c3266[_0x8a4e('0xc')][_0x8a4e('0xd')]);}else{logger[_0x8a4e('0xe')](_0x8a4e('0x9'),_0x4a2392,'request\x20sent');_0xe0289c(_0x5c3266[_0x8a4e('0xf')]['message']);}})[_0x8a4e('0x10')](function(_0x57e0cf){logger['error'](_0x8a4e('0x9'),_0x4a2392,_0x57e0cf);_0x406338(_0x57e0cf);});});}exports[_0x8a4e('0x11')]=function(_0x151f8c){var _0x5407ee=this;return new Promise(function(_0x459607,_0x2ff9bd){return db[_0x8a4e('0x12')][_0x8a4e('0x13')]({'raw':_0x151f8c['options']?_0x151f8c[_0x8a4e('0x14')][_0x8a4e('0x15')]===undefined?!![]:![]:!![],'where':_0x151f8c['options']?_0x151f8c[_0x8a4e('0x14')][_0x8a4e('0x16')]||null:null,'attributes':_0x151f8c[_0x8a4e('0x14')]?_0x151f8c[_0x8a4e('0x14')][_0x8a4e('0x17')]||null:null,'include':_0x151f8c[_0x8a4e('0x14')]?_0x151f8c[_0x8a4e('0x14')][_0x8a4e('0x18')]?_[_0x8a4e('0x19')](_0x151f8c[_0x8a4e('0x14')][_0x8a4e('0x18')],function(_0x356936){return{'model':db[_0x356936[_0x8a4e('0x1a')]],'as':_0x356936['as'],'attributes':_0x356936[_0x8a4e('0x17')],'include':_0x356936[_0x8a4e('0x18')]?_[_0x8a4e('0x19')](_0x356936[_0x8a4e('0x18')],function(_0xc41163){return{'model':db[_0xc41163[_0x8a4e('0x1a')]],'as':_0xc41163['as'],'attributes':_0xc41163['attributes'],'include':_0xc41163[_0x8a4e('0x18')]?_[_0x8a4e('0x19')](_0xc41163[_0x8a4e('0x18')],function(_0x226951){return{'model':db[_0x226951['model']],'as':_0x226951['as'],'attributes':_0x226951[_0x8a4e('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52652c){logger['info'](_0x8a4e('0x11'),_0x151f8c);logger['debug'](_0x8a4e('0x11'),_0x151f8c,JSON['stringify'](_0x52652c));_0x459607(_0x52652c);})[_0x8a4e('0x10')](function(_0x2d0488){logger[_0x8a4e('0xc')](_0x8a4e('0x11'),_0x2d0488[_0x8a4e('0xd')],_0x151f8c);_0x2ff9bd(_0x5407ee['error'](0x1f4,_0x2d0488[_0x8a4e('0xd')]));});});};
\ No newline at end of file
+var _0xf367=['options','raw','where','include','map','model','attributes','debug','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','client','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','Sound','find'];(function(_0x37d2c6,_0x5d68e3){var _0xa2cc99=function(_0x417c54){while(--_0x417c54){_0x37d2c6['push'](_0x37d2c6['shift']());}};_0xa2cc99(++_0x5d68e3);}(_0xf367,0x120));var _0x7f36=function(_0x522d0e,_0x1be748){_0x522d0e=_0x522d0e-0x0;var _0x5c0e1e=_0xf367[_0x522d0e];return _0x5c0e1e;};'use strict';var _=require('lodash');var util=require(_0x7f36('0x0'));var moment=require(_0x7f36('0x1'));var BPromise=require(_0x7f36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f36('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f36('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7f36('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7f36('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe337a9,_0x517fe4,_0x10a879){return new BPromise(function(_0x38ee33,_0x38c6e0){return client['request'](_0xe337a9,_0x10a879)[_0x7f36('0x7')](function(_0x4fa84b){logger[_0x7f36('0x8')](_0x7f36('0x9'),_0x517fe4,_0x7f36('0xa'));logger['debug'](_0x7f36('0xb'),_0x517fe4,_0x7f36('0xa'),JSON[_0x7f36('0xc')](_0x4fa84b));if(_0x4fa84b['error']){if(_0x4fa84b[_0x7f36('0xd')][_0x7f36('0xe')]===0x1f4){logger[_0x7f36('0xd')](_0x7f36('0x9'),_0x517fe4,_0x4fa84b['error']['message']);return _0x38c6e0(_0x4fa84b['error']['message']);}logger[_0x7f36('0xd')]('Sound,\x20%s,\x20%s',_0x517fe4,_0x4fa84b[_0x7f36('0xd')][_0x7f36('0xf')]);return _0x38ee33(_0x4fa84b[_0x7f36('0xd')][_0x7f36('0xf')]);}else{logger['info'](_0x7f36('0x9'),_0x517fe4,_0x7f36('0xa'));_0x38ee33(_0x4fa84b['result'][_0x7f36('0xf')]);}})[_0x7f36('0x10')](function(_0x38a6ce){logger[_0x7f36('0xd')](_0x7f36('0x9'),_0x517fe4,_0x38a6ce);_0x38c6e0(_0x38a6ce);});});}exports[_0x7f36('0x11')]=function(_0x1e6371){var _0x2a48a8=this;return new Promise(function(_0x5aca2a,_0x1100fb){return db[_0x7f36('0x12')][_0x7f36('0x13')]({'raw':_0x1e6371[_0x7f36('0x14')]?_0x1e6371[_0x7f36('0x14')][_0x7f36('0x15')]===undefined?!![]:![]:!![],'where':_0x1e6371[_0x7f36('0x14')]?_0x1e6371[_0x7f36('0x14')][_0x7f36('0x16')]||null:null,'attributes':_0x1e6371[_0x7f36('0x14')]?_0x1e6371[_0x7f36('0x14')]['attributes']||null:null,'include':_0x1e6371['options']?_0x1e6371['options'][_0x7f36('0x17')]?_[_0x7f36('0x18')](_0x1e6371[_0x7f36('0x14')][_0x7f36('0x17')],function(_0x3cde7f){return{'model':db[_0x3cde7f[_0x7f36('0x19')]],'as':_0x3cde7f['as'],'attributes':_0x3cde7f[_0x7f36('0x1a')],'include':_0x3cde7f[_0x7f36('0x17')]?_[_0x7f36('0x18')](_0x3cde7f[_0x7f36('0x17')],function(_0x3d2414){return{'model':db[_0x3d2414[_0x7f36('0x19')]],'as':_0x3d2414['as'],'attributes':_0x3d2414[_0x7f36('0x1a')],'include':_0x3d2414[_0x7f36('0x17')]?_[_0x7f36('0x18')](_0x3d2414[_0x7f36('0x17')],function(_0x3f4570){return{'model':db[_0x3f4570[_0x7f36('0x19')]],'as':_0x3f4570['as'],'attributes':_0x3f4570['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f36('0x7')](function(_0x47d7fe){logger['info']('ShowSound',_0x1e6371);logger[_0x7f36('0x1b')](_0x7f36('0x11'),_0x1e6371,JSON['stringify'](_0x47d7fe));_0x5aca2a(_0x47d7fe);})[_0x7f36('0x10')](function(_0x2a13d0){logger[_0x7f36('0xd')](_0x7f36('0x11'),_0x2a13d0['message'],_0x1e6371);_0x1100fb(_0x2a48a8[_0x7f36('0xd')](0x1f4,_0x2a13d0[_0x7f36('0xf')]));});});};
\ No newline at end of file