Built motion from commit e02f907f.|2.6.14
[motion2.git] / server / api / squareMessage / squareMessage.rpc.js
index fcc8d72..56eb6fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10ec=['options','raw','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareMessage','SquareMessage','body'];(function(_0x5f06ce,_0x1c0269){var _0xc9e9ae=function(_0x3d09c6){while(--_0x3d09c6){_0x5f06ce['push'](_0x5f06ce['shift']());}};_0xc9e9ae(++_0x1c0269);}(_0x10ec,0xaa));var _0xc10e=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x10ec[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xc10e('0x0'));var util=require(_0xc10e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc10e('0x2'));var fs=require('fs');var Redis=require(_0xc10e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc10e('0x4'))(_0xc10e('0x5'));var config=require(_0xc10e('0x6'));var jayson=require(_0xc10e('0x7'));var client=jayson[_0xc10e('0x8')][_0xc10e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dd467,_0x4eb629,_0x18a6ae){return new BPromise(function(_0x59ad9f,_0x305557){return client[_0xc10e('0xa')](_0x3dd467,_0x18a6ae)['then'](function(_0x4595d2){logger[_0xc10e('0xb')](_0xc10e('0xc'),_0x4eb629,_0xc10e('0xd'));logger['debug'](_0xc10e('0xe'),_0x4eb629,_0xc10e('0xd'),JSON[_0xc10e('0xf')](_0x4595d2));if(_0x4595d2[_0xc10e('0x10')]){if(_0x4595d2[_0xc10e('0x10')][_0xc10e('0x11')]===0x1f4){logger[_0xc10e('0x10')](_0xc10e('0xc'),_0x4eb629,_0x4595d2[_0xc10e('0x10')]['message']);return _0x305557(_0x4595d2[_0xc10e('0x10')][_0xc10e('0x12')]);}logger[_0xc10e('0x10')]('SquareMessage,\x20%s,\x20%s',_0x4eb629,_0x4595d2[_0xc10e('0x10')]['message']);return _0x59ad9f(_0x4595d2[_0xc10e('0x10')]['message']);}else{logger[_0xc10e('0xb')](_0xc10e('0xc'),_0x4eb629,'request\x20sent');_0x59ad9f(_0x4595d2['result'][_0xc10e('0x12')]);}})['catch'](function(_0x21696f){logger[_0xc10e('0x10')](_0xc10e('0xc'),_0x4eb629,_0x21696f);_0x305557(_0x21696f);});});}exports[_0xc10e('0x13')]=function(_0x23e1c4){var _0x2a80e5=this;return new Promise(function(_0x5a4312,_0x2f7625){return db[_0xc10e('0x14')]['create'](_0x23e1c4[_0xc10e('0x15')],{'raw':_0x23e1c4[_0xc10e('0x16')]?_0x23e1c4[_0xc10e('0x16')][_0xc10e('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x36f832){logger['info'](_0xc10e('0x13'),_0x23e1c4);logger['debug']('CreateSquareMessage',_0x23e1c4,JSON[_0xc10e('0xf')](_0x36f832));_0x5a4312(_0x36f832);})['catch'](function(_0x3b54db){logger[_0xc10e('0x10')](_0xc10e('0x13'),_0x3b54db[_0xc10e('0x12')],_0x23e1c4);_0x2f7625(_0x2a80e5[_0xc10e('0x10')](0x1f4,_0x3b54db['message']));});});};
\ No newline at end of file
+var _0x0f72=['request','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareMessage','SquareMessage','create','options','then','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x7c04f0,_0x38d84e){var _0xe16803=function(_0x5291f4){while(--_0x5291f4){_0x7c04f0['push'](_0x7c04f0['shift']());}};_0xe16803(++_0x38d84e);}(_0x0f72,0x1d2));var _0x20f7=function(_0x4ce1cb,_0x1ef61a){_0x4ce1cb=_0x4ce1cb-0x0;var _0x4c9100=_0x0f72[_0x4ce1cb];return _0x4c9100;};'use strict';var _=require('lodash');var util=require(_0x20f7('0x0'));var moment=require(_0x20f7('0x1'));var BPromise=require('bluebird');var rs=require(_0x20f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x20f7('0x3'))(_0x20f7('0x4'));var config=require(_0x20f7('0x5'));var jayson=require(_0x20f7('0x6'));var client=jayson[_0x20f7('0x7')][_0x20f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31ecb4,_0x452c51,_0x1818a2){return new BPromise(function(_0x2c972c,_0x3ceee0){return client[_0x20f7('0x9')](_0x31ecb4,_0x1818a2)['then'](function(_0x5ea900){logger['info'](_0x20f7('0xa'),_0x452c51,_0x20f7('0xb'));logger[_0x20f7('0xc')](_0x20f7('0xd'),_0x452c51,'request\x20sent',JSON[_0x20f7('0xe')](_0x5ea900));if(_0x5ea900[_0x20f7('0xf')]){if(_0x5ea900[_0x20f7('0xf')][_0x20f7('0x10')]===0x1f4){logger[_0x20f7('0xf')](_0x20f7('0xa'),_0x452c51,_0x5ea900[_0x20f7('0xf')][_0x20f7('0x11')]);return _0x3ceee0(_0x5ea900[_0x20f7('0xf')][_0x20f7('0x11')]);}logger[_0x20f7('0xf')](_0x20f7('0xa'),_0x452c51,_0x5ea900[_0x20f7('0xf')]['message']);return _0x2c972c(_0x5ea900[_0x20f7('0xf')][_0x20f7('0x11')]);}else{logger[_0x20f7('0x12')](_0x20f7('0xa'),_0x452c51,_0x20f7('0xb'));_0x2c972c(_0x5ea900['result'][_0x20f7('0x11')]);}})[_0x20f7('0x13')](function(_0x5634d5){logger['error'](_0x20f7('0xa'),_0x452c51,_0x5634d5);_0x3ceee0(_0x5634d5);});});}exports[_0x20f7('0x14')]=function(_0x372cfc){var _0x33f696=this;return new Promise(function(_0x9e2c62,_0x6d08a3){return db[_0x20f7('0x15')][_0x20f7('0x16')](_0x372cfc['body'],{'raw':_0x372cfc[_0x20f7('0x17')]?_0x372cfc[_0x20f7('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x20f7('0x18')](function(_0x53e20f){logger[_0x20f7('0x12')](_0x20f7('0x14'),_0x372cfc);logger[_0x20f7('0xc')]('CreateSquareMessage',_0x372cfc,JSON[_0x20f7('0xe')](_0x53e20f));_0x9e2c62(_0x53e20f);})[_0x20f7('0x13')](function(_0x1b37af){logger[_0x20f7('0xf')](_0x20f7('0x14'),_0x1b37af[_0x20f7('0x11')],_0x372cfc);_0x6d08a3(_0x33f696[_0x20f7('0xf')](0x1f4,_0x1b37af[_0x20f7('0x11')]));});});};
\ No newline at end of file