Built motion from commit (unavailable).|2.4.13
[motion2.git] / server / api / squareProject / squareProject.rpc.js
index 9c95488..b14a95f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d9e=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','include','model','map','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1fa9b8,_0x7a6384){var _0x3bcdf2=function(_0x4e4c2b){while(--_0x4e4c2b){_0x1fa9b8['push'](_0x1fa9b8['shift']());}};_0x3bcdf2(++_0x7a6384);}(_0x5d9e,0x1a9));var _0xe5d9=function(_0x168fda,_0x1cffc2){_0x168fda=_0x168fda-0x0;var _0x5206b2=_0x5d9e[_0x168fda];return _0x5206b2;};'use strict';var _=require(_0xe5d9('0x0'));var util=require(_0xe5d9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5d9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5d9('0x3'));var logger=require(_0xe5d9('0x4'))(_0xe5d9('0x5'));var config=require(_0xe5d9('0x6'));var jayson=require(_0xe5d9('0x7'));var client=jayson[_0xe5d9('0x8')][_0xe5d9('0x9')]({'port':0x232a});config[_0xe5d9('0xa')]=_[_0xe5d9('0xb')](config[_0xe5d9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe5d9('0xc'))(new Redis(config[_0xe5d9('0xa')]));require(_0xe5d9('0xd'))[_0xe5d9('0xe')](socket);function respondWithRpcPromise(_0x1a43d7,_0x1f14c6,_0x4c9e9b){return new BPromise(function(_0x19be48,_0x2ae845){return client[_0xe5d9('0xf')](_0x1a43d7,_0x4c9e9b)[_0xe5d9('0x10')](function(_0x3cb7e3){logger[_0xe5d9('0x11')]('SquareProject,\x20%s,\x20%s',_0x1f14c6,_0xe5d9('0x12'));logger[_0xe5d9('0x13')](_0xe5d9('0x14'),_0x1f14c6,'request\x20sent',JSON[_0xe5d9('0x15')](_0x3cb7e3));if(_0x3cb7e3[_0xe5d9('0x16')]){if(_0x3cb7e3[_0xe5d9('0x16')]['code']===0x1f4){logger[_0xe5d9('0x16')](_0xe5d9('0x17'),_0x1f14c6,_0x3cb7e3[_0xe5d9('0x16')][_0xe5d9('0x18')]);return _0x2ae845(_0x3cb7e3[_0xe5d9('0x16')][_0xe5d9('0x18')]);}logger['error'](_0xe5d9('0x17'),_0x1f14c6,_0x3cb7e3[_0xe5d9('0x16')]['message']);return _0x19be48(_0x3cb7e3[_0xe5d9('0x16')]['message']);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0x1f14c6,'request\x20sent');_0x19be48(_0x3cb7e3[_0xe5d9('0x19')][_0xe5d9('0x18')]);}})[_0xe5d9('0x1a')](function(_0x572cc4){logger['error']('SquareProject,\x20%s,\x20%s',_0x1f14c6,_0x572cc4);_0x2ae845(_0x572cc4);});});}exports[_0xe5d9('0x1b')]=function(_0x43894c){var _0x6d5d3c=this;return new Promise(function(_0x7e161,_0x2a788f){return db[_0xe5d9('0x1c')][_0xe5d9('0x1d')]({'raw':_0x43894c[_0xe5d9('0x1e')]?_0x43894c['options'][_0xe5d9('0x1f')]===undefined?!![]:![]:!![],'where':_0x43894c[_0xe5d9('0x1e')]?_0x43894c['options']['where']||null:null,'attributes':_0x43894c[_0xe5d9('0x1e')]?_0x43894c[_0xe5d9('0x1e')][_0xe5d9('0x20')]||null:null,'include':_0x43894c['options']?_0x43894c[_0xe5d9('0x1e')][_0xe5d9('0x21')]?_['map'](_0x43894c[_0xe5d9('0x1e')][_0xe5d9('0x21')],function(_0x205b89){return{'model':db[_0x205b89[_0xe5d9('0x22')]],'as':_0x205b89['as'],'attributes':_0x205b89[_0xe5d9('0x20')],'include':_0x205b89['include']?_[_0xe5d9('0x23')](_0x205b89[_0xe5d9('0x21')],function(_0x39ddcd){return{'model':db[_0x39ddcd['model']],'as':_0x39ddcd['as'],'attributes':_0x39ddcd[_0xe5d9('0x20')],'include':_0x39ddcd['include']?_[_0xe5d9('0x23')](_0x39ddcd[_0xe5d9('0x21')],function(_0x4b69c2){return{'model':db[_0x4b69c2['model']],'as':_0x4b69c2['as'],'attributes':_0x4b69c2['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5d9('0x10')](function(_0xe1b095){logger[_0xe5d9('0x11')]('ShowSquareProject',_0x43894c);logger[_0xe5d9('0x13')](_0xe5d9('0x1b'),_0x43894c,JSON[_0xe5d9('0x15')](_0xe1b095));_0x7e161(_0xe1b095);})[_0xe5d9('0x1a')](function(_0xb8e694){logger[_0xe5d9('0x16')](_0xe5d9('0x1b'),_0xb8e694[_0xe5d9('0x18')],_0x43894c);_0x2a788f(_0x6d5d3c[_0xe5d9('0x16')](0x1f4,_0xb8e694['message']));});});};
\ No newline at end of file
+var _0xc8e7=['request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','raw','options','attributes','include','map','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc8e7,0xd6));var _0x7c8e=function(_0x1de641,_0x44d464){_0x1de641=_0x1de641-0x0;var _0xccacbc=_0xc8e7[_0x1de641];return _0xccacbc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c8e('0x0'));var BPromise=require(_0x7c8e('0x1'));var rs=require(_0x7c8e('0x2'));var fs=require('fs');var Redis=require(_0x7c8e('0x3'));var db=require(_0x7c8e('0x4'))['db'];var utils=require(_0x7c8e('0x5'));var logger=require('../../config/logger')(_0x7c8e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7c8e('0x7')][_0x7c8e('0x8')]({'port':0x232a});config[_0x7c8e('0x9')]=_['defaults'](config[_0x7c8e('0x9')],{'host':_0x7c8e('0xa'),'port':0x18eb});var socket=require(_0x7c8e('0xb'))(new Redis(config[_0x7c8e('0x9')]));require(_0x7c8e('0xc'))[_0x7c8e('0xd')](socket);function respondWithRpcPromise(_0x375533,_0x335bc0,_0x6fb3a0){return new BPromise(function(_0x33be0a,_0x145bd5){return client[_0x7c8e('0xe')](_0x375533,_0x6fb3a0)[_0x7c8e('0xf')](function(_0x2fa659){logger[_0x7c8e('0x10')]('SquareProject,\x20%s,\x20%s',_0x335bc0,_0x7c8e('0x11'));logger[_0x7c8e('0x12')](_0x7c8e('0x13'),_0x335bc0,_0x7c8e('0x11'),JSON['stringify'](_0x2fa659));if(_0x2fa659['error']){if(_0x2fa659[_0x7c8e('0x14')][_0x7c8e('0x15')]===0x1f4){logger[_0x7c8e('0x14')]('SquareProject,\x20%s,\x20%s',_0x335bc0,_0x2fa659[_0x7c8e('0x14')][_0x7c8e('0x16')]);return _0x145bd5(_0x2fa659[_0x7c8e('0x14')][_0x7c8e('0x16')]);}logger[_0x7c8e('0x14')](_0x7c8e('0x17'),_0x335bc0,_0x2fa659[_0x7c8e('0x14')][_0x7c8e('0x16')]);return _0x33be0a(_0x2fa659[_0x7c8e('0x14')]['message']);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0x335bc0,_0x7c8e('0x11'));_0x33be0a(_0x2fa659[_0x7c8e('0x18')][_0x7c8e('0x16')]);}})[_0x7c8e('0x19')](function(_0x2c36d7){logger[_0x7c8e('0x14')](_0x7c8e('0x17'),_0x335bc0,_0x2c36d7);_0x145bd5(_0x2c36d7);});});}exports[_0x7c8e('0x1a')]=function(_0x4dcfc1){var _0x4de297=this;return new Promise(function(_0x55e274,_0xdf852e){return db['SquareProject']['find']({'raw':_0x4dcfc1['options']?_0x4dcfc1['options'][_0x7c8e('0x1b')]===undefined?!![]:![]:!![],'where':_0x4dcfc1['options']?_0x4dcfc1['options']['where']||null:null,'attributes':_0x4dcfc1['options']?_0x4dcfc1[_0x7c8e('0x1c')][_0x7c8e('0x1d')]||null:null,'include':_0x4dcfc1['options']?_0x4dcfc1[_0x7c8e('0x1c')][_0x7c8e('0x1e')]?_[_0x7c8e('0x1f')](_0x4dcfc1[_0x7c8e('0x1c')][_0x7c8e('0x1e')],function(_0x4553f2){return{'model':db[_0x4553f2[_0x7c8e('0x20')]],'as':_0x4553f2['as'],'attributes':_0x4553f2[_0x7c8e('0x1d')],'include':_0x4553f2['include']?_[_0x7c8e('0x1f')](_0x4553f2[_0x7c8e('0x1e')],function(_0x5088f5){return{'model':db[_0x5088f5[_0x7c8e('0x20')]],'as':_0x5088f5['as'],'attributes':_0x5088f5[_0x7c8e('0x1d')],'include':_0x5088f5['include']?_[_0x7c8e('0x1f')](_0x5088f5['include'],function(_0x1161cc){return{'model':db[_0x1161cc[_0x7c8e('0x20')]],'as':_0x1161cc['as'],'attributes':_0x1161cc[_0x7c8e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7c8e('0xf')](function(_0x44dcf9){logger[_0x7c8e('0x10')]('ShowSquareProject',_0x4dcfc1);logger[_0x7c8e('0x12')]('ShowSquareProject',_0x4dcfc1,JSON['stringify'](_0x44dcf9));_0x55e274(_0x44dcf9);})[_0x7c8e('0x19')](function(_0x10133e){logger[_0x7c8e('0x14')](_0x7c8e('0x1a'),_0x10133e[_0x7c8e('0x16')],_0x4dcfc1);_0xdf852e(_0x4de297['error'](0x1f4,_0x10133e[_0x7c8e('0x16')]));});});};
\ No newline at end of file