Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / api / cmContact / cmContact.rpc.js
index 43fc844..e29241e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4cc=['redis','localhost','socket.io-emitter','./cmContact.socket','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ShowCmContact','CmContact','find','options','raw','where','map','include','model','attributes','then','catch','CreateCmContact','create','body','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x253c95,_0x39fd4a){var _0x5934d4=function(_0x214023){while(--_0x214023){_0x253c95['push'](_0x253c95['shift']());}};_0x5934d4(++_0x39fd4a);}(_0xc4cc,0x94));var _0xcc4c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc4cc[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xcc4c('0x0'));var util=require(_0xcc4c('0x1'));var moment=require(_0xcc4c('0x2'));var BPromise=require(_0xcc4c('0x3'));var rs=require(_0xcc4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc4c('0x5'))['db'];var utils=require(_0xcc4c('0x6'));var logger=require(_0xcc4c('0x7'))('rpc');var config=require(_0xcc4c('0x8'));var jayson=require(_0xcc4c('0x9'));var client=jayson[_0xcc4c('0xa')][_0xcc4c('0xb')]({'port':0x232a});config[_0xcc4c('0xc')]=_['defaults'](config[_0xcc4c('0xc')],{'host':_0xcc4c('0xd'),'port':0x18eb});var socket=require(_0xcc4c('0xe'))(new Redis(config[_0xcc4c('0xc')]));require(_0xcc4c('0xf'))['register'](socket);function respondWithRpcPromise(_0x1424b9,_0x2287a0,_0x32fc51){return new BPromise(function(_0x3c2422,_0x20286a){return client['request'](_0x1424b9,_0x32fc51)['then'](function(_0x1997d0){logger['info'](_0xcc4c('0x10'),_0x2287a0,_0xcc4c('0x11'));logger[_0xcc4c('0x12')](_0xcc4c('0x13'),_0x2287a0,_0xcc4c('0x11'),JSON[_0xcc4c('0x14')](_0x1997d0));if(_0x1997d0[_0xcc4c('0x15')]){if(_0x1997d0[_0xcc4c('0x15')][_0xcc4c('0x16')]===0x1f4){logger[_0xcc4c('0x15')](_0xcc4c('0x10'),_0x2287a0,_0x1997d0[_0xcc4c('0x15')][_0xcc4c('0x17')]);return _0x20286a(_0x1997d0[_0xcc4c('0x15')][_0xcc4c('0x17')]);}logger[_0xcc4c('0x15')](_0xcc4c('0x10'),_0x2287a0,_0x1997d0[_0xcc4c('0x15')]['message']);return _0x3c2422(_0x1997d0[_0xcc4c('0x15')][_0xcc4c('0x17')]);}else{logger[_0xcc4c('0x18')](_0xcc4c('0x10'),_0x2287a0,_0xcc4c('0x11'));_0x3c2422(_0x1997d0['result'][_0xcc4c('0x17')]);}})['catch'](function(_0x4719b7){logger[_0xcc4c('0x15')]('CmContact,\x20%s,\x20%s',_0x2287a0,_0x4719b7);_0x20286a(_0x4719b7);});});}exports[_0xcc4c('0x19')]=function(_0x16876a){var _0x50a08c=this;return new Promise(function(_0x14334b,_0x3ef2cf){return db[_0xcc4c('0x1a')][_0xcc4c('0x1b')]({'raw':_0x16876a[_0xcc4c('0x1c')]?_0x16876a['options'][_0xcc4c('0x1d')]===undefined?!![]:![]:!![],'where':_0x16876a[_0xcc4c('0x1c')]?_0x16876a[_0xcc4c('0x1c')][_0xcc4c('0x1e')]||null:null,'attributes':_0x16876a[_0xcc4c('0x1c')]?_0x16876a['options']['attributes']||null:null,'include':_0x16876a[_0xcc4c('0x1c')]?_0x16876a['options']['include']?_[_0xcc4c('0x1f')](_0x16876a[_0xcc4c('0x1c')][_0xcc4c('0x20')],function(_0x2da5a7){return{'model':db[_0x2da5a7[_0xcc4c('0x21')]],'as':_0x2da5a7['as'],'attributes':_0x2da5a7[_0xcc4c('0x22')],'include':_0x2da5a7['include']?_[_0xcc4c('0x1f')](_0x2da5a7[_0xcc4c('0x20')],function(_0x534f2d){return{'model':db[_0x534f2d[_0xcc4c('0x21')]],'as':_0x534f2d['as'],'attributes':_0x534f2d[_0xcc4c('0x22')],'include':_0x534f2d[_0xcc4c('0x20')]?_['map'](_0x534f2d[_0xcc4c('0x20')],function(_0x457938){return{'model':db[_0x457938[_0xcc4c('0x21')]],'as':_0x457938['as'],'attributes':_0x457938['attributes']};}):[]};}):[]};}):[]:[]})[_0xcc4c('0x23')](function(_0x51795a){logger[_0xcc4c('0x18')]('ShowCmContact',_0x16876a);logger['debug']('ShowCmContact',_0x16876a,JSON[_0xcc4c('0x14')](_0x51795a));_0x14334b(_0x51795a);})[_0xcc4c('0x24')](function(_0x598cac){logger[_0xcc4c('0x15')](_0xcc4c('0x19'),_0x598cac[_0xcc4c('0x17')],_0x16876a);_0x3ef2cf(_0x50a08c[_0xcc4c('0x15')](0x1f4,_0x598cac['message']));});});};exports[_0xcc4c('0x25')]=function(_0x145336){var _0x5cae2f=this;return new Promise(function(_0x2654d4,_0x1c483c){return db[_0xcc4c('0x1a')][_0xcc4c('0x26')](_0x145336[_0xcc4c('0x27')],{'raw':_0x145336[_0xcc4c('0x1c')]?_0x145336['options'][_0xcc4c('0x1d')]===undefined?!![]:![]:!![]})[_0xcc4c('0x23')](function(_0x4239ed){logger[_0xcc4c('0x18')]('CreateCmContact',_0x145336);logger[_0xcc4c('0x12')](_0xcc4c('0x25'),_0x145336,JSON[_0xcc4c('0x14')](_0x4239ed));_0x2654d4(_0x4239ed);})['catch'](function(_0xeb7f77){logger[_0xcc4c('0x15')](_0xcc4c('0x25'),_0xeb7f77[_0xcc4c('0x17')],_0x145336);_0x1c483c(_0x5cae2f[_0xcc4c('0x15')](0x1f4,_0xeb7f77[_0xcc4c('0x17')]));});});};
\ No newline at end of file
+var _0x2e3a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./cmContact.socket','info','request\x20sent','debug','stringify','error','code','CmContact,\x20%s,\x20%s','message','result','catch','ShowCmContact','options','raw','where','attributes','include','model','map','create','body','then','CreateCmContact','lodash','util','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e3a,0x125));var _0xa2e3=function(_0x2cff15,_0x3faa0f){_0x2cff15=_0x2cff15-0x0;var _0x494405=_0x2e3a[_0x2cff15];return _0x494405;};'use strict';var _=require(_0xa2e3('0x0'));var util=require(_0xa2e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa2e3('0x2'));var fs=require('fs');var Redis=require(_0xa2e3('0x3'));var db=require(_0xa2e3('0x4'))['db'];var utils=require(_0xa2e3('0x5'));var logger=require(_0xa2e3('0x6'))(_0xa2e3('0x7'));var config=require(_0xa2e3('0x8'));var jayson=require(_0xa2e3('0x9'));var client=jayson[_0xa2e3('0xa')]['http']({'port':0x232a});config['redis']=_[_0xa2e3('0xb')](config['redis'],{'host':_0xa2e3('0xc'),'port':0x18eb});var socket=require(_0xa2e3('0xd'))(new Redis(config['redis']));require(_0xa2e3('0xe'))['register'](socket);function respondWithRpcPromise(_0x2fe4d4,_0x385622,_0x43244f){return new BPromise(function(_0x5c29f9,_0x22e30a){return client['request'](_0x2fe4d4,_0x43244f)['then'](function(_0x8b2dfd){logger[_0xa2e3('0xf')]('CmContact,\x20%s,\x20%s',_0x385622,_0xa2e3('0x10'));logger[_0xa2e3('0x11')]('CmContact,\x20%s,\x20%s,\x20%s',_0x385622,'request\x20sent',JSON[_0xa2e3('0x12')](_0x8b2dfd));if(_0x8b2dfd[_0xa2e3('0x13')]){if(_0x8b2dfd[_0xa2e3('0x13')][_0xa2e3('0x14')]===0x1f4){logger[_0xa2e3('0x13')](_0xa2e3('0x15'),_0x385622,_0x8b2dfd[_0xa2e3('0x13')][_0xa2e3('0x16')]);return _0x22e30a(_0x8b2dfd['error'][_0xa2e3('0x16')]);}logger['error']('CmContact,\x20%s,\x20%s',_0x385622,_0x8b2dfd[_0xa2e3('0x13')][_0xa2e3('0x16')]);return _0x5c29f9(_0x8b2dfd[_0xa2e3('0x13')][_0xa2e3('0x16')]);}else{logger[_0xa2e3('0xf')]('CmContact,\x20%s,\x20%s',_0x385622,'request\x20sent');_0x5c29f9(_0x8b2dfd[_0xa2e3('0x17')]['message']);}})[_0xa2e3('0x18')](function(_0xc63b5f){logger[_0xa2e3('0x13')](_0xa2e3('0x15'),_0x385622,_0xc63b5f);_0x22e30a(_0xc63b5f);});});}exports[_0xa2e3('0x19')]=function(_0x386216){var _0x547f21=this;return new Promise(function(_0x1a885a,_0x2dd2fc){return db['CmContact']['find']({'raw':_0x386216[_0xa2e3('0x1a')]?_0x386216[_0xa2e3('0x1a')][_0xa2e3('0x1b')]===undefined?!![]:![]:!![],'where':_0x386216['options']?_0x386216[_0xa2e3('0x1a')][_0xa2e3('0x1c')]||null:null,'attributes':_0x386216[_0xa2e3('0x1a')]?_0x386216[_0xa2e3('0x1a')][_0xa2e3('0x1d')]||null:null,'include':_0x386216['options']?_0x386216[_0xa2e3('0x1a')][_0xa2e3('0x1e')]?_['map'](_0x386216[_0xa2e3('0x1a')][_0xa2e3('0x1e')],function(_0x230f37){return{'model':db[_0x230f37[_0xa2e3('0x1f')]],'as':_0x230f37['as'],'attributes':_0x230f37[_0xa2e3('0x1d')],'include':_0x230f37[_0xa2e3('0x1e')]?_[_0xa2e3('0x20')](_0x230f37[_0xa2e3('0x1e')],function(_0x2fc273){return{'model':db[_0x2fc273['model']],'as':_0x2fc273['as'],'attributes':_0x2fc273[_0xa2e3('0x1d')],'include':_0x2fc273['include']?_[_0xa2e3('0x20')](_0x2fc273[_0xa2e3('0x1e')],function(_0xd63311){return{'model':db[_0xd63311[_0xa2e3('0x1f')]],'as':_0xd63311['as'],'attributes':_0xd63311[_0xa2e3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27eb15){logger[_0xa2e3('0xf')]('ShowCmContact',_0x386216);logger[_0xa2e3('0x11')](_0xa2e3('0x19'),_0x386216,JSON[_0xa2e3('0x12')](_0x27eb15));_0x1a885a(_0x27eb15);})[_0xa2e3('0x18')](function(_0x5227f5){logger[_0xa2e3('0x13')]('ShowCmContact',_0x5227f5[_0xa2e3('0x16')],_0x386216);_0x2dd2fc(_0x547f21[_0xa2e3('0x13')](0x1f4,_0x5227f5[_0xa2e3('0x16')]));});});};exports['CreateCmContact']=function(_0x1aec33){var _0xfa91d9=this;return new Promise(function(_0x18670e,_0x58e069){return db['CmContact'][_0xa2e3('0x21')](_0x1aec33[_0xa2e3('0x22')],{'raw':_0x1aec33[_0xa2e3('0x1a')]?_0x1aec33['options'][_0xa2e3('0x1b')]===undefined?!![]:![]:!![]})[_0xa2e3('0x23')](function(_0xa975f4){logger[_0xa2e3('0xf')]('CreateCmContact',_0x1aec33);logger[_0xa2e3('0x11')](_0xa2e3('0x24'),_0x1aec33,JSON[_0xa2e3('0x12')](_0xa975f4));_0x18670e(_0xa975f4);})[_0xa2e3('0x18')](function(_0x12b638){logger['error']('CreateCmContact',_0x12b638['message'],_0x1aec33);_0x58e069(_0xfa91d9[_0xa2e3('0x13')](0x1f4,_0x12b638[_0xa2e3('0x16')]));});});};
\ No newline at end of file