Built motion from commit ff78e754.|2.6.29
[motion2.git] / server / api / chatQueueReport / chatQueueReport.rpc.js
index d3c91f8..33b2f90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc8b=['debug','stringify','error','message','result','ChatQueueReport','raw','then','catch','CreateChatQueueReport','UpdateChatQueueReport','update','body','options','attributes','lodash','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc8b,0x1bf));var _0xbbc8=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0xbc8b[_0x5c2e5e];return _0x46a5da;};'use strict';var _=require(_0xbbc8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbbc8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbc8('0x2'));var logger=require(_0xbbc8('0x3'))(_0xbbc8('0x4'));var config=require('../../config/environment');var jayson=require(_0xbbc8('0x5'));var client=jayson[_0xbbc8('0x6')][_0xbbc8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e9eec,_0x1ac9f6,_0x58777f){return new BPromise(function(_0x4bdca6,_0x4bb3bb){return client[_0xbbc8('0x8')](_0x1e9eec,_0x58777f)['then'](function(_0x13a7fe){logger[_0xbbc8('0x9')](_0xbbc8('0xa'),_0x1ac9f6,_0xbbc8('0xb'));logger[_0xbbc8('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1ac9f6,_0xbbc8('0xb'),JSON[_0xbbc8('0xd')](_0x13a7fe));if(_0x13a7fe[_0xbbc8('0xe')]){if(_0x13a7fe[_0xbbc8('0xe')]['code']===0x1f4){logger[_0xbbc8('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x1ac9f6,_0x13a7fe[_0xbbc8('0xe')][_0xbbc8('0xf')]);return _0x4bb3bb(_0x13a7fe['error'][_0xbbc8('0xf')]);}logger[_0xbbc8('0xe')](_0xbbc8('0xa'),_0x1ac9f6,_0x13a7fe[_0xbbc8('0xe')][_0xbbc8('0xf')]);return _0x4bdca6(_0x13a7fe['error'][_0xbbc8('0xf')]);}else{logger[_0xbbc8('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x1ac9f6,_0xbbc8('0xb'));_0x4bdca6(_0x13a7fe[_0xbbc8('0x10')][_0xbbc8('0xf')]);}})['catch'](function(_0x5d894f){logger[_0xbbc8('0xe')](_0xbbc8('0xa'),_0x1ac9f6,_0x5d894f);_0x4bb3bb(_0x5d894f);});});}exports['CreateChatQueueReport']=function(_0xeabb55){var _0x1df093=this;return new Promise(function(_0x41edb5,_0x5c46e4){return db[_0xbbc8('0x11')]['create'](_0xeabb55['body'],{'raw':_0xeabb55['options']?_0xeabb55['options'][_0xbbc8('0x12')]===undefined?!![]:![]:!![]})[_0xbbc8('0x13')](function(_0x8015b2){logger[_0xbbc8('0x9')]('CreateChatQueueReport',_0xeabb55);logger['debug']('CreateChatQueueReport',_0xeabb55,JSON[_0xbbc8('0xd')](_0x8015b2));_0x41edb5(_0x8015b2);})[_0xbbc8('0x14')](function(_0x3b58ab){logger[_0xbbc8('0xe')](_0xbbc8('0x15'),_0x3b58ab['message'],_0xeabb55);_0x5c46e4(_0x1df093[_0xbbc8('0xe')](0x1f4,_0x3b58ab['message']));});});};exports[_0xbbc8('0x16')]=function(_0x17561b){var _0x11399b=this;return new Promise(function(_0x133c1f,_0x8193d4){return db['ChatQueueReport'][_0xbbc8('0x17')](_0x17561b[_0xbbc8('0x18')],{'raw':_0x17561b[_0xbbc8('0x19')]?_0x17561b[_0xbbc8('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17561b[_0xbbc8('0x19')]?_0x17561b[_0xbbc8('0x19')]['where']||null:null,'attributes':_0x17561b[_0xbbc8('0x19')]?_0x17561b['options'][_0xbbc8('0x1a')]||null:null,'limit':_0x17561b[_0xbbc8('0x19')]?_0x17561b['options']['limit']||null:null})['then'](function(_0x5d96fb){logger['info']('UpdateChatQueueReport',_0x17561b);logger[_0xbbc8('0xc')](_0xbbc8('0x16'),_0x17561b,JSON[_0xbbc8('0xd')](_0x5d96fb));_0x133c1f(_0x5d96fb);})['catch'](function(_0x1af959){logger[_0xbbc8('0xe')](_0xbbc8('0x16'),_0x1af959['message'],_0x17561b);_0x8193d4(_0x11399b[_0xbbc8('0xe')](0x1f4,_0x1af959[_0xbbc8('0xf')]));});});};
\ No newline at end of file
+var _0xcd1b=['error','message','CreateChatQueueReport','ChatQueueReport','create','options','catch','UpdateChatQueueReport','body','raw','where','attributes','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3050f4,_0x5e481b){var _0x174d19=function(_0x11676d){while(--_0x11676d){_0x3050f4['push'](_0x3050f4['shift']());}};_0x174d19(++_0x5e481b);}(_0xcd1b,0x112));var _0xbcd1=function(_0x138137,_0x1f40dd){_0x138137=_0x138137-0x0;var _0x209736=_0xcd1b[_0x138137];return _0x209736;};'use strict';var _=require('lodash');var util=require(_0xbcd1('0x0'));var moment=require(_0xbcd1('0x1'));var BPromise=require('bluebird');var rs=require(_0xbcd1('0x2'));var fs=require('fs');var Redis=require(_0xbcd1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcd1('0x4'));var logger=require(_0xbcd1('0x5'))('rpc');var config=require(_0xbcd1('0x6'));var jayson=require(_0xbcd1('0x7'));var client=jayson[_0xbcd1('0x8')][_0xbcd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x549197,_0x5631b7,_0x3ba993){return new BPromise(function(_0x461a19,_0x53a523){return client['request'](_0x549197,_0x3ba993)[_0xbcd1('0xa')](function(_0x4f56f8){logger[_0xbcd1('0xb')](_0xbcd1('0xc'),_0x5631b7,_0xbcd1('0xd'));logger[_0xbcd1('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5631b7,_0xbcd1('0xd'),JSON[_0xbcd1('0xf')](_0x4f56f8));if(_0x4f56f8[_0xbcd1('0x10')]){if(_0x4f56f8[_0xbcd1('0x10')]['code']===0x1f4){logger[_0xbcd1('0x10')](_0xbcd1('0xc'),_0x5631b7,_0x4f56f8[_0xbcd1('0x10')][_0xbcd1('0x11')]);return _0x53a523(_0x4f56f8[_0xbcd1('0x10')][_0xbcd1('0x11')]);}logger[_0xbcd1('0x10')](_0xbcd1('0xc'),_0x5631b7,_0x4f56f8[_0xbcd1('0x10')][_0xbcd1('0x11')]);return _0x461a19(_0x4f56f8[_0xbcd1('0x10')][_0xbcd1('0x11')]);}else{logger[_0xbcd1('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x5631b7,_0xbcd1('0xd'));_0x461a19(_0x4f56f8['result'][_0xbcd1('0x11')]);}})['catch'](function(_0x161ea5){logger[_0xbcd1('0x10')](_0xbcd1('0xc'),_0x5631b7,_0x161ea5);_0x53a523(_0x161ea5);});});}exports[_0xbcd1('0x12')]=function(_0x3b6d8c){var _0x4256d2=this;return new Promise(function(_0x4fd389,_0x4e83a1){return db[_0xbcd1('0x13')][_0xbcd1('0x14')](_0x3b6d8c['body'],{'raw':_0x3b6d8c[_0xbcd1('0x15')]?_0x3b6d8c[_0xbcd1('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xbcd1('0xa')](function(_0x5ddfe7){logger[_0xbcd1('0xb')](_0xbcd1('0x12'),_0x3b6d8c);logger[_0xbcd1('0xe')](_0xbcd1('0x12'),_0x3b6d8c,JSON['stringify'](_0x5ddfe7));_0x4fd389(_0x5ddfe7);})[_0xbcd1('0x16')](function(_0x36acdc){logger[_0xbcd1('0x10')](_0xbcd1('0x12'),_0x36acdc['message'],_0x3b6d8c);_0x4e83a1(_0x4256d2[_0xbcd1('0x10')](0x1f4,_0x36acdc[_0xbcd1('0x11')]));});});};exports[_0xbcd1('0x17')]=function(_0x2700eb){var _0x3b8525=this;return new Promise(function(_0x52eafd,_0x5f309a){return db['ChatQueueReport']['update'](_0x2700eb[_0xbcd1('0x18')],{'raw':_0x2700eb[_0xbcd1('0x15')]?_0x2700eb[_0xbcd1('0x15')][_0xbcd1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2700eb[_0xbcd1('0x15')]?_0x2700eb[_0xbcd1('0x15')][_0xbcd1('0x1a')]||null:null,'attributes':_0x2700eb[_0xbcd1('0x15')]?_0x2700eb[_0xbcd1('0x15')][_0xbcd1('0x1b')]||null:null,'limit':_0x2700eb[_0xbcd1('0x15')]?_0x2700eb[_0xbcd1('0x15')][_0xbcd1('0x1c')]||null:null})[_0xbcd1('0xa')](function(_0x3d47c3){logger[_0xbcd1('0xb')](_0xbcd1('0x17'),_0x2700eb);logger[_0xbcd1('0xe')](_0xbcd1('0x17'),_0x2700eb,JSON[_0xbcd1('0xf')](_0x3d47c3));_0x52eafd(_0x3d47c3);})[_0xbcd1('0x16')](function(_0x3d11e8){logger[_0xbcd1('0x10')](_0xbcd1('0x17'),_0x3d11e8[_0xbcd1('0x11')],_0x2700eb);_0x5f309a(_0x3b8525['error'](0x1f4,_0x3d11e8[_0xbcd1('0x11')]));});});};
\ No newline at end of file