Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / squareReport / squareReport.rpc.js
index 57423b9..4adca65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f81=['update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport'];(function(_0x1d84b1,_0x599872){var _0x54fa39=function(_0x48ef05){while(--_0x48ef05){_0x1d84b1['push'](_0x1d84b1['shift']());}};_0x54fa39(++_0x599872);}(_0x8f81,0x162));var _0x18f8=function(_0x57f1f4,_0x526065){_0x57f1f4=_0x57f1f4-0x0;var _0x2907b7=_0x8f81[_0x57f1f4];return _0x2907b7;};'use strict';var _=require(_0x18f8('0x0'));var util=require(_0x18f8('0x1'));var moment=require(_0x18f8('0x2'));var BPromise=require(_0x18f8('0x3'));var rs=require(_0x18f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x18f8('0x6'))(_0x18f8('0x7'));var config=require(_0x18f8('0x8'));var jayson=require(_0x18f8('0x9'));var client=jayson[_0x18f8('0xa')][_0x18f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b0bf7,_0x520d4e,_0x2a86cb){return new BPromise(function(_0x44799e,_0x7308de){return client[_0x18f8('0xc')](_0x2b0bf7,_0x2a86cb)[_0x18f8('0xd')](function(_0x230b31){logger['info'](_0x18f8('0xe'),_0x520d4e,_0x18f8('0xf'));logger[_0x18f8('0x10')](_0x18f8('0x11'),_0x520d4e,_0x18f8('0xf'),JSON[_0x18f8('0x12')](_0x230b31));if(_0x230b31[_0x18f8('0x13')]){if(_0x230b31[_0x18f8('0x13')][_0x18f8('0x14')]===0x1f4){logger[_0x18f8('0x13')](_0x18f8('0xe'),_0x520d4e,_0x230b31[_0x18f8('0x13')][_0x18f8('0x15')]);return _0x7308de(_0x230b31[_0x18f8('0x13')]['message']);}logger[_0x18f8('0x13')]('SquareReport,\x20%s,\x20%s',_0x520d4e,_0x230b31[_0x18f8('0x13')][_0x18f8('0x15')]);return _0x44799e(_0x230b31[_0x18f8('0x13')][_0x18f8('0x15')]);}else{logger[_0x18f8('0x16')](_0x18f8('0xe'),_0x520d4e,_0x18f8('0xf'));_0x44799e(_0x230b31[_0x18f8('0x17')][_0x18f8('0x15')]);}})[_0x18f8('0x18')](function(_0x34bdbc){logger[_0x18f8('0x13')](_0x18f8('0xe'),_0x520d4e,_0x34bdbc);_0x7308de(_0x34bdbc);});});}exports[_0x18f8('0x19')]=function(_0x37d1a1){var _0x524046=this;return new Promise(function(_0x516f0e,_0x4a8cd9){return db[_0x18f8('0x1a')]['create'](_0x37d1a1[_0x18f8('0x1b')],{'raw':_0x37d1a1[_0x18f8('0x1c')]?_0x37d1a1['options'][_0x18f8('0x1d')]===undefined?!![]:![]:!![]})[_0x18f8('0xd')](function(_0x21f9c3){logger[_0x18f8('0x16')](_0x18f8('0x19'),_0x37d1a1);logger['debug'](_0x18f8('0x19'),_0x37d1a1,JSON[_0x18f8('0x12')](_0x21f9c3));_0x516f0e(_0x21f9c3);})[_0x18f8('0x18')](function(_0x2ef361){logger[_0x18f8('0x13')](_0x18f8('0x19'),_0x2ef361[_0x18f8('0x15')],_0x37d1a1);_0x4a8cd9(_0x524046[_0x18f8('0x13')](0x1f4,_0x2ef361[_0x18f8('0x15')]));});});};exports[_0x18f8('0x1e')]=function(_0x1a3a9a){var _0x1cddb7=this;return new Promise(function(_0x3dddc1,_0x54a68c){return db[_0x18f8('0x1a')][_0x18f8('0x1f')](_0x1a3a9a[_0x18f8('0x1b')],{'raw':_0x1a3a9a['options']?_0x1a3a9a[_0x18f8('0x1c')][_0x18f8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a3a9a[_0x18f8('0x1c')]?_0x1a3a9a[_0x18f8('0x1c')][_0x18f8('0x20')]||null:null,'attributes':_0x1a3a9a[_0x18f8('0x1c')]?_0x1a3a9a[_0x18f8('0x1c')][_0x18f8('0x21')]||null:null,'limit':_0x1a3a9a[_0x18f8('0x1c')]?_0x1a3a9a[_0x18f8('0x1c')][_0x18f8('0x22')]||null:null})['then'](function(_0x375d56){logger[_0x18f8('0x16')]('UpdateSquareReport',_0x1a3a9a);logger['debug'](_0x18f8('0x1e'),_0x1a3a9a,JSON[_0x18f8('0x12')](_0x375d56));_0x3dddc1(_0x375d56);})[_0x18f8('0x18')](function(_0x4e7f96){logger[_0x18f8('0x13')](_0x18f8('0x1e'),_0x4e7f96[_0x18f8('0x15')],_0x1a3a9a);_0x54a68c(_0x1cddb7['error'](0x1f4,_0x4e7f96[_0x18f8('0x15')]));});});};
\ No newline at end of file
+var _0x625f=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x595995,_0x4def88){var _0x1bf997=function(_0x2406f0){while(--_0x2406f0){_0x595995['push'](_0x595995['shift']());}};_0x1bf997(++_0x4def88);}(_0x625f,0x1e1));var _0xf625=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0x625f[_0x29632e];return _0x426e04;};'use strict';var _=require('lodash');var util=require(_0xf625('0x0'));var moment=require('moment');var BPromise=require(_0xf625('0x1'));var rs=require(_0xf625('0x2'));var fs=require('fs');var Redis=require(_0xf625('0x3'));var db=require(_0xf625('0x4'))['db'];var utils=require(_0xf625('0x5'));var logger=require('../../config/logger')(_0xf625('0x6'));var config=require('../../config/environment');var jayson=require(_0xf625('0x7'));var client=jayson['client'][_0xf625('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3436de,_0x3af250,_0x45fcb1){return new BPromise(function(_0x3623f3,_0x591963){return client[_0xf625('0x9')](_0x3436de,_0x45fcb1)[_0xf625('0xa')](function(_0x420ecc){logger[_0xf625('0xb')](_0xf625('0xc'),_0x3af250,_0xf625('0xd'));logger[_0xf625('0xe')](_0xf625('0xf'),_0x3af250,_0xf625('0xd'),JSON[_0xf625('0x10')](_0x420ecc));if(_0x420ecc['error']){if(_0x420ecc[_0xf625('0x11')]['code']===0x1f4){logger[_0xf625('0x11')]('SquareReport,\x20%s,\x20%s',_0x3af250,_0x420ecc[_0xf625('0x11')][_0xf625('0x12')]);return _0x591963(_0x420ecc[_0xf625('0x11')][_0xf625('0x12')]);}logger[_0xf625('0x11')](_0xf625('0xc'),_0x3af250,_0x420ecc[_0xf625('0x11')][_0xf625('0x12')]);return _0x3623f3(_0x420ecc[_0xf625('0x11')][_0xf625('0x12')]);}else{logger[_0xf625('0xb')](_0xf625('0xc'),_0x3af250,'request\x20sent');_0x3623f3(_0x420ecc[_0xf625('0x13')][_0xf625('0x12')]);}})[_0xf625('0x14')](function(_0x1ad37b){logger['error'](_0xf625('0xc'),_0x3af250,_0x1ad37b);_0x591963(_0x1ad37b);});});}exports[_0xf625('0x15')]=function(_0x34d17f){var _0x44e7da=this;return new Promise(function(_0x2b746b,_0x4cd183){return db['SquareReport'][_0xf625('0x16')](_0x34d17f[_0xf625('0x17')],{'raw':_0x34d17f[_0xf625('0x18')]?_0x34d17f[_0xf625('0x18')][_0xf625('0x19')]===undefined?!![]:![]:!![]})[_0xf625('0xa')](function(_0x42cfbb){logger['info'](_0xf625('0x15'),_0x34d17f);logger[_0xf625('0xe')](_0xf625('0x15'),_0x34d17f,JSON['stringify'](_0x42cfbb));_0x2b746b(_0x42cfbb);})[_0xf625('0x14')](function(_0x3f959f){logger[_0xf625('0x11')](_0xf625('0x15'),_0x3f959f[_0xf625('0x12')],_0x34d17f);_0x4cd183(_0x44e7da[_0xf625('0x11')](0x1f4,_0x3f959f[_0xf625('0x12')]));});});};exports[_0xf625('0x1a')]=function(_0x4b3684){var _0x1d5be6=this;return new Promise(function(_0x103192,_0x3e6eea){return db[_0xf625('0x1b')]['update'](_0x4b3684[_0xf625('0x17')],{'raw':_0x4b3684[_0xf625('0x18')]?_0x4b3684[_0xf625('0x18')][_0xf625('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3684[_0xf625('0x18')]?_0x4b3684['options'][_0xf625('0x1c')]||null:null,'attributes':_0x4b3684[_0xf625('0x18')]?_0x4b3684[_0xf625('0x18')][_0xf625('0x1d')]||null:null,'limit':_0x4b3684[_0xf625('0x18')]?_0x4b3684[_0xf625('0x18')][_0xf625('0x1e')]||null:null})[_0xf625('0xa')](function(_0x12b588){logger[_0xf625('0xb')](_0xf625('0x1a'),_0x4b3684);logger[_0xf625('0xe')](_0xf625('0x1a'),_0x4b3684,JSON[_0xf625('0x10')](_0x12b588));_0x103192(_0x12b588);})[_0xf625('0x14')](function(_0x425fb3){logger[_0xf625('0x11')](_0xf625('0x1a'),_0x425fb3[_0xf625('0x12')],_0x4b3684);_0x3e6eea(_0x1d5be6['error'](0x1f4,_0x425fb3[_0xf625('0x12')]));});});};
\ No newline at end of file