Built motion from commit ffdca78c.|2.6.24
[motion2.git] / server / api / squareMessage / squareMessage.rpc.js
index 7bd5865..fea4f72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14b2=['code','message','info','result','CreateSquareMessage','SquareMessage','create','body','options','raw','then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x44c9a6,_0x59bf95){var _0x5599be=function(_0x27388a){while(--_0x27388a){_0x44c9a6['push'](_0x44c9a6['shift']());}};_0x5599be(++_0x59bf95);}(_0x14b2,0x1a1));var _0x214b=function(_0x2c7cd3,_0x369d68){_0x2c7cd3=_0x2c7cd3-0x0;var _0x36d395=_0x14b2[_0x2c7cd3];return _0x36d395;};'use strict';var _=require(_0x214b('0x0'));var util=require(_0x214b('0x1'));var moment=require('moment');var BPromise=require(_0x214b('0x2'));var rs=require(_0x214b('0x3'));var fs=require('fs');var Redis=require(_0x214b('0x4'));var db=require(_0x214b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x214b('0x6'))(_0x214b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x214b('0x8')][_0x214b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30867e,_0x3003ab,_0x188bab){return new BPromise(function(_0x117ddd,_0x4cd18e){return client[_0x214b('0xa')](_0x30867e,_0x188bab)['then'](function(_0x232e01){logger['info'](_0x214b('0xb'),_0x3003ab,'request\x20sent');logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3003ab,_0x214b('0xc'),JSON[_0x214b('0xd')](_0x232e01));if(_0x232e01['error']){if(_0x232e01[_0x214b('0xe')][_0x214b('0xf')]===0x1f4){logger[_0x214b('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3003ab,_0x232e01[_0x214b('0xe')]['message']);return _0x4cd18e(_0x232e01['error'][_0x214b('0x10')]);}logger[_0x214b('0xe')](_0x214b('0xb'),_0x3003ab,_0x232e01[_0x214b('0xe')][_0x214b('0x10')]);return _0x117ddd(_0x232e01[_0x214b('0xe')]['message']);}else{logger[_0x214b('0x11')]('SquareMessage,\x20%s,\x20%s',_0x3003ab,_0x214b('0xc'));_0x117ddd(_0x232e01[_0x214b('0x12')][_0x214b('0x10')]);}})['catch'](function(_0x4d2557){logger[_0x214b('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3003ab,_0x4d2557);_0x4cd18e(_0x4d2557);});});}exports[_0x214b('0x13')]=function(_0xbe4932){var _0x4d42e6=this;return new Promise(function(_0x25e18a,_0x4cc219){return db[_0x214b('0x14')][_0x214b('0x15')](_0xbe4932[_0x214b('0x16')],{'raw':_0xbe4932['options']?_0xbe4932[_0x214b('0x17')][_0x214b('0x18')]===undefined?!![]:![]:!![]})[_0x214b('0x19')](function(_0x3dc351){logger[_0x214b('0x11')]('CreateSquareMessage',_0xbe4932);logger['debug'](_0x214b('0x13'),_0xbe4932,JSON[_0x214b('0xd')](_0x3dc351));_0x25e18a(_0x3dc351);})[_0x214b('0x1a')](function(_0x2ddfe4){logger['error'](_0x214b('0x13'),_0x2ddfe4[_0x214b('0x10')],_0xbe4932);_0x4cc219(_0x4d42e6[_0x214b('0xe')](0x1f4,_0x2ddfe4[_0x214b('0x10')]));});});};
\ No newline at end of file
+var _0xc50e=['raw','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options'];(function(_0x37bab,_0x47a7c2){var _0x150d05=function(_0x2f492f){while(--_0x2f492f){_0x37bab['push'](_0x37bab['shift']());}};_0x150d05(++_0x47a7c2);}(_0xc50e,0xbf));var _0xec50=function(_0xb2b4f7,_0x4045d2){_0xb2b4f7=_0xb2b4f7-0x0;var _0x138df8=_0xc50e[_0xb2b4f7];return _0x138df8;};'use strict';var _=require(_0xec50('0x0'));var util=require(_0xec50('0x1'));var moment=require(_0xec50('0x2'));var BPromise=require(_0xec50('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec50('0x4'))['db'];var utils=require(_0xec50('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xec50('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xec50('0x7')][_0xec50('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x97bda9,_0xfd1597,_0x253de6){return new BPromise(function(_0x409727,_0x4b40b3){return client[_0xec50('0x9')](_0x97bda9,_0x253de6)[_0xec50('0xa')](function(_0x16dea6){logger[_0xec50('0xb')](_0xec50('0xc'),_0xfd1597,'request\x20sent');logger[_0xec50('0xd')](_0xec50('0xe'),_0xfd1597,_0xec50('0xf'),JSON['stringify'](_0x16dea6));if(_0x16dea6[_0xec50('0x10')]){if(_0x16dea6['error']['code']===0x1f4){logger[_0xec50('0x10')](_0xec50('0xc'),_0xfd1597,_0x16dea6[_0xec50('0x10')][_0xec50('0x11')]);return _0x4b40b3(_0x16dea6['error'][_0xec50('0x11')]);}logger[_0xec50('0x10')](_0xec50('0xc'),_0xfd1597,_0x16dea6['error'][_0xec50('0x11')]);return _0x409727(_0x16dea6['error'][_0xec50('0x11')]);}else{logger[_0xec50('0xb')]('SquareMessage,\x20%s,\x20%s',_0xfd1597,_0xec50('0xf'));_0x409727(_0x16dea6[_0xec50('0x12')][_0xec50('0x11')]);}})[_0xec50('0x13')](function(_0x5b525e){logger[_0xec50('0x10')]('SquareMessage,\x20%s,\x20%s',_0xfd1597,_0x5b525e);_0x4b40b3(_0x5b525e);});});}exports[_0xec50('0x14')]=function(_0x551430){var _0x48a2db=this;return new Promise(function(_0x26a2f0,_0x2d74b2){return db[_0xec50('0x15')][_0xec50('0x16')](_0x551430[_0xec50('0x17')],{'raw':_0x551430[_0xec50('0x18')]?_0x551430['options'][_0xec50('0x19')]===undefined?!![]:![]:!![]})[_0xec50('0xa')](function(_0x24c62b){logger[_0xec50('0xb')](_0xec50('0x14'),_0x551430);logger[_0xec50('0xd')](_0xec50('0x14'),_0x551430,JSON[_0xec50('0x1a')](_0x24c62b));_0x26a2f0(_0x24c62b);})[_0xec50('0x13')](function(_0x3506d0){logger[_0xec50('0x10')]('CreateSquareMessage',_0x3506d0[_0xec50('0x11')],_0x551430);_0x2d74b2(_0x48a2db['error'](0x1f4,_0x3506d0[_0xec50('0x11')]));});});};
\ No newline at end of file