Built motion from commit 25580385.|2.6.2
[motion2.git] / server / api / squareMessage / squareMessage.rpc.js
index 010a939..f47d1a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareMessage','create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x8bca3f,_0x158cf8){var _0x448ab5=function(_0x5b5537){while(--_0x5b5537){_0x8bca3f['push'](_0x8bca3f['shift']());}};_0x448ab5(++_0x158cf8);}(_0xf072,0x1cf));var _0x2f07=function(_0x3b6e1f,_0x4b3d74){_0x3b6e1f=_0x3b6e1f-0x0;var _0x400bee=_0xf072[_0x3b6e1f];return _0x400bee;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f07('0x4'))['db'];var utils=require(_0x2f07('0x5'));var logger=require(_0x2f07('0x6'))('rpc');var config=require(_0x2f07('0x7'));var jayson=require(_0x2f07('0x8'));var client=jayson[_0x2f07('0x9')][_0x2f07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x235418,_0xf73d1a,_0x33b99c){return new BPromise(function(_0x379b2e,_0x4746c2){return client[_0x2f07('0xb')](_0x235418,_0x33b99c)[_0x2f07('0xc')](function(_0x2e372c){logger[_0x2f07('0xd')](_0x2f07('0xe'),_0xf73d1a,_0x2f07('0xf'));logger['debug'](_0x2f07('0x10'),_0xf73d1a,_0x2f07('0xf'),JSON[_0x2f07('0x11')](_0x2e372c));if(_0x2e372c[_0x2f07('0x12')]){if(_0x2e372c['error']['code']===0x1f4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x2e372c['error'][_0x2f07('0x13')]);return _0x4746c2(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}logger['error'](_0x2f07('0xe'),_0xf73d1a,_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);return _0x379b2e(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}else{logger[_0x2f07('0xd')]('SquareMessage,\x20%s,\x20%s',_0xf73d1a,_0x2f07('0xf'));_0x379b2e(_0x2e372c['result'][_0x2f07('0x13')]);}})[_0x2f07('0x14')](function(_0x1dace4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x1dace4);_0x4746c2(_0x1dace4);});});}exports[_0x2f07('0x15')]=function(_0x1a6135){var _0xe3ed0=this;return new Promise(function(_0x55bd60,_0x15c3dd){return db['SquareMessage'][_0x2f07('0x16')](_0x1a6135[_0x2f07('0x17')],{'raw':_0x1a6135[_0x2f07('0x18')]?_0x1a6135[_0x2f07('0x18')][_0x2f07('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x45df73){logger['info']('CreateSquareMessage',_0x1a6135);logger['debug'](_0x2f07('0x15'),_0x1a6135,JSON['stringify'](_0x45df73));_0x55bd60(_0x45df73);})[_0x2f07('0x14')](function(_0x5e6ac6){logger[_0x2f07('0x12')](_0x2f07('0x15'),_0x5e6ac6[_0x2f07('0x13')],_0x1a6135);_0x15c3dd(_0xe3ed0[_0x2f07('0x12')](0x1f4,_0x5e6ac6['message']));});});};
\ No newline at end of file
+var _0xccc9=['SquareMessage','create','body','options','raw','CreateSquareMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','SquareMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x442d6b,_0x3c30ee){var _0x48053e=function(_0x40d974){while(--_0x40d974){_0x442d6b['push'](_0x442d6b['shift']());}};_0x48053e(++_0x3c30ee);}(_0xccc9,0x7a));var _0x9ccc=function(_0x1b5c5c,_0x1935ef){_0x1b5c5c=_0x1b5c5c-0x0;var _0x43f472=_0xccc9[_0x1b5c5c];return _0x43f472;};'use strict';var _=require(_0x9ccc('0x0'));var util=require('util');var moment=require(_0x9ccc('0x1'));var BPromise=require(_0x9ccc('0x2'));var rs=require(_0x9ccc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ccc('0x4'))['db'];var utils=require(_0x9ccc('0x5'));var logger=require(_0x9ccc('0x6'))(_0x9ccc('0x7'));var config=require(_0x9ccc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9ccc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x498dca,_0x3819ac,_0x2d56c2){return new BPromise(function(_0x3ef95e,_0x158b53){return client[_0x9ccc('0xa')](_0x498dca,_0x2d56c2)[_0x9ccc('0xb')](function(_0x16373c){logger[_0x9ccc('0xc')]('SquareMessage,\x20%s,\x20%s',_0x3819ac,_0x9ccc('0xd'));logger[_0x9ccc('0xe')](_0x9ccc('0xf'),_0x3819ac,_0x9ccc('0xd'),JSON[_0x9ccc('0x10')](_0x16373c));if(_0x16373c['error']){if(_0x16373c['error'][_0x9ccc('0x11')]===0x1f4){logger[_0x9ccc('0x12')](_0x9ccc('0x13'),_0x3819ac,_0x16373c[_0x9ccc('0x12')][_0x9ccc('0x14')]);return _0x158b53(_0x16373c[_0x9ccc('0x12')][_0x9ccc('0x14')]);}logger[_0x9ccc('0x12')](_0x9ccc('0x13'),_0x3819ac,_0x16373c[_0x9ccc('0x12')]['message']);return _0x3ef95e(_0x16373c['error']['message']);}else{logger[_0x9ccc('0xc')](_0x9ccc('0x13'),_0x3819ac,'request\x20sent');_0x3ef95e(_0x16373c[_0x9ccc('0x15')]['message']);}})[_0x9ccc('0x16')](function(_0x19cf89){logger[_0x9ccc('0x12')]('SquareMessage,\x20%s,\x20%s',_0x3819ac,_0x19cf89);_0x158b53(_0x19cf89);});});}exports['CreateSquareMessage']=function(_0x3d3b2c){var _0x3cda25=this;return new Promise(function(_0x343cb6,_0x4d6d59){return db[_0x9ccc('0x17')][_0x9ccc('0x18')](_0x3d3b2c[_0x9ccc('0x19')],{'raw':_0x3d3b2c[_0x9ccc('0x1a')]?_0x3d3b2c[_0x9ccc('0x1a')][_0x9ccc('0x1b')]===undefined?!![]:![]:!![]})[_0x9ccc('0xb')](function(_0xc2d614){logger[_0x9ccc('0xc')](_0x9ccc('0x1c'),_0x3d3b2c);logger[_0x9ccc('0xe')](_0x9ccc('0x1c'),_0x3d3b2c,JSON[_0x9ccc('0x10')](_0xc2d614));_0x343cb6(_0xc2d614);})[_0x9ccc('0x16')](function(_0x5b7e2c){logger[_0x9ccc('0x12')]('CreateSquareMessage',_0x5b7e2c['message'],_0x3d3b2c);_0x4d6d59(_0x3cda25[_0x9ccc('0x12')](0x1f4,_0x5b7e2c[_0x9ccc('0x14')]));});});};
\ No newline at end of file