Built motion from commit 14588770.|2.5.38
[motion2.git] / server / api / squareProject / squareProject.rpc.js
index 11126c2..31f8404 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb5f=['then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareProject','options','where','attributes','include','map','model','ShowSquareProject','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request'];(function(_0x2f47f1,_0x17f6a7){var _0x1e2329=function(_0x8f5900){while(--_0x8f5900){_0x2f47f1['push'](_0x2f47f1['shift']());}};_0x1e2329(++_0x17f6a7);}(_0xeb5f,0x1f4));var _0xfeb5=function(_0x52f4a3,_0x278cd7){_0x52f4a3=_0x52f4a3-0x0;var _0x1cfe3e=_0xeb5f[_0x52f4a3];return _0x1cfe3e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfeb5('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfeb5('0x1'))(_0xfeb5('0x2'));var config=require(_0xfeb5('0x3'));var jayson=require(_0xfeb5('0x4'));var client=jayson[_0xfeb5('0x5')][_0xfeb5('0x6')]({'port':0x232a});config[_0xfeb5('0x7')]=_[_0xfeb5('0x8')](config['redis'],{'host':_0xfeb5('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfeb5('0x7')]));require('./squareProject.socket')[_0xfeb5('0xa')](socket);function respondWithRpcPromise(_0x46302d,_0xf3c2ba,_0x359c9f){return new BPromise(function(_0x362617,_0x337892){return client[_0xfeb5('0xb')](_0x46302d,_0x359c9f)[_0xfeb5('0xc')](function(_0x23d1a2){logger['info'](_0xfeb5('0xd'),_0xf3c2ba,_0xfeb5('0xe'));logger[_0xfeb5('0xf')](_0xfeb5('0x10'),_0xf3c2ba,_0xfeb5('0xe'),JSON[_0xfeb5('0x11')](_0x23d1a2));if(_0x23d1a2[_0xfeb5('0x12')]){if(_0x23d1a2[_0xfeb5('0x12')][_0xfeb5('0x13')]===0x1f4){logger[_0xfeb5('0x12')]('SquareProject,\x20%s,\x20%s',_0xf3c2ba,_0x23d1a2[_0xfeb5('0x12')][_0xfeb5('0x14')]);return _0x337892(_0x23d1a2[_0xfeb5('0x12')]['message']);}logger[_0xfeb5('0x12')](_0xfeb5('0xd'),_0xf3c2ba,_0x23d1a2[_0xfeb5('0x12')][_0xfeb5('0x14')]);return _0x362617(_0x23d1a2[_0xfeb5('0x12')][_0xfeb5('0x14')]);}else{logger[_0xfeb5('0x15')](_0xfeb5('0xd'),_0xf3c2ba,_0xfeb5('0xe'));_0x362617(_0x23d1a2[_0xfeb5('0x16')][_0xfeb5('0x14')]);}})[_0xfeb5('0x17')](function(_0x51331c){logger[_0xfeb5('0x12')](_0xfeb5('0xd'),_0xf3c2ba,_0x51331c);_0x337892(_0x51331c);});});}exports['ShowSquareProject']=function(_0x37d642){var _0x5df090=this;return new Promise(function(_0x43f771,_0x4347d2){return db[_0xfeb5('0x18')]['find']({'raw':_0x37d642['options']?_0x37d642[_0xfeb5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x37d642[_0xfeb5('0x19')]?_0x37d642['options'][_0xfeb5('0x1a')]||null:null,'attributes':_0x37d642[_0xfeb5('0x19')]?_0x37d642[_0xfeb5('0x19')][_0xfeb5('0x1b')]||null:null,'include':_0x37d642[_0xfeb5('0x19')]?_0x37d642['options'][_0xfeb5('0x1c')]?_['map'](_0x37d642[_0xfeb5('0x19')][_0xfeb5('0x1c')],function(_0x4d56b8){return{'model':db[_0x4d56b8['model']],'as':_0x4d56b8['as'],'attributes':_0x4d56b8[_0xfeb5('0x1b')],'include':_0x4d56b8[_0xfeb5('0x1c')]?_[_0xfeb5('0x1d')](_0x4d56b8[_0xfeb5('0x1c')],function(_0x3c29be){return{'model':db[_0x3c29be[_0xfeb5('0x1e')]],'as':_0x3c29be['as'],'attributes':_0x3c29be[_0xfeb5('0x1b')],'include':_0x3c29be[_0xfeb5('0x1c')]?_[_0xfeb5('0x1d')](_0x3c29be['include'],function(_0x44509f){return{'model':db[_0x44509f[_0xfeb5('0x1e')]],'as':_0x44509f['as'],'attributes':_0x44509f['attributes']};}):[]};}):[]};}):[]:[]})[_0xfeb5('0xc')](function(_0x45cf9f){logger[_0xfeb5('0x15')](_0xfeb5('0x1f'),_0x37d642);logger[_0xfeb5('0xf')]('ShowSquareProject',_0x37d642,JSON['stringify'](_0x45cf9f));_0x43f771(_0x45cf9f);})['catch'](function(_0x1fa5c9){logger[_0xfeb5('0x12')]('ShowSquareProject',_0x1fa5c9[_0xfeb5('0x14')],_0x37d642);_0x4347d2(_0x5df090[_0xfeb5('0x12')](0x1f4,_0x1fa5c9[_0xfeb5('0x14')]));});});};
\ No newline at end of file
+var _0xbd1f=['debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','where','attributes','model','include','map','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xbd1f,0x139));var _0xfbd1=function(_0x191dff,_0xb60d16){_0x191dff=_0x191dff-0x0;var _0x410a43=_0xbd1f[_0x191dff];return _0x410a43;};'use strict';var _=require(_0xfbd1('0x0'));var util=require(_0xfbd1('0x1'));var moment=require(_0xfbd1('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbd1('0x3'));var fs=require('fs');var Redis=require(_0xfbd1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbd1('0x5'));var logger=require(_0xfbd1('0x6'))(_0xfbd1('0x7'));var config=require('../../config/environment');var jayson=require(_0xfbd1('0x8'));var client=jayson[_0xfbd1('0x9')][_0xfbd1('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfbd1('0xb')],{'host':_0xfbd1('0xc'),'port':0x18eb});var socket=require(_0xfbd1('0xd'))(new Redis(config[_0xfbd1('0xb')]));require(_0xfbd1('0xe'))[_0xfbd1('0xf')](socket);function respondWithRpcPromise(_0x237a29,_0x441945,_0x1fc8f5){return new BPromise(function(_0x1dddb0,_0x1a8ab9){return client['request'](_0x237a29,_0x1fc8f5)[_0xfbd1('0x10')](function(_0x430af8){logger[_0xfbd1('0x11')](_0xfbd1('0x12'),_0x441945,_0xfbd1('0x13'));logger[_0xfbd1('0x14')](_0xfbd1('0x15'),_0x441945,_0xfbd1('0x13'),JSON[_0xfbd1('0x16')](_0x430af8));if(_0x430af8[_0xfbd1('0x17')]){if(_0x430af8['error'][_0xfbd1('0x18')]===0x1f4){logger[_0xfbd1('0x17')](_0xfbd1('0x12'),_0x441945,_0x430af8['error'][_0xfbd1('0x19')]);return _0x1a8ab9(_0x430af8[_0xfbd1('0x17')]['message']);}logger[_0xfbd1('0x17')]('SquareProject,\x20%s,\x20%s',_0x441945,_0x430af8[_0xfbd1('0x17')][_0xfbd1('0x19')]);return _0x1dddb0(_0x430af8[_0xfbd1('0x17')][_0xfbd1('0x19')]);}else{logger['info'](_0xfbd1('0x12'),_0x441945,'request\x20sent');_0x1dddb0(_0x430af8[_0xfbd1('0x1a')][_0xfbd1('0x19')]);}})[_0xfbd1('0x1b')](function(_0x3fd7a9){logger[_0xfbd1('0x17')]('SquareProject,\x20%s,\x20%s',_0x441945,_0x3fd7a9);_0x1a8ab9(_0x3fd7a9);});});}exports[_0xfbd1('0x1c')]=function(_0x2b5039){var _0x3c88c9=this;return new Promise(function(_0xa19bc2,_0x2d7b41){return db[_0xfbd1('0x1d')][_0xfbd1('0x1e')]({'raw':_0x2b5039[_0xfbd1('0x1f')]?_0x2b5039[_0xfbd1('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2b5039['options']?_0x2b5039[_0xfbd1('0x1f')][_0xfbd1('0x20')]||null:null,'attributes':_0x2b5039['options']?_0x2b5039['options'][_0xfbd1('0x21')]||null:null,'include':_0x2b5039[_0xfbd1('0x1f')]?_0x2b5039[_0xfbd1('0x1f')]['include']?_['map'](_0x2b5039['options']['include'],function(_0x47d7e0){return{'model':db[_0x47d7e0[_0xfbd1('0x22')]],'as':_0x47d7e0['as'],'attributes':_0x47d7e0[_0xfbd1('0x21')],'include':_0x47d7e0[_0xfbd1('0x23')]?_[_0xfbd1('0x24')](_0x47d7e0[_0xfbd1('0x23')],function(_0x2fc9b1){return{'model':db[_0x2fc9b1['model']],'as':_0x2fc9b1['as'],'attributes':_0x2fc9b1[_0xfbd1('0x21')],'include':_0x2fc9b1['include']?_[_0xfbd1('0x24')](_0x2fc9b1['include'],function(_0x1feaf5){return{'model':db[_0x1feaf5['model']],'as':_0x1feaf5['as'],'attributes':_0x1feaf5[_0xfbd1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfbd1('0x10')](function(_0x1ec87d){logger['info']('ShowSquareProject',_0x2b5039);logger[_0xfbd1('0x14')](_0xfbd1('0x1c'),_0x2b5039,JSON['stringify'](_0x1ec87d));_0xa19bc2(_0x1ec87d);})[_0xfbd1('0x1b')](function(_0x175949){logger['error'](_0xfbd1('0x1c'),_0x175949[_0xfbd1('0x19')],_0x2b5039);_0x2d7b41(_0x3c88c9[_0xfbd1('0x17')](0x1f4,_0x175949[_0xfbd1('0x19')]));});});};
\ No newline at end of file