Built motion from commit 5ba5b610.|2.5.33
[motion2.git] / server / api / voiceCallReport / voiceCallReport.rpc.js
index a47e53d..0c64b4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa72f=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','VoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xa72f,0x12a));var _0xfa72=function(_0x6aad74,_0x32ecf4){_0x6aad74=_0x6aad74-0x0;var _0x5b1c38=_0xa72f[_0x6aad74];return _0x5b1c38;};'use strict';var _=require(_0xfa72('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa72('0x1'));var db=require(_0xfa72('0x2'))['db'];var utils=require(_0xfa72('0x3'));var logger=require(_0xfa72('0x4'))(_0xfa72('0x5'));var config=require(_0xfa72('0x6'));var jayson=require(_0xfa72('0x7'));var client=jayson['client'][_0xfa72('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1febde,_0x2b52db,_0x903ae1){return new BPromise(function(_0x1b6088,_0x41327d){return client[_0xfa72('0x9')](_0x1febde,_0x903ae1)[_0xfa72('0xa')](function(_0x1fa886){logger[_0xfa72('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x2b52db,_0xfa72('0xc'));logger[_0xfa72('0xd')](_0xfa72('0xe'),_0x2b52db,_0xfa72('0xc'),JSON[_0xfa72('0xf')](_0x1fa886));if(_0x1fa886[_0xfa72('0x10')]){if(_0x1fa886[_0xfa72('0x10')][_0xfa72('0x11')]===0x1f4){logger['error'](_0xfa72('0x12'),_0x2b52db,_0x1fa886[_0xfa72('0x10')][_0xfa72('0x13')]);return _0x41327d(_0x1fa886[_0xfa72('0x10')][_0xfa72('0x13')]);}logger[_0xfa72('0x10')](_0xfa72('0x12'),_0x2b52db,_0x1fa886['error'][_0xfa72('0x13')]);return _0x1b6088(_0x1fa886[_0xfa72('0x10')]['message']);}else{logger['info'](_0xfa72('0x12'),_0x2b52db,'request\x20sent');_0x1b6088(_0x1fa886[_0xfa72('0x14')][_0xfa72('0x13')]);}})[_0xfa72('0x15')](function(_0xa22813){logger[_0xfa72('0x10')](_0xfa72('0x12'),_0x2b52db,_0xa22813);_0x41327d(_0xa22813);});});}exports[_0xfa72('0x16')]=function(_0x27faea){var _0x5c3ad4=this;return new Promise(function(_0x153739,_0x4892a8){return db['VoiceCallReport'][_0xfa72('0x17')]({'raw':_0x27faea[_0xfa72('0x18')]?_0x27faea[_0xfa72('0x18')][_0xfa72('0x19')]===undefined?!![]:![]:!![],'where':_0x27faea[_0xfa72('0x18')]?_0x27faea[_0xfa72('0x18')][_0xfa72('0x1a')]||null:null,'attributes':_0x27faea[_0xfa72('0x18')]?_0x27faea[_0xfa72('0x18')][_0xfa72('0x1b')]||null:null,'limit':_0x27faea[_0xfa72('0x18')]?_0x27faea[_0xfa72('0x18')][_0xfa72('0x1c')]||null:null,'include':_0x27faea['options']?_0x27faea[_0xfa72('0x18')][_0xfa72('0x1d')]?_[_0xfa72('0x1e')](_0x27faea[_0xfa72('0x18')][_0xfa72('0x1d')],function(_0x1f558c){return{'model':db[_0x1f558c['model']],'as':_0x1f558c['as'],'attributes':_0x1f558c[_0xfa72('0x1b')],'include':_0x1f558c[_0xfa72('0x1d')]?_[_0xfa72('0x1e')](_0x1f558c[_0xfa72('0x1d')],function(_0x412f2f){return{'model':db[_0x412f2f['model']],'as':_0x412f2f['as'],'attributes':_0x412f2f[_0xfa72('0x1b')],'include':_0x412f2f[_0xfa72('0x1d')]?_[_0xfa72('0x1e')](_0x412f2f[_0xfa72('0x1d')],function(_0x189924){return{'model':db[_0x189924[_0xfa72('0x1f')]],'as':_0x189924['as'],'attributes':_0x189924[_0xfa72('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfa72('0xa')](function(_0x5d0611){logger[_0xfa72('0xb')](_0xfa72('0x16'),_0x27faea);logger['debug'](_0xfa72('0x16'),_0x27faea,JSON[_0xfa72('0xf')](_0x5d0611));_0x153739(_0x5d0611);})[_0xfa72('0x15')](function(_0x176621){logger['error'](_0xfa72('0x16'),_0x176621[_0xfa72('0x13')],_0x27faea);_0x4892a8(_0x5c3ad4[_0xfa72('0x10')](0x1f4,_0x176621['message']));});});};exports[_0xfa72('0x20')]=function(_0x110677){var _0x4ae9dc=this;return new Promise(function(_0x148d48,_0x4bde20){return db[_0xfa72('0x21')][_0xfa72('0x22')](_0x110677[_0xfa72('0x23')],{'raw':_0x110677[_0xfa72('0x18')]?_0x110677[_0xfa72('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xfa72('0xa')](function(_0x4380e6){logger[_0xfa72('0xb')](_0xfa72('0x20'),_0x110677);logger['debug'](_0xfa72('0x20'),_0x110677,JSON['stringify'](_0x4380e6));_0x148d48(_0x4380e6);})[_0xfa72('0x15')](function(_0x53a866){logger['error'](_0xfa72('0x20'),_0x53a866[_0xfa72('0x13')],_0x110677);_0x4bde20(_0x4ae9dc['error'](0x1f4,_0x53a866[_0xfa72('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x342c41){var _0x2496ec=this;return new Promise(function(_0x401edb,_0x220845){return db[_0xfa72('0x21')][_0xfa72('0x24')](_0x342c41['body'],{'raw':_0x342c41[_0xfa72('0x18')]?_0x342c41[_0xfa72('0x18')][_0xfa72('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x342c41[_0xfa72('0x18')]?_0x342c41[_0xfa72('0x18')][_0xfa72('0x1a')]||null:null,'attributes':_0x342c41[_0xfa72('0x18')]?_0x342c41[_0xfa72('0x18')][_0xfa72('0x1b')]||null:null,'limit':_0x342c41[_0xfa72('0x18')]?_0x342c41[_0xfa72('0x18')]['limit']||null:null})['then'](function(_0x448e53){logger[_0xfa72('0xb')]('UpdateVoiceCallReport',_0x342c41);logger[_0xfa72('0xd')](_0xfa72('0x25'),_0x342c41,JSON[_0xfa72('0xf')](_0x448e53));_0x401edb(_0x448e53);})[_0xfa72('0x15')](function(_0x521e4a){logger[_0xfa72('0x10')]('UpdateVoiceCallReport',_0x521e4a[_0xfa72('0x13')],_0x342c41);_0x220845(_0x2496ec[_0xfa72('0x10')](0x1f4,_0x521e4a[_0xfa72('0x13')]));});});};
\ No newline at end of file
+var _0xa011=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','UpdateVoiceCallReport','update','body','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2b6167,_0x43338e){var _0x2968d0=function(_0x166d7a){while(--_0x166d7a){_0x2b6167['push'](_0x2b6167['shift']());}};_0x2968d0(++_0x43338e);}(_0xa011,0x1b2));var _0x1a01=function(_0x31e3dc,_0x1aec13){_0x31e3dc=_0x31e3dc-0x0;var _0x31db3e=_0xa011[_0x31e3dc];return _0x31db3e;};'use strict';var _=require(_0x1a01('0x0'));var util=require('util');var moment=require(_0x1a01('0x1'));var BPromise=require(_0x1a01('0x2'));var rs=require(_0x1a01('0x3'));var fs=require('fs');var Redis=require(_0x1a01('0x4'));var db=require(_0x1a01('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a01('0x6'))(_0x1a01('0x7'));var config=require(_0x1a01('0x8'));var jayson=require(_0x1a01('0x9'));var client=jayson[_0x1a01('0xa')][_0x1a01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4be912,_0x1ee18b,_0x158351){return new BPromise(function(_0x55cd8d,_0x53517e){return client[_0x1a01('0xc')](_0x4be912,_0x158351)[_0x1a01('0xd')](function(_0x1d1fd6){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x1ee18b,_0x1a01('0xe'));logger[_0x1a01('0xf')](_0x1a01('0x10'),_0x1ee18b,'request\x20sent',JSON[_0x1a01('0x11')](_0x1d1fd6));if(_0x1d1fd6[_0x1a01('0x12')]){if(_0x1d1fd6['error'][_0x1a01('0x13')]===0x1f4){logger[_0x1a01('0x12')](_0x1a01('0x14'),_0x1ee18b,_0x1d1fd6['error'][_0x1a01('0x15')]);return _0x53517e(_0x1d1fd6[_0x1a01('0x12')][_0x1a01('0x15')]);}logger[_0x1a01('0x12')](_0x1a01('0x14'),_0x1ee18b,_0x1d1fd6[_0x1a01('0x12')]['message']);return _0x55cd8d(_0x1d1fd6[_0x1a01('0x12')][_0x1a01('0x15')]);}else{logger[_0x1a01('0x16')](_0x1a01('0x14'),_0x1ee18b,_0x1a01('0xe'));_0x55cd8d(_0x1d1fd6[_0x1a01('0x17')]['message']);}})[_0x1a01('0x18')](function(_0x5d2cc6){logger[_0x1a01('0x12')](_0x1a01('0x14'),_0x1ee18b,_0x5d2cc6);_0x53517e(_0x5d2cc6);});});}exports[_0x1a01('0x19')]=function(_0x15d715){var _0x31464a=this;return new Promise(function(_0x3e47c4,_0x186dad){return db[_0x1a01('0x1a')][_0x1a01('0x1b')]({'raw':_0x15d715[_0x1a01('0x1c')]?_0x15d715['options'][_0x1a01('0x1d')]===undefined?!![]:![]:!![],'where':_0x15d715[_0x1a01('0x1c')]?_0x15d715[_0x1a01('0x1c')][_0x1a01('0x1e')]||null:null,'attributes':_0x15d715[_0x1a01('0x1c')]?_0x15d715[_0x1a01('0x1c')][_0x1a01('0x1f')]||null:null,'limit':_0x15d715['options']?_0x15d715[_0x1a01('0x1c')][_0x1a01('0x20')]||null:null,'include':_0x15d715[_0x1a01('0x1c')]?_0x15d715[_0x1a01('0x1c')][_0x1a01('0x21')]?_[_0x1a01('0x22')](_0x15d715[_0x1a01('0x1c')][_0x1a01('0x21')],function(_0xac8db4){return{'model':db[_0xac8db4[_0x1a01('0x23')]],'as':_0xac8db4['as'],'attributes':_0xac8db4['attributes'],'include':_0xac8db4[_0x1a01('0x21')]?_[_0x1a01('0x22')](_0xac8db4[_0x1a01('0x21')],function(_0x149189){return{'model':db[_0x149189[_0x1a01('0x23')]],'as':_0x149189['as'],'attributes':_0x149189[_0x1a01('0x1f')],'include':_0x149189['include']?_[_0x1a01('0x22')](_0x149189['include'],function(_0x4e8271){return{'model':db[_0x4e8271['model']],'as':_0x4e8271['as'],'attributes':_0x4e8271[_0x1a01('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a01('0xd')](function(_0x44fe0d){logger[_0x1a01('0x16')](_0x1a01('0x19'),_0x15d715);logger[_0x1a01('0xf')]('GetVoiceCallReport',_0x15d715,JSON['stringify'](_0x44fe0d));_0x3e47c4(_0x44fe0d);})['catch'](function(_0x59d0a2){logger[_0x1a01('0x12')](_0x1a01('0x19'),_0x59d0a2[_0x1a01('0x15')],_0x15d715);_0x186dad(_0x31464a[_0x1a01('0x12')](0x1f4,_0x59d0a2[_0x1a01('0x15')]));});});};exports[_0x1a01('0x24')]=function(_0x1116e8){var _0x219b02=this;return new Promise(function(_0x51bca7,_0x102ce5){return db[_0x1a01('0x1a')]['create'](_0x1116e8['body'],{'raw':_0x1116e8['options']?_0x1116e8[_0x1a01('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x1a01('0xd')](function(_0x1af97e){logger[_0x1a01('0x16')](_0x1a01('0x24'),_0x1116e8);logger['debug']('CreateVoiceCallReport',_0x1116e8,JSON[_0x1a01('0x11')](_0x1af97e));_0x51bca7(_0x1af97e);})[_0x1a01('0x18')](function(_0x14567b){logger[_0x1a01('0x12')](_0x1a01('0x24'),_0x14567b[_0x1a01('0x15')],_0x1116e8);_0x102ce5(_0x219b02[_0x1a01('0x12')](0x1f4,_0x14567b[_0x1a01('0x15')]));});});};exports[_0x1a01('0x25')]=function(_0x584cd6){var _0x15b78a=this;return new Promise(function(_0x450104,_0x2d9fe2){return db[_0x1a01('0x1a')][_0x1a01('0x26')](_0x584cd6[_0x1a01('0x27')],{'raw':_0x584cd6[_0x1a01('0x1c')]?_0x584cd6[_0x1a01('0x1c')][_0x1a01('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x584cd6['options']?_0x584cd6['options'][_0x1a01('0x1e')]||null:null,'attributes':_0x584cd6[_0x1a01('0x1c')]?_0x584cd6[_0x1a01('0x1c')]['attributes']||null:null,'limit':_0x584cd6[_0x1a01('0x1c')]?_0x584cd6[_0x1a01('0x1c')][_0x1a01('0x20')]||null:null})[_0x1a01('0xd')](function(_0x566150){logger[_0x1a01('0x16')]('UpdateVoiceCallReport',_0x584cd6);logger[_0x1a01('0xf')](_0x1a01('0x25'),_0x584cd6,JSON[_0x1a01('0x11')](_0x566150));_0x450104(_0x566150);})[_0x1a01('0x18')](function(_0x15a519){logger['error'](_0x1a01('0x25'),_0x15a519[_0x1a01('0x15')],_0x584cd6);_0x2d9fe2(_0x15b78a[_0x1a01('0x12')](0x1f4,_0x15a519[_0x1a01('0x15')]));});});};
\ No newline at end of file