Built motion from commit e1760111.|2.6.18
[motion2.git] / server / api / memberReport / memberReport.rpc.js
index 0ef2c6d..82cd181 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a5c=['include','map','model','MemberReport','create','CreateMemberReport','UpdateMemberReport','body','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','findAll','raw','options','where','attributes','limit'];(function(_0x4e0772,_0x3acd20){var _0x1e91d7=function(_0xb1a4e1){while(--_0xb1a4e1){_0x4e0772['push'](_0x4e0772['shift']());}};_0x1e91d7(++_0x3acd20);}(_0x8a5c,0x112));var _0xc8a5=function(_0x1af793,_0x532ce4){_0x1af793=_0x1af793-0x0;var _0x58f85d=_0x8a5c[_0x1af793];return _0x58f85d;};'use strict';var _=require('lodash');var util=require(_0xc8a5('0x0'));var moment=require(_0xc8a5('0x1'));var BPromise=require(_0xc8a5('0x2'));var rs=require(_0xc8a5('0x3'));var fs=require('fs');var Redis=require(_0xc8a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8a5('0x5'));var logger=require(_0xc8a5('0x6'))('rpc');var config=require(_0xc8a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc8a5('0x8')][_0xc8a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c4b32,_0x3992ad,_0x276c15){return new BPromise(function(_0x3a03af,_0x1de487){return client[_0xc8a5('0xa')](_0x2c4b32,_0x276c15)[_0xc8a5('0xb')](function(_0xb1c7f4){logger[_0xc8a5('0xc')](_0xc8a5('0xd'),_0x3992ad,_0xc8a5('0xe'));logger[_0xc8a5('0xf')](_0xc8a5('0x10'),_0x3992ad,_0xc8a5('0xe'),JSON[_0xc8a5('0x11')](_0xb1c7f4));if(_0xb1c7f4[_0xc8a5('0x12')]){if(_0xb1c7f4[_0xc8a5('0x12')][_0xc8a5('0x13')]===0x1f4){logger['error'](_0xc8a5('0xd'),_0x3992ad,_0xb1c7f4['error'][_0xc8a5('0x14')]);return _0x1de487(_0xb1c7f4[_0xc8a5('0x12')]['message']);}logger[_0xc8a5('0x12')]('MemberReport,\x20%s,\x20%s',_0x3992ad,_0xb1c7f4['error']['message']);return _0x3a03af(_0xb1c7f4[_0xc8a5('0x12')]['message']);}else{logger[_0xc8a5('0xc')](_0xc8a5('0xd'),_0x3992ad,_0xc8a5('0xe'));_0x3a03af(_0xb1c7f4[_0xc8a5('0x15')][_0xc8a5('0x14')]);}})[_0xc8a5('0x16')](function(_0x39e72c){logger[_0xc8a5('0x12')](_0xc8a5('0xd'),_0x3992ad,_0x39e72c);_0x1de487(_0x39e72c);});});}exports[_0xc8a5('0x17')]=function(_0x1dc268){var _0x8a53fa=this;return new Promise(function(_0x2c9bba,_0x453179){return db['MemberReport'][_0xc8a5('0x18')]({'raw':_0x1dc268['options']?_0x1dc268['options'][_0xc8a5('0x19')]===undefined?!![]:![]:!![],'where':_0x1dc268[_0xc8a5('0x1a')]?_0x1dc268[_0xc8a5('0x1a')][_0xc8a5('0x1b')]||null:null,'attributes':_0x1dc268[_0xc8a5('0x1a')]?_0x1dc268[_0xc8a5('0x1a')][_0xc8a5('0x1c')]||null:null,'limit':_0x1dc268[_0xc8a5('0x1a')]?_0x1dc268[_0xc8a5('0x1a')][_0xc8a5('0x1d')]||null:null,'include':_0x1dc268[_0xc8a5('0x1a')]?_0x1dc268['options'][_0xc8a5('0x1e')]?_[_0xc8a5('0x1f')](_0x1dc268[_0xc8a5('0x1a')][_0xc8a5('0x1e')],function(_0x417f7f){return{'model':db[_0x417f7f['model']],'as':_0x417f7f['as'],'attributes':_0x417f7f[_0xc8a5('0x1c')],'include':_0x417f7f[_0xc8a5('0x1e')]?_[_0xc8a5('0x1f')](_0x417f7f[_0xc8a5('0x1e')],function(_0x57cbcf){return{'model':db[_0x57cbcf[_0xc8a5('0x20')]],'as':_0x57cbcf['as'],'attributes':_0x57cbcf[_0xc8a5('0x1c')],'include':_0x57cbcf[_0xc8a5('0x1e')]?_[_0xc8a5('0x1f')](_0x57cbcf[_0xc8a5('0x1e')],function(_0x1922fd){return{'model':db[_0x1922fd[_0xc8a5('0x20')]],'as':_0x1922fd['as'],'attributes':_0x1922fd[_0xc8a5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc8a5('0xb')](function(_0x47eeb4){logger['info']('GetMemberReport',_0x1dc268);logger['debug'](_0xc8a5('0x17'),_0x1dc268,JSON[_0xc8a5('0x11')](_0x47eeb4));_0x2c9bba(_0x47eeb4);})[_0xc8a5('0x16')](function(_0x2fe38b){logger['error'](_0xc8a5('0x17'),_0x2fe38b[_0xc8a5('0x14')],_0x1dc268);_0x453179(_0x8a53fa[_0xc8a5('0x12')](0x1f4,_0x2fe38b['message']));});});};exports['CreateMemberReport']=function(_0x2e6f60){var _0x25c91c=this;return new Promise(function(_0x2f6aef,_0x4d3043){return db[_0xc8a5('0x21')][_0xc8a5('0x22')](_0x2e6f60['body'],{'raw':_0x2e6f60[_0xc8a5('0x1a')]?_0x2e6f60[_0xc8a5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xc8a5('0xb')](function(_0x1aad3c){logger[_0xc8a5('0xc')](_0xc8a5('0x23'),_0x2e6f60);logger[_0xc8a5('0xf')](_0xc8a5('0x23'),_0x2e6f60,JSON[_0xc8a5('0x11')](_0x1aad3c));_0x2f6aef(_0x1aad3c);})[_0xc8a5('0x16')](function(_0x4823ab){logger[_0xc8a5('0x12')](_0xc8a5('0x23'),_0x4823ab[_0xc8a5('0x14')],_0x2e6f60);_0x4d3043(_0x25c91c['error'](0x1f4,_0x4823ab[_0xc8a5('0x14')]));});});};exports[_0xc8a5('0x24')]=function(_0x4b9397){var _0xa1c270=this;return new Promise(function(_0x4c83d2,_0x323ef4){return db['MemberReport']['update'](_0x4b9397[_0xc8a5('0x25')],{'raw':_0x4b9397[_0xc8a5('0x1a')]?_0x4b9397[_0xc8a5('0x1a')][_0xc8a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b9397['options']?_0x4b9397[_0xc8a5('0x1a')][_0xc8a5('0x1b')]||null:null,'attributes':_0x4b9397[_0xc8a5('0x1a')]?_0x4b9397[_0xc8a5('0x1a')][_0xc8a5('0x1c')]||null:null,'limit':_0x4b9397[_0xc8a5('0x1a')]?_0x4b9397[_0xc8a5('0x1a')][_0xc8a5('0x1d')]||null:null})[_0xc8a5('0xb')](function(_0x7f727c){logger[_0xc8a5('0xc')](_0xc8a5('0x24'),_0x4b9397);logger[_0xc8a5('0xf')]('UpdateMemberReport',_0x4b9397,JSON[_0xc8a5('0x11')](_0x7f727c));_0x4c83d2(_0x7f727c);})['catch'](function(_0x17bca3){logger[_0xc8a5('0x12')](_0xc8a5('0x24'),_0x17bca3[_0xc8a5('0x14')],_0x4b9397);_0x323ef4(_0xa1c270[_0xc8a5('0x12')](0x1f4,_0x17bca3[_0xc8a5('0x14')]));});});};
\ No newline at end of file
+var _0xf1c6=['body','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','where','limit','include','map','model','attributes','then','debug','stringify','CreateMemberReport','create','raw','UpdateMemberReport'];(function(_0x3fa65f,_0x15475f){var _0x246bf1=function(_0x469682){while(--_0x469682){_0x3fa65f['push'](_0x3fa65f['shift']());}};_0x246bf1(++_0x15475f);}(_0xf1c6,0x145));var _0x6f1c=function(_0x2c4978,_0x42d48f){_0x2c4978=_0x2c4978-0x0;var _0x26e6d7=_0xf1c6[_0x2c4978];return _0x26e6d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f1c('0x0'));var BPromise=require(_0x6f1c('0x1'));var rs=require(_0x6f1c('0x2'));var fs=require('fs');var Redis=require(_0x6f1c('0x3'));var db=require(_0x6f1c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f1c('0x5'));var config=require('../../config/environment');var jayson=require(_0x6f1c('0x6'));var client=jayson[_0x6f1c('0x7')][_0x6f1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x537c4f,_0x1c1751,_0x564a8f){return new BPromise(function(_0x275f11,_0x2d8ce2){return client[_0x6f1c('0x9')](_0x537c4f,_0x564a8f)['then'](function(_0x2f5ff0){logger['info'](_0x6f1c('0xa'),_0x1c1751,_0x6f1c('0xb'));logger['debug'](_0x6f1c('0xc'),_0x1c1751,_0x6f1c('0xb'),JSON['stringify'](_0x2f5ff0));if(_0x2f5ff0['error']){if(_0x2f5ff0['error']['code']===0x1f4){logger[_0x6f1c('0xd')]('MemberReport,\x20%s,\x20%s',_0x1c1751,_0x2f5ff0['error']['message']);return _0x2d8ce2(_0x2f5ff0['error']['message']);}logger[_0x6f1c('0xd')](_0x6f1c('0xa'),_0x1c1751,_0x2f5ff0[_0x6f1c('0xd')]['message']);return _0x275f11(_0x2f5ff0[_0x6f1c('0xd')][_0x6f1c('0xe')]);}else{logger[_0x6f1c('0xf')]('MemberReport,\x20%s,\x20%s',_0x1c1751,_0x6f1c('0xb'));_0x275f11(_0x2f5ff0[_0x6f1c('0x10')]['message']);}})[_0x6f1c('0x11')](function(_0x11bc81){logger[_0x6f1c('0xd')](_0x6f1c('0xa'),_0x1c1751,_0x11bc81);_0x2d8ce2(_0x11bc81);});});}exports[_0x6f1c('0x12')]=function(_0x16d2bb){var _0x491151=this;return new Promise(function(_0x2f9949,_0x6035da){return db[_0x6f1c('0x13')][_0x6f1c('0x14')]({'raw':_0x16d2bb[_0x6f1c('0x15')]?_0x16d2bb[_0x6f1c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x16d2bb['options']?_0x16d2bb['options'][_0x6f1c('0x16')]||null:null,'attributes':_0x16d2bb['options']?_0x16d2bb[_0x6f1c('0x15')]['attributes']||null:null,'limit':_0x16d2bb[_0x6f1c('0x15')]?_0x16d2bb[_0x6f1c('0x15')][_0x6f1c('0x17')]||null:null,'include':_0x16d2bb[_0x6f1c('0x15')]?_0x16d2bb[_0x6f1c('0x15')][_0x6f1c('0x18')]?_[_0x6f1c('0x19')](_0x16d2bb[_0x6f1c('0x15')][_0x6f1c('0x18')],function(_0x18ff09){return{'model':db[_0x18ff09[_0x6f1c('0x1a')]],'as':_0x18ff09['as'],'attributes':_0x18ff09[_0x6f1c('0x1b')],'include':_0x18ff09[_0x6f1c('0x18')]?_[_0x6f1c('0x19')](_0x18ff09['include'],function(_0x2a3b6a){return{'model':db[_0x2a3b6a[_0x6f1c('0x1a')]],'as':_0x2a3b6a['as'],'attributes':_0x2a3b6a['attributes'],'include':_0x2a3b6a[_0x6f1c('0x18')]?_[_0x6f1c('0x19')](_0x2a3b6a['include'],function(_0x59931c){return{'model':db[_0x59931c['model']],'as':_0x59931c['as'],'attributes':_0x59931c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f1c('0x1c')](function(_0x1ac9f5){logger[_0x6f1c('0xf')](_0x6f1c('0x12'),_0x16d2bb);logger[_0x6f1c('0x1d')](_0x6f1c('0x12'),_0x16d2bb,JSON[_0x6f1c('0x1e')](_0x1ac9f5));_0x2f9949(_0x1ac9f5);})[_0x6f1c('0x11')](function(_0x32c722){logger[_0x6f1c('0xd')](_0x6f1c('0x12'),_0x32c722[_0x6f1c('0xe')],_0x16d2bb);_0x6035da(_0x491151['error'](0x1f4,_0x32c722['message']));});});};exports[_0x6f1c('0x1f')]=function(_0x4084af){var _0x383802=this;return new Promise(function(_0x26de6c,_0xad1bce){return db['MemberReport'][_0x6f1c('0x20')](_0x4084af['body'],{'raw':_0x4084af[_0x6f1c('0x15')]?_0x4084af['options'][_0x6f1c('0x21')]===undefined?!![]:![]:!![]})[_0x6f1c('0x1c')](function(_0x3c8585){logger[_0x6f1c('0xf')](_0x6f1c('0x1f'),_0x4084af);logger[_0x6f1c('0x1d')](_0x6f1c('0x1f'),_0x4084af,JSON[_0x6f1c('0x1e')](_0x3c8585));_0x26de6c(_0x3c8585);})[_0x6f1c('0x11')](function(_0x46e256){logger['error'](_0x6f1c('0x1f'),_0x46e256[_0x6f1c('0xe')],_0x4084af);_0xad1bce(_0x383802[_0x6f1c('0xd')](0x1f4,_0x46e256[_0x6f1c('0xe')]));});});};exports[_0x6f1c('0x22')]=function(_0x1609e3){var _0x454507=this;return new Promise(function(_0x326f85,_0x2a41ef){return db['MemberReport']['update'](_0x1609e3[_0x6f1c('0x23')],{'raw':_0x1609e3[_0x6f1c('0x15')]?_0x1609e3[_0x6f1c('0x15')][_0x6f1c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1609e3[_0x6f1c('0x15')]?_0x1609e3[_0x6f1c('0x15')][_0x6f1c('0x16')]||null:null,'attributes':_0x1609e3[_0x6f1c('0x15')]?_0x1609e3[_0x6f1c('0x15')][_0x6f1c('0x1b')]||null:null,'limit':_0x1609e3[_0x6f1c('0x15')]?_0x1609e3[_0x6f1c('0x15')][_0x6f1c('0x17')]||null:null})[_0x6f1c('0x1c')](function(_0x1731a4){logger[_0x6f1c('0xf')]('UpdateMemberReport',_0x1609e3);logger['debug'](_0x6f1c('0x22'),_0x1609e3,JSON[_0x6f1c('0x1e')](_0x1731a4));_0x326f85(_0x1731a4);})[_0x6f1c('0x11')](function(_0xa54c4){logger[_0x6f1c('0xd')](_0x6f1c('0x22'),_0xa54c4[_0x6f1c('0xe')],_0x1609e3);_0x2a41ef(_0x454507[_0x6f1c('0xd')](0x1f4,_0xa54c4[_0x6f1c('0xe')]));});});};
\ No newline at end of file