Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / squareProject / squareProject.rpc.js
index a16c8de..47d406c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0fb=['where','attributes','map','model','include','ShowSquareProject','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SquareProject,\x20%s,\x20%s','message','catch','SquareProject','options'];(function(_0x28579a,_0x13e3df){var _0xc5ab3=function(_0x54b732){while(--_0x54b732){_0x28579a['push'](_0x28579a['shift']());}};_0xc5ab3(++_0x13e3df);}(_0xf0fb,0x72));var _0xbf0f=function(_0x279095,_0x15f37e){_0x279095=_0x279095-0x0;var _0x5a5cdb=_0xf0fb[_0x279095];return _0x5a5cdb;};'use strict';var _=require(_0xbf0f('0x0'));var util=require(_0xbf0f('0x1'));var moment=require(_0xbf0f('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf0f('0x3'));var fs=require('fs');var Redis=require(_0xbf0f('0x4'));var db=require(_0xbf0f('0x5'))['db'];var utils=require(_0xbf0f('0x6'));var logger=require('../../config/logger')(_0xbf0f('0x7'));var config=require(_0xbf0f('0x8'));var jayson=require(_0xbf0f('0x9'));var client=jayson[_0xbf0f('0xa')]['http']({'port':0x232a});config['redis']=_[_0xbf0f('0xb')](config[_0xbf0f('0xc')],{'host':_0xbf0f('0xd'),'port':0x18eb});var socket=require(_0xbf0f('0xe'))(new Redis(config[_0xbf0f('0xc')]));require(_0xbf0f('0xf'))[_0xbf0f('0x10')](socket);function respondWithRpcPromise(_0x476d4e,_0x280494,_0x500e50){return new BPromise(function(_0x17d307,_0x297cc3){return client[_0xbf0f('0x11')](_0x476d4e,_0x500e50)[_0xbf0f('0x12')](function(_0x577f01){logger[_0xbf0f('0x13')]('SquareProject,\x20%s,\x20%s',_0x280494,_0xbf0f('0x14'));logger[_0xbf0f('0x15')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x280494,_0xbf0f('0x14'),JSON[_0xbf0f('0x16')](_0x577f01));if(_0x577f01[_0xbf0f('0x17')]){if(_0x577f01[_0xbf0f('0x17')][_0xbf0f('0x18')]===0x1f4){logger[_0xbf0f('0x17')](_0xbf0f('0x19'),_0x280494,_0x577f01[_0xbf0f('0x17')][_0xbf0f('0x1a')]);return _0x297cc3(_0x577f01[_0xbf0f('0x17')]['message']);}logger[_0xbf0f('0x17')](_0xbf0f('0x19'),_0x280494,_0x577f01[_0xbf0f('0x17')][_0xbf0f('0x1a')]);return _0x17d307(_0x577f01[_0xbf0f('0x17')][_0xbf0f('0x1a')]);}else{logger[_0xbf0f('0x13')](_0xbf0f('0x19'),_0x280494,'request\x20sent');_0x17d307(_0x577f01['result'][_0xbf0f('0x1a')]);}})[_0xbf0f('0x1b')](function(_0x22c8aa){logger[_0xbf0f('0x17')](_0xbf0f('0x19'),_0x280494,_0x22c8aa);_0x297cc3(_0x22c8aa);});});}exports['ShowSquareProject']=function(_0x48023b){var _0x98a482=this;return new Promise(function(_0x4f1bf3,_0x15c135){return db[_0xbf0f('0x1c')]['find']({'raw':_0x48023b[_0xbf0f('0x1d')]?_0x48023b[_0xbf0f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x48023b['options']?_0x48023b['options'][_0xbf0f('0x1e')]||null:null,'attributes':_0x48023b[_0xbf0f('0x1d')]?_0x48023b[_0xbf0f('0x1d')][_0xbf0f('0x1f')]||null:null,'include':_0x48023b[_0xbf0f('0x1d')]?_0x48023b[_0xbf0f('0x1d')]['include']?_[_0xbf0f('0x20')](_0x48023b[_0xbf0f('0x1d')]['include'],function(_0x2a3943){return{'model':db[_0x2a3943[_0xbf0f('0x21')]],'as':_0x2a3943['as'],'attributes':_0x2a3943[_0xbf0f('0x1f')],'include':_0x2a3943['include']?_[_0xbf0f('0x20')](_0x2a3943[_0xbf0f('0x22')],function(_0x29c635){return{'model':db[_0x29c635[_0xbf0f('0x21')]],'as':_0x29c635['as'],'attributes':_0x29c635[_0xbf0f('0x1f')],'include':_0x29c635['include']?_[_0xbf0f('0x20')](_0x29c635[_0xbf0f('0x22')],function(_0x392b0e){return{'model':db[_0x392b0e['model']],'as':_0x392b0e['as'],'attributes':_0x392b0e[_0xbf0f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbf0f('0x12')](function(_0x1692e4){logger[_0xbf0f('0x13')](_0xbf0f('0x23'),_0x48023b);logger[_0xbf0f('0x15')](_0xbf0f('0x23'),_0x48023b,JSON[_0xbf0f('0x16')](_0x1692e4));_0x4f1bf3(_0x1692e4);})['catch'](function(_0x5131e6){logger[_0xbf0f('0x17')](_0xbf0f('0x23'),_0x5131e6[_0xbf0f('0x1a')],_0x48023b);_0x15c135(_0x98a482[_0xbf0f('0x17')](0x1f4,_0x5131e6['message']));});});};
\ No newline at end of file
+var _0x7823=['SquareProject','findAll','options','raw','attributes','limit','include','map','model','GetSquareProjects','catch','error','message','ShowSquareProject','find','where','info','stringify','lodash','ioredis','../../mysqldb','rpc','../../config/environment','redis','./squareProject.socket','register'];(function(_0x7863cc,_0x1f5b93){var _0x1ec3ea=function(_0x5e6f13){while(--_0x5e6f13){_0x7863cc['push'](_0x7863cc['shift']());}};_0x1ec3ea(++_0x1f5b93);}(_0x7823,0x164));var _0x3782=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7823[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x3782('0x0'));var Redis=require(_0x3782('0x1'));var db=require(_0x3782('0x2'))['db'];var logger=require('../../config/logger')(_0x3782('0x3'));var config=require(_0x3782('0x4'));config[_0x3782('0x5')]=_['defaults'](config[_0x3782('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3782('0x6'))[_0x3782('0x7')](socket);exports['GetSquareProjects']=function(_0x144786){var _0x40421e=this;return new Promise(function(_0x2f0573,_0x3c7ecb){return db[_0x3782('0x8')][_0x3782('0x9')]({'raw':_0x144786[_0x3782('0xa')]?_0x144786['options'][_0x3782('0xb')]===undefined?!![]:![]:!![],'where':_0x144786['options']?_0x144786[_0x3782('0xa')]['where']||null:null,'attributes':_0x144786[_0x3782('0xa')]?_0x144786[_0x3782('0xa')][_0x3782('0xc')]||null:null,'limit':_0x144786[_0x3782('0xa')]?_0x144786[_0x3782('0xa')][_0x3782('0xd')]||null:null,'include':_0x144786[_0x3782('0xa')]?_0x144786['options'][_0x3782('0xe')]?_[_0x3782('0xf')](_0x144786[_0x3782('0xa')][_0x3782('0xe')],function(_0x35d641){return{'model':db[_0x35d641[_0x3782('0x10')]],'as':_0x35d641['as'],'attributes':_0x35d641[_0x3782('0xc')],'include':_0x35d641[_0x3782('0xe')]?_[_0x3782('0xf')](_0x35d641[_0x3782('0xe')],function(_0x4ea392){return{'model':db[_0x4ea392[_0x3782('0x10')]],'as':_0x4ea392['as'],'attributes':_0x4ea392['attributes'],'include':_0x4ea392[_0x3782('0xe')]?_['map'](_0x4ea392[_0x3782('0xe')],function(_0x1740bc){return{'model':db[_0x1740bc['model']],'as':_0x1740bc['as'],'attributes':_0x1740bc[_0x3782('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x252a31){logger['info']('GetSquareProjects',_0x144786);logger['debug'](_0x3782('0x11'),_0x144786,JSON['stringify'](_0x252a31));_0x2f0573(_0x252a31);})[_0x3782('0x12')](function(_0xca14f4){logger[_0x3782('0x13')](_0x3782('0x11'),_0xca14f4[_0x3782('0x14')],_0x144786);_0x3c7ecb(_0x40421e[_0x3782('0x13')](0x1f4,_0xca14f4[_0x3782('0x14')]));});});};exports[_0x3782('0x15')]=function(_0x3e016b){var _0x478006=this;return new Promise(function(_0x507071,_0x21eb87){return db[_0x3782('0x8')][_0x3782('0x16')]({'raw':_0x3e016b[_0x3782('0xa')]?_0x3e016b[_0x3782('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x3e016b[_0x3782('0xa')]?_0x3e016b['options'][_0x3782('0x17')]||null:null,'attributes':_0x3e016b['options']?_0x3e016b[_0x3782('0xa')][_0x3782('0xc')]||null:null,'include':_0x3e016b['options']?_0x3e016b[_0x3782('0xa')][_0x3782('0xe')]?_[_0x3782('0xf')](_0x3e016b[_0x3782('0xa')]['include'],function(_0xfd8276){return{'model':db[_0xfd8276[_0x3782('0x10')]],'as':_0xfd8276['as'],'attributes':_0xfd8276[_0x3782('0xc')],'include':_0xfd8276[_0x3782('0xe')]?_[_0x3782('0xf')](_0xfd8276[_0x3782('0xe')],function(_0x278c96){return{'model':db[_0x278c96[_0x3782('0x10')]],'as':_0x278c96['as'],'attributes':_0x278c96[_0x3782('0xc')],'include':_0x278c96[_0x3782('0xe')]?_[_0x3782('0xf')](_0x278c96[_0x3782('0xe')],function(_0x1d3ba1){return{'model':db[_0x1d3ba1[_0x3782('0x10')]],'as':_0x1d3ba1['as'],'attributes':_0x1d3ba1[_0x3782('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5495bd){logger[_0x3782('0x18')](_0x3782('0x15'),_0x3e016b);logger['debug'](_0x3782('0x15'),_0x3e016b,JSON[_0x3782('0x19')](_0x5495bd));_0x507071(_0x5495bd);})['catch'](function(_0x201431){logger['error'](_0x3782('0x15'),_0x201431[_0x3782('0x14')],_0x3e016b);_0x21eb87(_0x478006[_0x3782('0x13')](0x1f4,_0x201431[_0x3782('0x14')]));});});};
\ No newline at end of file