Built motion from commit 20b39a97.|2.6.29
[motion2.git] / server / api / voiceCallReport / voiceCallReport.rpc.js
index cdd4674..934bb3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x739f=['../../config/environment','jayson/promise','client','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','debug','CreateVoiceCallReport','create','UpdateVoiceCallReport','body','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x739f,0x8d));var _0xf739=function(_0x548a53,_0x1fdb02){_0x548a53=_0x548a53-0x0;var _0x4177ed=_0x739f[_0x548a53];return _0x4177ed;};'use strict';var _=require('lodash');var util=require(_0xf739('0x0'));var moment=require(_0xf739('0x1'));var BPromise=require(_0xf739('0x2'));var rs=require(_0xf739('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf739('0x4'))['db'];var utils=require(_0xf739('0x5'));var logger=require(_0xf739('0x6'))('rpc');var config=require(_0xf739('0x7'));var jayson=require(_0xf739('0x8'));var client=jayson[_0xf739('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cafcf,_0x16d4c8,_0x41a1e0){return new BPromise(function(_0x4bb784,_0xf62e4f){return client[_0xf739('0xa')](_0x2cafcf,_0x41a1e0)[_0xf739('0xb')](function(_0x306b3c){logger['info'](_0xf739('0xc'),_0x16d4c8,_0xf739('0xd'));logger['debug'](_0xf739('0xe'),_0x16d4c8,_0xf739('0xd'),JSON[_0xf739('0xf')](_0x306b3c));if(_0x306b3c[_0xf739('0x10')]){if(_0x306b3c[_0xf739('0x10')]['code']===0x1f4){logger[_0xf739('0x10')](_0xf739('0xc'),_0x16d4c8,_0x306b3c[_0xf739('0x10')][_0xf739('0x11')]);return _0xf62e4f(_0x306b3c[_0xf739('0x10')][_0xf739('0x11')]);}logger[_0xf739('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x16d4c8,_0x306b3c['error'][_0xf739('0x11')]);return _0x4bb784(_0x306b3c[_0xf739('0x10')][_0xf739('0x11')]);}else{logger[_0xf739('0x12')](_0xf739('0xc'),_0x16d4c8,_0xf739('0xd'));_0x4bb784(_0x306b3c[_0xf739('0x13')][_0xf739('0x11')]);}})[_0xf739('0x14')](function(_0xb0457){logger[_0xf739('0x10')](_0xf739('0xc'),_0x16d4c8,_0xb0457);_0xf62e4f(_0xb0457);});});}exports[_0xf739('0x15')]=function(_0x78f0ab){var _0x20c9af=this;return new Promise(function(_0x3807b7,_0x443f37){return db[_0xf739('0x16')][_0xf739('0x17')]({'raw':_0x78f0ab[_0xf739('0x18')]?_0x78f0ab[_0xf739('0x18')][_0xf739('0x19')]===undefined?!![]:![]:!![],'where':_0x78f0ab[_0xf739('0x18')]?_0x78f0ab['options'][_0xf739('0x1a')]||null:null,'attributes':_0x78f0ab[_0xf739('0x18')]?_0x78f0ab[_0xf739('0x18')][_0xf739('0x1b')]||null:null,'limit':_0x78f0ab['options']?_0x78f0ab['options'][_0xf739('0x1c')]||null:null,'include':_0x78f0ab['options']?_0x78f0ab[_0xf739('0x18')]['include']?_['map'](_0x78f0ab[_0xf739('0x18')][_0xf739('0x1d')],function(_0x17fe25){return{'model':db[_0x17fe25[_0xf739('0x1e')]],'as':_0x17fe25['as'],'attributes':_0x17fe25[_0xf739('0x1b')],'include':_0x17fe25['include']?_[_0xf739('0x1f')](_0x17fe25['include'],function(_0x139b97){return{'model':db[_0x139b97[_0xf739('0x1e')]],'as':_0x139b97['as'],'attributes':_0x139b97[_0xf739('0x1b')],'include':_0x139b97['include']?_[_0xf739('0x1f')](_0x139b97[_0xf739('0x1d')],function(_0x2c1bbb){return{'model':db[_0x2c1bbb['model']],'as':_0x2c1bbb['as'],'attributes':_0x2c1bbb[_0xf739('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf739('0xb')](function(_0x4a161c){logger['info'](_0xf739('0x15'),_0x78f0ab);logger[_0xf739('0x20')](_0xf739('0x15'),_0x78f0ab,JSON[_0xf739('0xf')](_0x4a161c));_0x3807b7(_0x4a161c);})[_0xf739('0x14')](function(_0x4c079f){logger[_0xf739('0x10')](_0xf739('0x15'),_0x4c079f[_0xf739('0x11')],_0x78f0ab);_0x443f37(_0x20c9af[_0xf739('0x10')](0x1f4,_0x4c079f[_0xf739('0x11')]));});});};exports[_0xf739('0x21')]=function(_0x570f48){var _0x5bb382=this;return new Promise(function(_0x126a24,_0x5e7e61){return db[_0xf739('0x16')][_0xf739('0x22')](_0x570f48['body'],{'raw':_0x570f48[_0xf739('0x18')]?_0x570f48[_0xf739('0x18')][_0xf739('0x19')]===undefined?!![]:![]:!![]})[_0xf739('0xb')](function(_0xefffbd){logger[_0xf739('0x12')](_0xf739('0x21'),_0x570f48);logger[_0xf739('0x20')](_0xf739('0x21'),_0x570f48,JSON['stringify'](_0xefffbd));_0x126a24(_0xefffbd);})[_0xf739('0x14')](function(_0x36f719){logger[_0xf739('0x10')](_0xf739('0x21'),_0x36f719[_0xf739('0x11')],_0x570f48);_0x5e7e61(_0x5bb382['error'](0x1f4,_0x36f719[_0xf739('0x11')]));});});};exports[_0xf739('0x23')]=function(_0x58361b){var _0x2e98da=this;return new Promise(function(_0x17bb26,_0x26abaa){return db['VoiceCallReport']['update'](_0x58361b[_0xf739('0x24')],{'raw':_0x58361b['options']?_0x58361b[_0xf739('0x18')][_0xf739('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58361b[_0xf739('0x18')]?_0x58361b[_0xf739('0x18')][_0xf739('0x1a')]||null:null,'attributes':_0x58361b[_0xf739('0x18')]?_0x58361b[_0xf739('0x18')][_0xf739('0x1b')]||null:null,'limit':_0x58361b[_0xf739('0x18')]?_0x58361b[_0xf739('0x18')][_0xf739('0x1c')]||null:null})['then'](function(_0x54cbf9){logger[_0xf739('0x12')]('UpdateVoiceCallReport',_0x58361b);logger['debug'](_0xf739('0x23'),_0x58361b,JSON['stringify'](_0x54cbf9));_0x17bb26(_0x54cbf9);})['catch'](function(_0x1cb58b){logger[_0xf739('0x10')](_0xf739('0x23'),_0x1cb58b[_0xf739('0x11')],_0x58361b);_0x26abaa(_0x2e98da[_0xf739('0x10')](0x1f4,_0x1cb58b['message']));});});};
\ No newline at end of file
+var _0xf6a8=['raw','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','VoiceCallReport','options'];(function(_0x1bb6ce,_0x52d276){var _0x29ba72=function(_0x3ae2ec){while(--_0x3ae2ec){_0x1bb6ce['push'](_0x1bb6ce['shift']());}};_0x29ba72(++_0x52d276);}(_0xf6a8,0x1ed));var _0x8f6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6a8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8f6a('0x0'));var util=require(_0x8f6a('0x1'));var moment=require(_0x8f6a('0x2'));var BPromise=require(_0x8f6a('0x3'));var rs=require(_0x8f6a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f6a('0x5'));var logger=require(_0x8f6a('0x6'))(_0x8f6a('0x7'));var config=require(_0x8f6a('0x8'));var jayson=require(_0x8f6a('0x9'));var client=jayson[_0x8f6a('0xa')][_0x8f6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x283417,_0x1dcbfe,_0x49c942){return new BPromise(function(_0x106774,_0x22c2a0){return client[_0x8f6a('0xc')](_0x283417,_0x49c942)[_0x8f6a('0xd')](function(_0x3422fc){logger[_0x8f6a('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x1dcbfe,'request\x20sent');logger[_0x8f6a('0xf')](_0x8f6a('0x10'),_0x1dcbfe,_0x8f6a('0x11'),JSON[_0x8f6a('0x12')](_0x3422fc));if(_0x3422fc[_0x8f6a('0x13')]){if(_0x3422fc[_0x8f6a('0x13')][_0x8f6a('0x14')]===0x1f4){logger[_0x8f6a('0x13')](_0x8f6a('0x15'),_0x1dcbfe,_0x3422fc[_0x8f6a('0x13')]['message']);return _0x22c2a0(_0x3422fc[_0x8f6a('0x13')][_0x8f6a('0x16')]);}logger[_0x8f6a('0x13')](_0x8f6a('0x15'),_0x1dcbfe,_0x3422fc[_0x8f6a('0x13')][_0x8f6a('0x16')]);return _0x106774(_0x3422fc[_0x8f6a('0x13')][_0x8f6a('0x16')]);}else{logger[_0x8f6a('0xe')](_0x8f6a('0x15'),_0x1dcbfe,_0x8f6a('0x11'));_0x106774(_0x3422fc[_0x8f6a('0x17')][_0x8f6a('0x16')]);}})[_0x8f6a('0x18')](function(_0x2d2890){logger[_0x8f6a('0x13')](_0x8f6a('0x15'),_0x1dcbfe,_0x2d2890);_0x22c2a0(_0x2d2890);});});}exports['GetVoiceCallReport']=function(_0x1cdabb){var _0x2fd945=this;return new Promise(function(_0x27003c,_0x12c49){return db[_0x8f6a('0x19')]['findAll']({'raw':_0x1cdabb[_0x8f6a('0x1a')]?_0x1cdabb[_0x8f6a('0x1a')][_0x8f6a('0x1b')]===undefined?!![]:![]:!![],'where':_0x1cdabb[_0x8f6a('0x1a')]?_0x1cdabb['options'][_0x8f6a('0x1c')]||null:null,'attributes':_0x1cdabb[_0x8f6a('0x1a')]?_0x1cdabb[_0x8f6a('0x1a')][_0x8f6a('0x1d')]||null:null,'limit':_0x1cdabb[_0x8f6a('0x1a')]?_0x1cdabb[_0x8f6a('0x1a')][_0x8f6a('0x1e')]||null:null,'include':_0x1cdabb[_0x8f6a('0x1a')]?_0x1cdabb['options'][_0x8f6a('0x1f')]?_['map'](_0x1cdabb[_0x8f6a('0x1a')]['include'],function(_0x1654ff){return{'model':db[_0x1654ff['model']],'as':_0x1654ff['as'],'attributes':_0x1654ff['attributes'],'include':_0x1654ff[_0x8f6a('0x1f')]?_[_0x8f6a('0x20')](_0x1654ff['include'],function(_0x392b89){return{'model':db[_0x392b89['model']],'as':_0x392b89['as'],'attributes':_0x392b89[_0x8f6a('0x1d')],'include':_0x392b89['include']?_[_0x8f6a('0x20')](_0x392b89[_0x8f6a('0x1f')],function(_0x400eae){return{'model':db[_0x400eae[_0x8f6a('0x21')]],'as':_0x400eae['as'],'attributes':_0x400eae[_0x8f6a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8f6a('0xd')](function(_0x35d3b5){logger['info']('GetVoiceCallReport',_0x1cdabb);logger['debug'](_0x8f6a('0x22'),_0x1cdabb,JSON[_0x8f6a('0x12')](_0x35d3b5));_0x27003c(_0x35d3b5);})[_0x8f6a('0x18')](function(_0x22afb3){logger['error'](_0x8f6a('0x22'),_0x22afb3['message'],_0x1cdabb);_0x12c49(_0x2fd945[_0x8f6a('0x13')](0x1f4,_0x22afb3[_0x8f6a('0x16')]));});});};exports[_0x8f6a('0x23')]=function(_0x3c2cd9){var _0x313348=this;return new Promise(function(_0x23eeed,_0x522952){return db[_0x8f6a('0x19')][_0x8f6a('0x24')](_0x3c2cd9[_0x8f6a('0x25')],{'raw':_0x3c2cd9[_0x8f6a('0x1a')]?_0x3c2cd9[_0x8f6a('0x1a')][_0x8f6a('0x1b')]===undefined?!![]:![]:!![]})[_0x8f6a('0xd')](function(_0x24974e){logger['info'](_0x8f6a('0x23'),_0x3c2cd9);logger[_0x8f6a('0xf')](_0x8f6a('0x23'),_0x3c2cd9,JSON[_0x8f6a('0x12')](_0x24974e));_0x23eeed(_0x24974e);})['catch'](function(_0x303972){logger['error'](_0x8f6a('0x23'),_0x303972[_0x8f6a('0x16')],_0x3c2cd9);_0x522952(_0x313348['error'](0x1f4,_0x303972[_0x8f6a('0x16')]));});});};exports[_0x8f6a('0x26')]=function(_0x42c8d3){var _0x5bf3dd=this;return new Promise(function(_0x4bcef4,_0x43b749){return db[_0x8f6a('0x19')][_0x8f6a('0x27')](_0x42c8d3[_0x8f6a('0x25')],{'raw':_0x42c8d3[_0x8f6a('0x1a')]?_0x42c8d3[_0x8f6a('0x1a')][_0x8f6a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42c8d3[_0x8f6a('0x1a')]?_0x42c8d3[_0x8f6a('0x1a')][_0x8f6a('0x1c')]||null:null,'attributes':_0x42c8d3[_0x8f6a('0x1a')]?_0x42c8d3[_0x8f6a('0x1a')][_0x8f6a('0x1d')]||null:null,'limit':_0x42c8d3[_0x8f6a('0x1a')]?_0x42c8d3['options'][_0x8f6a('0x1e')]||null:null})['then'](function(_0x51fc6f){logger[_0x8f6a('0xe')](_0x8f6a('0x26'),_0x42c8d3);logger[_0x8f6a('0xf')](_0x8f6a('0x26'),_0x42c8d3,JSON[_0x8f6a('0x12')](_0x51fc6f));_0x4bcef4(_0x51fc6f);})[_0x8f6a('0x18')](function(_0x9ac7ca){logger[_0x8f6a('0x13')]('UpdateVoiceCallReport',_0x9ac7ca['message'],_0x42c8d3);_0x43b749(_0x5bf3dd[_0x8f6a('0x13')](0x1f4,_0x9ac7ca[_0x8f6a('0x16')]));});});};
\ No newline at end of file