Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / squareProject / squareProject.rpc.js
index 844adcc..a24f863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9185=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','lodash','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x1439e6,_0x2634b8){var _0x1101a9=function(_0x591d44){while(--_0x591d44){_0x1439e6['push'](_0x1439e6['shift']());}};_0x1101a9(++_0x2634b8);}(_0x9185,0x11a));var _0x5918=function(_0x3806e6,_0x2f55d1){_0x3806e6=_0x3806e6-0x0;var _0x43aea8=_0x9185[_0x3806e6];return _0x43aea8;};'use strict';var _=require(_0x5918('0x0'));var util=require('util');var moment=require(_0x5918('0x1'));var BPromise=require('bluebird');var rs=require(_0x5918('0x2'));var fs=require('fs');var Redis=require(_0x5918('0x3'));var db=require(_0x5918('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5918('0x5'));var config=require(_0x5918('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5918('0x7')][_0x5918('0x8')]({'port':0x232a});config[_0x5918('0x9')]=_[_0x5918('0xa')](config[_0x5918('0x9')],{'host':_0x5918('0xb'),'port':0x18eb});var socket=require(_0x5918('0xc'))(new Redis(config[_0x5918('0x9')]));require(_0x5918('0xd'))['register'](socket);function respondWithRpcPromise(_0x36276f,_0x390338,_0x71550){return new BPromise(function(_0x2c8ba5,_0x412fb8){return client[_0x5918('0xe')](_0x36276f,_0x71550)[_0x5918('0xf')](function(_0x4da49d){logger[_0x5918('0x10')](_0x5918('0x11'),_0x390338,'request\x20sent');logger[_0x5918('0x12')](_0x5918('0x13'),_0x390338,'request\x20sent',JSON[_0x5918('0x14')](_0x4da49d));if(_0x4da49d[_0x5918('0x15')]){if(_0x4da49d[_0x5918('0x15')][_0x5918('0x16')]===0x1f4){logger[_0x5918('0x15')](_0x5918('0x11'),_0x390338,_0x4da49d[_0x5918('0x15')][_0x5918('0x17')]);return _0x412fb8(_0x4da49d[_0x5918('0x15')]['message']);}logger[_0x5918('0x15')](_0x5918('0x11'),_0x390338,_0x4da49d[_0x5918('0x15')][_0x5918('0x17')]);return _0x2c8ba5(_0x4da49d[_0x5918('0x15')][_0x5918('0x17')]);}else{logger[_0x5918('0x10')]('SquareProject,\x20%s,\x20%s',_0x390338,'request\x20sent');_0x2c8ba5(_0x4da49d[_0x5918('0x18')][_0x5918('0x17')]);}})[_0x5918('0x19')](function(_0x4b6e15){logger[_0x5918('0x15')](_0x5918('0x11'),_0x390338,_0x4b6e15);_0x412fb8(_0x4b6e15);});});}exports[_0x5918('0x1a')]=function(_0x3e4ff5){var _0x541c9c=this;return new Promise(function(_0x598ca8,_0x1d3727){return db[_0x5918('0x1b')][_0x5918('0x1c')]({'raw':_0x3e4ff5[_0x5918('0x1d')]?_0x3e4ff5[_0x5918('0x1d')][_0x5918('0x1e')]===undefined?!![]:![]:!![],'where':_0x3e4ff5[_0x5918('0x1d')]?_0x3e4ff5[_0x5918('0x1d')][_0x5918('0x1f')]||null:null,'attributes':_0x3e4ff5[_0x5918('0x1d')]?_0x3e4ff5[_0x5918('0x1d')][_0x5918('0x20')]||null:null,'include':_0x3e4ff5['options']?_0x3e4ff5[_0x5918('0x1d')][_0x5918('0x21')]?_[_0x5918('0x22')](_0x3e4ff5['options'][_0x5918('0x21')],function(_0x2eb00d){return{'model':db[_0x2eb00d[_0x5918('0x23')]],'as':_0x2eb00d['as'],'attributes':_0x2eb00d['attributes'],'include':_0x2eb00d[_0x5918('0x21')]?_['map'](_0x2eb00d[_0x5918('0x21')],function(_0x5a62f4){return{'model':db[_0x5a62f4[_0x5918('0x23')]],'as':_0x5a62f4['as'],'attributes':_0x5a62f4[_0x5918('0x20')],'include':_0x5a62f4['include']?_[_0x5918('0x22')](_0x5a62f4[_0x5918('0x21')],function(_0x1cdb07){return{'model':db[_0x1cdb07[_0x5918('0x23')]],'as':_0x1cdb07['as'],'attributes':_0x1cdb07[_0x5918('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa93925){logger[_0x5918('0x10')](_0x5918('0x1a'),_0x3e4ff5);logger['debug'](_0x5918('0x1a'),_0x3e4ff5,JSON[_0x5918('0x14')](_0xa93925));_0x598ca8(_0xa93925);})[_0x5918('0x19')](function(_0x36f1c0){logger[_0x5918('0x15')](_0x5918('0x1a'),_0x36f1c0[_0x5918('0x17')],_0x3e4ff5);_0x1d3727(_0x541c9c[_0x5918('0x15')](0x1f4,_0x36f1c0[_0x5918('0x17')]));});});};
\ No newline at end of file
+var _0x88b4=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareProject,\x20%s,\x20%s','catch','ShowSquareProject','SquareProject','find','options','raw','map','include','model','attributes','lodash'];(function(_0x274f14,_0x27dd7f){var _0x13b97e=function(_0x7d9432){while(--_0x7d9432){_0x274f14['push'](_0x274f14['shift']());}};_0x13b97e(++_0x27dd7f);}(_0x88b4,0x65));var _0x488b=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0x88b4[_0x466e57];return _0x34df42;};'use strict';var _=require(_0x488b('0x0'));var util=require('util');var moment=require(_0x488b('0x1'));var BPromise=require('bluebird');var rs=require(_0x488b('0x2'));var fs=require('fs');var Redis=require(_0x488b('0x3'));var db=require(_0x488b('0x4'))['db'];var utils=require(_0x488b('0x5'));var logger=require(_0x488b('0x6'))(_0x488b('0x7'));var config=require('../../config/environment');var jayson=require(_0x488b('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x488b('0x9')]=_['defaults'](config['redis'],{'host':_0x488b('0xa'),'port':0x18eb});var socket=require(_0x488b('0xb'))(new Redis(config['redis']));require('./squareProject.socket')[_0x488b('0xc')](socket);function respondWithRpcPromise(_0x2c99b2,_0x276756,_0x266004){return new BPromise(function(_0x32a161,_0x19a6fb){return client[_0x488b('0xd')](_0x2c99b2,_0x266004)[_0x488b('0xe')](function(_0x333d58){logger[_0x488b('0xf')]('SquareProject,\x20%s,\x20%s',_0x276756,_0x488b('0x10'));logger[_0x488b('0x11')](_0x488b('0x12'),_0x276756,'request\x20sent',JSON[_0x488b('0x13')](_0x333d58));if(_0x333d58[_0x488b('0x14')]){if(_0x333d58['error'][_0x488b('0x15')]===0x1f4){logger[_0x488b('0x14')]('SquareProject,\x20%s,\x20%s',_0x276756,_0x333d58[_0x488b('0x14')]['message']);return _0x19a6fb(_0x333d58[_0x488b('0x14')][_0x488b('0x16')]);}logger[_0x488b('0x14')](_0x488b('0x17'),_0x276756,_0x333d58[_0x488b('0x14')][_0x488b('0x16')]);return _0x32a161(_0x333d58[_0x488b('0x14')][_0x488b('0x16')]);}else{logger[_0x488b('0xf')](_0x488b('0x17'),_0x276756,_0x488b('0x10'));_0x32a161(_0x333d58['result']['message']);}})[_0x488b('0x18')](function(_0x2a8d70){logger[_0x488b('0x14')](_0x488b('0x17'),_0x276756,_0x2a8d70);_0x19a6fb(_0x2a8d70);});});}exports[_0x488b('0x19')]=function(_0x209685){var _0xa76ae2=this;return new Promise(function(_0x5c1a69,_0xd1f888){return db[_0x488b('0x1a')][_0x488b('0x1b')]({'raw':_0x209685['options']?_0x209685[_0x488b('0x1c')][_0x488b('0x1d')]===undefined?!![]:![]:!![],'where':_0x209685[_0x488b('0x1c')]?_0x209685[_0x488b('0x1c')]['where']||null:null,'attributes':_0x209685[_0x488b('0x1c')]?_0x209685['options']['attributes']||null:null,'include':_0x209685[_0x488b('0x1c')]?_0x209685[_0x488b('0x1c')]['include']?_[_0x488b('0x1e')](_0x209685[_0x488b('0x1c')][_0x488b('0x1f')],function(_0x5ef024){return{'model':db[_0x5ef024[_0x488b('0x20')]],'as':_0x5ef024['as'],'attributes':_0x5ef024[_0x488b('0x21')],'include':_0x5ef024[_0x488b('0x1f')]?_['map'](_0x5ef024[_0x488b('0x1f')],function(_0x36713c){return{'model':db[_0x36713c['model']],'as':_0x36713c['as'],'attributes':_0x36713c['attributes'],'include':_0x36713c[_0x488b('0x1f')]?_[_0x488b('0x1e')](_0x36713c[_0x488b('0x1f')],function(_0x1bbbf8){return{'model':db[_0x1bbbf8['model']],'as':_0x1bbbf8['as'],'attributes':_0x1bbbf8['attributes']};}):[]};}):[]};}):[]:[]})[_0x488b('0xe')](function(_0x5a01fe){logger[_0x488b('0xf')](_0x488b('0x19'),_0x209685);logger[_0x488b('0x11')](_0x488b('0x19'),_0x209685,JSON[_0x488b('0x13')](_0x5a01fe));_0x5c1a69(_0x5a01fe);})[_0x488b('0x18')](function(_0x1ad215){logger[_0x488b('0x14')](_0x488b('0x19'),_0x1ad215['message'],_0x209685);_0xd1f888(_0xa76ae2['error'](0x1f4,_0x1ad215['message']));});});};
\ No newline at end of file