Built motion from commit 26159a51.|2.5.44
[motion2.git] / server / api / squareProject / squareProject.rpc.js
index dfc0a23..13c4437 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18cc=['redis','defaults','socket.io-emitter','./squareProject.socket','register','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','SquareProject','find','options','raw','attributes','include','map','model','ShowSquareProject','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x24aa9c,_0x5e74e0){var _0x9029d2=function(_0x48b320){while(--_0x48b320){_0x24aa9c['push'](_0x24aa9c['shift']());}};_0x9029d2(++_0x5e74e0);}(_0x18cc,0xa0));var _0xc18c=function(_0x146f8f,_0x1d2df8){_0x146f8f=_0x146f8f-0x0;var _0x3124b8=_0x18cc[_0x146f8f];return _0x3124b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc18c('0x0'));var rs=require(_0xc18c('0x1'));var fs=require('fs');var Redis=require(_0xc18c('0x2'));var db=require(_0xc18c('0x3'))['db'];var utils=require(_0xc18c('0x4'));var logger=require(_0xc18c('0x5'))(_0xc18c('0x6'));var config=require(_0xc18c('0x7'));var jayson=require(_0xc18c('0x8'));var client=jayson[_0xc18c('0x9')]['http']({'port':0x232a});config[_0xc18c('0xa')]=_[_0xc18c('0xb')](config[_0xc18c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc18c('0xc'))(new Redis(config[_0xc18c('0xa')]));require(_0xc18c('0xd'))[_0xc18c('0xe')](socket);function respondWithRpcPromise(_0x29fdce,_0x100d37,_0x525e69){return new BPromise(function(_0x4e425b,_0x3a13e9){return client['request'](_0x29fdce,_0x525e69)['then'](function(_0x102194){logger[_0xc18c('0xf')](_0xc18c('0x10'),_0x100d37,_0xc18c('0x11'));logger[_0xc18c('0x12')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x100d37,_0xc18c('0x11'),JSON[_0xc18c('0x13')](_0x102194));if(_0x102194[_0xc18c('0x14')]){if(_0x102194['error'][_0xc18c('0x15')]===0x1f4){logger[_0xc18c('0x14')](_0xc18c('0x10'),_0x100d37,_0x102194[_0xc18c('0x14')][_0xc18c('0x16')]);return _0x3a13e9(_0x102194[_0xc18c('0x14')][_0xc18c('0x16')]);}logger[_0xc18c('0x14')](_0xc18c('0x10'),_0x100d37,_0x102194[_0xc18c('0x14')][_0xc18c('0x16')]);return _0x4e425b(_0x102194[_0xc18c('0x14')][_0xc18c('0x16')]);}else{logger[_0xc18c('0xf')]('SquareProject,\x20%s,\x20%s',_0x100d37,_0xc18c('0x11'));_0x4e425b(_0x102194[_0xc18c('0x17')][_0xc18c('0x16')]);}})['catch'](function(_0x3c2452){logger[_0xc18c('0x14')](_0xc18c('0x10'),_0x100d37,_0x3c2452);_0x3a13e9(_0x3c2452);});});}exports['ShowSquareProject']=function(_0x35dadf){var _0x277735=this;return new Promise(function(_0x5eb881,_0x2e767e){return db[_0xc18c('0x18')][_0xc18c('0x19')]({'raw':_0x35dadf[_0xc18c('0x1a')]?_0x35dadf[_0xc18c('0x1a')][_0xc18c('0x1b')]===undefined?!![]:![]:!![],'where':_0x35dadf['options']?_0x35dadf[_0xc18c('0x1a')]['where']||null:null,'attributes':_0x35dadf[_0xc18c('0x1a')]?_0x35dadf[_0xc18c('0x1a')][_0xc18c('0x1c')]||null:null,'include':_0x35dadf[_0xc18c('0x1a')]?_0x35dadf[_0xc18c('0x1a')][_0xc18c('0x1d')]?_[_0xc18c('0x1e')](_0x35dadf['options'][_0xc18c('0x1d')],function(_0x3e0672){return{'model':db[_0x3e0672[_0xc18c('0x1f')]],'as':_0x3e0672['as'],'attributes':_0x3e0672[_0xc18c('0x1c')],'include':_0x3e0672['include']?_['map'](_0x3e0672['include'],function(_0x8a575f){return{'model':db[_0x8a575f[_0xc18c('0x1f')]],'as':_0x8a575f['as'],'attributes':_0x8a575f[_0xc18c('0x1c')],'include':_0x8a575f[_0xc18c('0x1d')]?_[_0xc18c('0x1e')](_0x8a575f[_0xc18c('0x1d')],function(_0x52b48a){return{'model':db[_0x52b48a[_0xc18c('0x1f')]],'as':_0x52b48a['as'],'attributes':_0x52b48a[_0xc18c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b0d40){logger['info']('ShowSquareProject',_0x35dadf);logger['debug'](_0xc18c('0x20'),_0x35dadf,JSON[_0xc18c('0x13')](_0x2b0d40));_0x5eb881(_0x2b0d40);})[_0xc18c('0x21')](function(_0x3a7062){logger[_0xc18c('0x14')](_0xc18c('0x20'),_0x3a7062[_0xc18c('0x16')],_0x35dadf);_0x2e767e(_0x277735[_0xc18c('0x14')](0x1f4,_0x3a7062[_0xc18c('0x16')]));});});};
\ No newline at end of file
+var _0xd304=['rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareProject','options','raw','where','attributes','include','map','model','then','debug','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0xd304,0x66));var _0x4d30=function(_0x379efb,_0x1b275e){_0x379efb=_0x379efb-0x0;var _0x1d0926=_0xd304[_0x379efb];return _0x1d0926;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4d30('0x0'));var rs=require(_0x4d30('0x1'));var fs=require('fs');var Redis=require(_0x4d30('0x2'));var db=require(_0x4d30('0x3'))['db'];var utils=require(_0x4d30('0x4'));var logger=require(_0x4d30('0x5'))(_0x4d30('0x6'));var config=require(_0x4d30('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4d30('0x8')][_0x4d30('0x9')]({'port':0x232a});config['redis']=_[_0x4d30('0xa')](config[_0x4d30('0xb')],{'host':_0x4d30('0xc'),'port':0x18eb});var socket=require(_0x4d30('0xd'))(new Redis(config[_0x4d30('0xb')]));require(_0x4d30('0xe'))[_0x4d30('0xf')](socket);function respondWithRpcPromise(_0x368c68,_0x5ad8c7,_0x103824){return new BPromise(function(_0x4d48a2,_0x882b41){return client['request'](_0x368c68,_0x103824)['then'](function(_0x35eb90){logger['info'](_0x4d30('0x10'),_0x5ad8c7,_0x4d30('0x11'));logger['debug'](_0x4d30('0x12'),_0x5ad8c7,'request\x20sent',JSON[_0x4d30('0x13')](_0x35eb90));if(_0x35eb90[_0x4d30('0x14')]){if(_0x35eb90[_0x4d30('0x14')][_0x4d30('0x15')]===0x1f4){logger['error'](_0x4d30('0x10'),_0x5ad8c7,_0x35eb90[_0x4d30('0x14')][_0x4d30('0x16')]);return _0x882b41(_0x35eb90[_0x4d30('0x14')][_0x4d30('0x16')]);}logger[_0x4d30('0x14')](_0x4d30('0x10'),_0x5ad8c7,_0x35eb90[_0x4d30('0x14')]['message']);return _0x4d48a2(_0x35eb90[_0x4d30('0x14')][_0x4d30('0x16')]);}else{logger[_0x4d30('0x17')]('SquareProject,\x20%s,\x20%s',_0x5ad8c7,'request\x20sent');_0x4d48a2(_0x35eb90[_0x4d30('0x18')][_0x4d30('0x16')]);}})[_0x4d30('0x19')](function(_0x4d8654){logger[_0x4d30('0x14')](_0x4d30('0x10'),_0x5ad8c7,_0x4d8654);_0x882b41(_0x4d8654);});});}exports[_0x4d30('0x1a')]=function(_0x4b435c){var _0x47c28d=this;return new Promise(function(_0xe418cc,_0x22bb61){return db['SquareProject']['find']({'raw':_0x4b435c[_0x4d30('0x1b')]?_0x4b435c[_0x4d30('0x1b')][_0x4d30('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b435c[_0x4d30('0x1b')]?_0x4b435c[_0x4d30('0x1b')][_0x4d30('0x1d')]||null:null,'attributes':_0x4b435c[_0x4d30('0x1b')]?_0x4b435c[_0x4d30('0x1b')][_0x4d30('0x1e')]||null:null,'include':_0x4b435c['options']?_0x4b435c['options'][_0x4d30('0x1f')]?_[_0x4d30('0x20')](_0x4b435c[_0x4d30('0x1b')][_0x4d30('0x1f')],function(_0x5290a8){return{'model':db[_0x5290a8[_0x4d30('0x21')]],'as':_0x5290a8['as'],'attributes':_0x5290a8[_0x4d30('0x1e')],'include':_0x5290a8['include']?_[_0x4d30('0x20')](_0x5290a8[_0x4d30('0x1f')],function(_0x2e5248){return{'model':db[_0x2e5248['model']],'as':_0x2e5248['as'],'attributes':_0x2e5248[_0x4d30('0x1e')],'include':_0x2e5248['include']?_['map'](_0x2e5248['include'],function(_0xe20a81){return{'model':db[_0xe20a81[_0x4d30('0x21')]],'as':_0xe20a81['as'],'attributes':_0xe20a81[_0x4d30('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4d30('0x22')](function(_0x2a6284){logger['info']('ShowSquareProject',_0x4b435c);logger[_0x4d30('0x23')](_0x4d30('0x1a'),_0x4b435c,JSON['stringify'](_0x2a6284));_0xe418cc(_0x2a6284);})[_0x4d30('0x19')](function(_0x48dcd8){logger[_0x4d30('0x14')]('ShowSquareProject',_0x48dcd8[_0x4d30('0x16')],_0x4b435c);_0x22bb61(_0x47c28d[_0x4d30('0x14')](0x1f4,_0x48dcd8['message']));});});};
\ No newline at end of file