Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / condition / condition.rpc.js
index ba599e7..3cde075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa186=['then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xa186,0x185));var _0x6a18=function(_0x31f5c2,_0x2a47d3){_0x31f5c2=_0x31f5c2-0x0;var _0xcb7d73=_0xa186[_0x31f5c2];return _0xcb7d73;};'use strict';var _=require('lodash');var util=require(_0x6a18('0x0'));var moment=require(_0x6a18('0x1'));var BPromise=require(_0x6a18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6a18('0x3'));var logger=require(_0x6a18('0x4'))(_0x6a18('0x5'));var config=require(_0x6a18('0x6'));var jayson=require(_0x6a18('0x7'));var client=jayson[_0x6a18('0x8')][_0x6a18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ccc9f,_0x1f7673,_0x20f745){return new BPromise(function(_0x1842c7,_0x41f242){return client[_0x6a18('0xa')](_0x4ccc9f,_0x20f745)[_0x6a18('0xb')](function(_0x3e0a80){logger[_0x6a18('0xc')](_0x6a18('0xd'),_0x1f7673,_0x6a18('0xe'));logger['debug'](_0x6a18('0xf'),_0x1f7673,_0x6a18('0xe'),JSON[_0x6a18('0x10')](_0x3e0a80));if(_0x3e0a80[_0x6a18('0x11')]){if(_0x3e0a80[_0x6a18('0x11')][_0x6a18('0x12')]===0x1f4){logger[_0x6a18('0x11')](_0x6a18('0xd'),_0x1f7673,_0x3e0a80['error']['message']);return _0x41f242(_0x3e0a80[_0x6a18('0x11')][_0x6a18('0x13')]);}logger[_0x6a18('0x11')](_0x6a18('0xd'),_0x1f7673,_0x3e0a80[_0x6a18('0x11')]['message']);return _0x1842c7(_0x3e0a80[_0x6a18('0x11')][_0x6a18('0x13')]);}else{logger[_0x6a18('0xc')](_0x6a18('0xd'),_0x1f7673,'request\x20sent');_0x1842c7(_0x3e0a80['result'][_0x6a18('0x13')]);}})['catch'](function(_0x3ffbd4){logger['error'](_0x6a18('0xd'),_0x1f7673,_0x3ffbd4);_0x41f242(_0x3ffbd4);});});}
\ No newline at end of file
+var _0xfc64=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xfc64,0x135));var _0x4fc6=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xfc64[_0x59c301];return _0x3866b9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4fc6('0x0'));var BPromise=require(_0x4fc6('0x1'));var rs=require(_0x4fc6('0x2'));var fs=require('fs');var Redis=require(_0x4fc6('0x3'));var db=require(_0x4fc6('0x4'))['db'];var utils=require(_0x4fc6('0x5'));var logger=require(_0x4fc6('0x6'))('rpc');var config=require(_0x4fc6('0x7'));var jayson=require(_0x4fc6('0x8'));var client=jayson[_0x4fc6('0x9')][_0x4fc6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x328110,_0x541f0e,_0x32409b){return new BPromise(function(_0x47e79e,_0x239835){return client[_0x4fc6('0xb')](_0x328110,_0x32409b)['then'](function(_0x204925){logger[_0x4fc6('0xc')](_0x4fc6('0xd'),_0x541f0e,_0x4fc6('0xe'));logger[_0x4fc6('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x541f0e,_0x4fc6('0xe'),JSON[_0x4fc6('0x10')](_0x204925));if(_0x204925[_0x4fc6('0x11')]){if(_0x204925[_0x4fc6('0x11')]['code']===0x1f4){logger[_0x4fc6('0x11')](_0x4fc6('0xd'),_0x541f0e,_0x204925[_0x4fc6('0x11')][_0x4fc6('0x12')]);return _0x239835(_0x204925[_0x4fc6('0x11')][_0x4fc6('0x12')]);}logger['error'](_0x4fc6('0xd'),_0x541f0e,_0x204925[_0x4fc6('0x11')][_0x4fc6('0x12')]);return _0x47e79e(_0x204925['error'][_0x4fc6('0x12')]);}else{logger[_0x4fc6('0xc')](_0x4fc6('0xd'),_0x541f0e,'request\x20sent');_0x47e79e(_0x204925[_0x4fc6('0x13')][_0x4fc6('0x12')]);}})[_0x4fc6('0x14')](function(_0x1fe5e1){logger['error']('Condition,\x20%s,\x20%s',_0x541f0e,_0x1fe5e1);_0x239835(_0x1fe5e1);});});}
\ No newline at end of file