Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / squareReport / squareReport.rpc.js
index edf3ae8..23581b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5c2=['info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','SquareReport','options','raw','debug','UpdateSquareReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x136aae,_0x35aad0){var _0x35aba9=function(_0x48cbed){while(--_0x48cbed){_0x136aae['push'](_0x136aae['shift']());}};_0x35aba9(++_0x35aad0);}(_0xe5c2,0x167));var _0x2e5c=function(_0x1c6786,_0x2e4a25){_0x1c6786=_0x1c6786-0x0;var _0x2623bf=_0xe5c2[_0x1c6786];return _0x2623bf;};'use strict';var _=require(_0x2e5c('0x0'));var util=require(_0x2e5c('0x1'));var moment=require(_0x2e5c('0x2'));var BPromise=require(_0x2e5c('0x3'));var rs=require(_0x2e5c('0x4'));var fs=require('fs');var Redis=require(_0x2e5c('0x5'));var db=require(_0x2e5c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e5c('0x7'))(_0x2e5c('0x8'));var config=require('../../config/environment');var jayson=require(_0x2e5c('0x9'));var client=jayson[_0x2e5c('0xa')][_0x2e5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18b8c0,_0x38670e,_0x290bb4){return new BPromise(function(_0x308c0b,_0x32313c){return client['request'](_0x18b8c0,_0x290bb4)[_0x2e5c('0xc')](function(_0x5a0466){logger[_0x2e5c('0xd')](_0x2e5c('0xe'),_0x38670e,'request\x20sent');logger['debug'](_0x2e5c('0xf'),_0x38670e,_0x2e5c('0x10'),JSON[_0x2e5c('0x11')](_0x5a0466));if(_0x5a0466[_0x2e5c('0x12')]){if(_0x5a0466['error']['code']===0x1f4){logger[_0x2e5c('0x12')]('SquareReport,\x20%s,\x20%s',_0x38670e,_0x5a0466['error'][_0x2e5c('0x13')]);return _0x32313c(_0x5a0466[_0x2e5c('0x12')][_0x2e5c('0x13')]);}logger['error'](_0x2e5c('0xe'),_0x38670e,_0x5a0466['error'][_0x2e5c('0x13')]);return _0x308c0b(_0x5a0466['error']['message']);}else{logger[_0x2e5c('0xd')](_0x2e5c('0xe'),_0x38670e,_0x2e5c('0x10'));_0x308c0b(_0x5a0466[_0x2e5c('0x14')]['message']);}})[_0x2e5c('0x15')](function(_0x247dd5){logger['error']('SquareReport,\x20%s,\x20%s',_0x38670e,_0x247dd5);_0x32313c(_0x247dd5);});});}exports[_0x2e5c('0x16')]=function(_0x4324c0){var _0x137f18=this;return new Promise(function(_0xabf9ac,_0x3ea026){return db[_0x2e5c('0x17')]['create'](_0x4324c0['body'],{'raw':_0x4324c0[_0x2e5c('0x18')]?_0x4324c0[_0x2e5c('0x18')][_0x2e5c('0x19')]===undefined?!![]:![]:!![]})[_0x2e5c('0xc')](function(_0x4fe483){logger[_0x2e5c('0xd')](_0x2e5c('0x16'),_0x4324c0);logger[_0x2e5c('0x1a')](_0x2e5c('0x16'),_0x4324c0,JSON['stringify'](_0x4fe483));_0xabf9ac(_0x4fe483);})[_0x2e5c('0x15')](function(_0x4022de){logger[_0x2e5c('0x12')](_0x2e5c('0x16'),_0x4022de[_0x2e5c('0x13')],_0x4324c0);_0x3ea026(_0x137f18[_0x2e5c('0x12')](0x1f4,_0x4022de[_0x2e5c('0x13')]));});});};exports[_0x2e5c('0x1b')]=function(_0x2ee388){var _0x3333a6=this;return new Promise(function(_0x40951c,_0x4e2083){return db[_0x2e5c('0x17')][_0x2e5c('0x1c')](_0x2ee388['body'],{'raw':_0x2ee388[_0x2e5c('0x18')]?_0x2ee388[_0x2e5c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ee388[_0x2e5c('0x18')]?_0x2ee388[_0x2e5c('0x18')][_0x2e5c('0x1d')]||null:null,'attributes':_0x2ee388[_0x2e5c('0x18')]?_0x2ee388['options'][_0x2e5c('0x1e')]||null:null,'limit':_0x2ee388[_0x2e5c('0x18')]?_0x2ee388['options']['limit']||null:null})[_0x2e5c('0xc')](function(_0x29e36d){logger[_0x2e5c('0xd')]('UpdateSquareReport',_0x2ee388);logger[_0x2e5c('0x1a')](_0x2e5c('0x1b'),_0x2ee388,JSON[_0x2e5c('0x11')](_0x29e36d));_0x40951c(_0x29e36d);})[_0x2e5c('0x15')](function(_0x3d0975){logger['error'](_0x2e5c('0x1b'),_0x3d0975['message'],_0x2ee388);_0x4e2083(_0x3333a6[_0x2e5c('0x12')](0x1f4,_0x3d0975[_0x2e5c('0x13')]));});});};
\ No newline at end of file
+var _0xa88e=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','SquareReport,\x20%s,\x20%s','message','SquareReport','create','options','raw','then','CreateSquareReport','stringify','UpdateSquareReport','update','body','where','attributes','limit','catch','moment','bluebird','randomstring'];(function(_0x17a9a3,_0x4ad234){var _0x29b9a1=function(_0x585093){while(--_0x585093){_0x17a9a3['push'](_0x17a9a3['shift']());}};_0x29b9a1(++_0x4ad234);}(_0xa88e,0x114));var _0xea88=function(_0x2be470,_0x26d0cf){_0x2be470=_0x2be470-0x0;var _0x42fa20=_0xa88e[_0x2be470];return _0x42fa20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea88('0x0'));var BPromise=require(_0xea88('0x1'));var rs=require(_0xea88('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea88('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xea88('0x4'))('rpc');var config=require(_0xea88('0x5'));var jayson=require(_0xea88('0x6'));var client=jayson['client'][_0xea88('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x454ef9,_0xe01515,_0xba4c0f){return new BPromise(function(_0x1c402c,_0x12064f){return client[_0xea88('0x8')](_0x454ef9,_0xba4c0f)['then'](function(_0x34d58d){logger[_0xea88('0x9')]('SquareReport,\x20%s,\x20%s',_0xe01515,_0xea88('0xa'));logger[_0xea88('0xb')](_0xea88('0xc'),_0xe01515,_0xea88('0xa'),JSON['stringify'](_0x34d58d));if(_0x34d58d[_0xea88('0xd')]){if(_0x34d58d['error'][_0xea88('0xe')]===0x1f4){logger[_0xea88('0xd')](_0xea88('0xf'),_0xe01515,_0x34d58d['error']['message']);return _0x12064f(_0x34d58d['error']['message']);}logger[_0xea88('0xd')](_0xea88('0xf'),_0xe01515,_0x34d58d[_0xea88('0xd')]['message']);return _0x1c402c(_0x34d58d[_0xea88('0xd')][_0xea88('0x10')]);}else{logger[_0xea88('0x9')]('SquareReport,\x20%s,\x20%s',_0xe01515,_0xea88('0xa'));_0x1c402c(_0x34d58d['result'][_0xea88('0x10')]);}})['catch'](function(_0x258ae2){logger[_0xea88('0xd')](_0xea88('0xf'),_0xe01515,_0x258ae2);_0x12064f(_0x258ae2);});});}exports['CreateSquareReport']=function(_0x465d3c){var _0xecb54c=this;return new Promise(function(_0x429546,_0x2f14d4){return db[_0xea88('0x11')][_0xea88('0x12')](_0x465d3c['body'],{'raw':_0x465d3c[_0xea88('0x13')]?_0x465d3c['options'][_0xea88('0x14')]===undefined?!![]:![]:!![]})[_0xea88('0x15')](function(_0x116202){logger[_0xea88('0x9')](_0xea88('0x16'),_0x465d3c);logger[_0xea88('0xb')](_0xea88('0x16'),_0x465d3c,JSON[_0xea88('0x17')](_0x116202));_0x429546(_0x116202);})['catch'](function(_0x547b53){logger[_0xea88('0xd')]('CreateSquareReport',_0x547b53['message'],_0x465d3c);_0x2f14d4(_0xecb54c[_0xea88('0xd')](0x1f4,_0x547b53[_0xea88('0x10')]));});});};exports[_0xea88('0x18')]=function(_0x5dc2f0){var _0x503537=this;return new Promise(function(_0x4bc50e,_0x51795d){return db[_0xea88('0x11')][_0xea88('0x19')](_0x5dc2f0[_0xea88('0x1a')],{'raw':_0x5dc2f0[_0xea88('0x13')]?_0x5dc2f0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dc2f0[_0xea88('0x13')]?_0x5dc2f0[_0xea88('0x13')][_0xea88('0x1b')]||null:null,'attributes':_0x5dc2f0[_0xea88('0x13')]?_0x5dc2f0['options'][_0xea88('0x1c')]||null:null,'limit':_0x5dc2f0[_0xea88('0x13')]?_0x5dc2f0[_0xea88('0x13')][_0xea88('0x1d')]||null:null})[_0xea88('0x15')](function(_0x46750b){logger[_0xea88('0x9')](_0xea88('0x18'),_0x5dc2f0);logger[_0xea88('0xb')](_0xea88('0x18'),_0x5dc2f0,JSON['stringify'](_0x46750b));_0x4bc50e(_0x46750b);})[_0xea88('0x1e')](function(_0xe60558){logger['error'](_0xea88('0x18'),_0xe60558[_0xea88('0x10')],_0x5dc2f0);_0x51795d(_0x503537[_0xea88('0xd')](0x1f4,_0xe60558['message']));});});};
\ No newline at end of file