Built motion from commit 97153652.|2.6.26
[motion2.git] / server / api / squareReport / squareReport.rpc.js
index 83ddf9c..25784bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87bb=['../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareReport','body','options','then','catch','UpdateSquareReport','SquareReport','attributes','limit','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x18ae01,_0x16f801){var _0x30260d=function(_0xe0279a){while(--_0xe0279a){_0x18ae01['push'](_0x18ae01['shift']());}};_0x30260d(++_0x16f801);}(_0x87bb,0x144));var _0xb87b=function(_0x567260,_0x14ca34){_0x567260=_0x567260-0x0;var _0x473a0d=_0x87bb[_0x567260];return _0x473a0d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb87b('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb87b('0x1'));var db=require(_0xb87b('0x2'))['db'];var utils=require(_0xb87b('0x3'));var logger=require(_0xb87b('0x4'))(_0xb87b('0x5'));var config=require(_0xb87b('0x6'));var jayson=require(_0xb87b('0x7'));var client=jayson[_0xb87b('0x8')][_0xb87b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ba2cc,_0x1b7562,_0x4afdef){return new BPromise(function(_0x19c348,_0x3ecc81){return client[_0xb87b('0xa')](_0x5ba2cc,_0x4afdef)['then'](function(_0x1bd2f0){logger[_0xb87b('0xb')](_0xb87b('0xc'),_0x1b7562,'request\x20sent');logger[_0xb87b('0xd')](_0xb87b('0xe'),_0x1b7562,_0xb87b('0xf'),JSON[_0xb87b('0x10')](_0x1bd2f0));if(_0x1bd2f0['error']){if(_0x1bd2f0[_0xb87b('0x11')][_0xb87b('0x12')]===0x1f4){logger[_0xb87b('0x11')](_0xb87b('0xc'),_0x1b7562,_0x1bd2f0[_0xb87b('0x11')][_0xb87b('0x13')]);return _0x3ecc81(_0x1bd2f0[_0xb87b('0x11')]['message']);}logger[_0xb87b('0x11')]('SquareReport,\x20%s,\x20%s',_0x1b7562,_0x1bd2f0[_0xb87b('0x11')][_0xb87b('0x13')]);return _0x19c348(_0x1bd2f0['error']['message']);}else{logger[_0xb87b('0xb')](_0xb87b('0xc'),_0x1b7562,'request\x20sent');_0x19c348(_0x1bd2f0[_0xb87b('0x14')][_0xb87b('0x13')]);}})['catch'](function(_0x1c754c){logger['error'](_0xb87b('0xc'),_0x1b7562,_0x1c754c);_0x3ecc81(_0x1c754c);});});}exports[_0xb87b('0x15')]=function(_0x389f11){var _0x58512c=this;return new Promise(function(_0x370e0c,_0x129506){return db['SquareReport']['create'](_0x389f11[_0xb87b('0x16')],{'raw':_0x389f11[_0xb87b('0x17')]?_0x389f11[_0xb87b('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xb87b('0x18')](function(_0x56700b){logger[_0xb87b('0xb')](_0xb87b('0x15'),_0x389f11);logger[_0xb87b('0xd')](_0xb87b('0x15'),_0x389f11,JSON[_0xb87b('0x10')](_0x56700b));_0x370e0c(_0x56700b);})[_0xb87b('0x19')](function(_0x21b939){logger[_0xb87b('0x11')](_0xb87b('0x15'),_0x21b939[_0xb87b('0x13')],_0x389f11);_0x129506(_0x58512c['error'](0x1f4,_0x21b939[_0xb87b('0x13')]));});});};exports[_0xb87b('0x1a')]=function(_0x27e1aa){var _0x26847b=this;return new Promise(function(_0x4d5994,_0x39303b){return db[_0xb87b('0x1b')]['update'](_0x27e1aa[_0xb87b('0x16')],{'raw':_0x27e1aa[_0xb87b('0x17')]?_0x27e1aa['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27e1aa[_0xb87b('0x17')]?_0x27e1aa[_0xb87b('0x17')]['where']||null:null,'attributes':_0x27e1aa[_0xb87b('0x17')]?_0x27e1aa[_0xb87b('0x17')][_0xb87b('0x1c')]||null:null,'limit':_0x27e1aa['options']?_0x27e1aa[_0xb87b('0x17')][_0xb87b('0x1d')]||null:null})[_0xb87b('0x18')](function(_0x14d58b){logger[_0xb87b('0xb')](_0xb87b('0x1a'),_0x27e1aa);logger['debug'](_0xb87b('0x1a'),_0x27e1aa,JSON['stringify'](_0x14d58b));_0x4d5994(_0x14d58b);})['catch'](function(_0x138a74){logger[_0xb87b('0x11')](_0xb87b('0x1a'),_0x138a74[_0xb87b('0x13')],_0x27e1aa);_0x39303b(_0x26847b['error'](0x1f4,_0x138a74[_0xb87b('0x13')]));});});};
\ No newline at end of file
+var _0x2f02=['UpdateSquareReport','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','update','attributes','limit'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x2f02,0x156));var _0x22f0=function(_0x4d7707,_0x9784ca){_0x4d7707=_0x4d7707-0x0;var _0x5d3421=_0x2f02[_0x4d7707];return _0x5d3421;};'use strict';var _=require(_0x22f0('0x0'));var util=require('util');var moment=require(_0x22f0('0x1'));var BPromise=require(_0x22f0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22f0('0x3'))['db'];var utils=require(_0x22f0('0x4'));var logger=require(_0x22f0('0x5'))(_0x22f0('0x6'));var config=require('../../config/environment');var jayson=require(_0x22f0('0x7'));var client=jayson[_0x22f0('0x8')][_0x22f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ab38b,_0x45b013,_0x5230df){return new BPromise(function(_0x1ccef3,_0x5369e6){return client[_0x22f0('0xa')](_0x3ab38b,_0x5230df)[_0x22f0('0xb')](function(_0x19724f){logger[_0x22f0('0xc')](_0x22f0('0xd'),_0x45b013,_0x22f0('0xe'));logger[_0x22f0('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x45b013,_0x22f0('0xe'),JSON[_0x22f0('0x10')](_0x19724f));if(_0x19724f[_0x22f0('0x11')]){if(_0x19724f[_0x22f0('0x11')][_0x22f0('0x12')]===0x1f4){logger[_0x22f0('0x11')](_0x22f0('0xd'),_0x45b013,_0x19724f[_0x22f0('0x11')][_0x22f0('0x13')]);return _0x5369e6(_0x19724f[_0x22f0('0x11')]['message']);}logger['error'](_0x22f0('0xd'),_0x45b013,_0x19724f[_0x22f0('0x11')][_0x22f0('0x13')]);return _0x1ccef3(_0x19724f[_0x22f0('0x11')][_0x22f0('0x13')]);}else{logger[_0x22f0('0xc')](_0x22f0('0xd'),_0x45b013,'request\x20sent');_0x1ccef3(_0x19724f[_0x22f0('0x14')][_0x22f0('0x13')]);}})[_0x22f0('0x15')](function(_0x231d06){logger[_0x22f0('0x11')](_0x22f0('0xd'),_0x45b013,_0x231d06);_0x5369e6(_0x231d06);});});}exports[_0x22f0('0x16')]=function(_0x467c2b){var _0x33a615=this;return new Promise(function(_0x59413e,_0x5cc498){return db[_0x22f0('0x17')]['create'](_0x467c2b[_0x22f0('0x18')],{'raw':_0x467c2b[_0x22f0('0x19')]?_0x467c2b[_0x22f0('0x19')][_0x22f0('0x1a')]===undefined?!![]:![]:!![]})[_0x22f0('0xb')](function(_0x30dd2e){logger[_0x22f0('0xc')](_0x22f0('0x16'),_0x467c2b);logger[_0x22f0('0xf')]('CreateSquareReport',_0x467c2b,JSON[_0x22f0('0x10')](_0x30dd2e));_0x59413e(_0x30dd2e);})[_0x22f0('0x15')](function(_0x36bbce){logger[_0x22f0('0x11')]('CreateSquareReport',_0x36bbce[_0x22f0('0x13')],_0x467c2b);_0x5cc498(_0x33a615[_0x22f0('0x11')](0x1f4,_0x36bbce[_0x22f0('0x13')]));});});};exports['UpdateSquareReport']=function(_0x39f81c){var _0x4f6f51=this;return new Promise(function(_0x3873ec,_0xcd91dc){return db[_0x22f0('0x17')][_0x22f0('0x1b')](_0x39f81c[_0x22f0('0x18')],{'raw':_0x39f81c[_0x22f0('0x19')]?_0x39f81c['options'][_0x22f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39f81c[_0x22f0('0x19')]?_0x39f81c[_0x22f0('0x19')]['where']||null:null,'attributes':_0x39f81c[_0x22f0('0x19')]?_0x39f81c[_0x22f0('0x19')][_0x22f0('0x1c')]||null:null,'limit':_0x39f81c[_0x22f0('0x19')]?_0x39f81c[_0x22f0('0x19')][_0x22f0('0x1d')]||null:null})[_0x22f0('0xb')](function(_0x367408){logger[_0x22f0('0xc')](_0x22f0('0x1e'),_0x39f81c);logger[_0x22f0('0xf')](_0x22f0('0x1e'),_0x39f81c,JSON['stringify'](_0x367408));_0x3873ec(_0x367408);})[_0x22f0('0x15')](function(_0x1abf1b){logger[_0x22f0('0x11')]('UpdateSquareReport',_0x1abf1b['message'],_0x39f81c);_0xcd91dc(_0x4f6f51['error'](0x1f4,_0x1abf1b[_0x22f0('0x13')]));});});};
\ No newline at end of file