Built motion from commit 64a6f4bc.|2.6.26
[motion2.git] / server / api / attachment / attachment.rpc.js
index 91299ad..96e0b2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ba=['catch','CreateAttachment','Attachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x422d27,_0x529e20){var _0x56929a=function(_0xb45b70){while(--_0xb45b70){_0x422d27['push'](_0x422d27['shift']());}};_0x56929a(++_0x529e20);}(_0xc5ba,0xb9));var _0xac5b=function(_0x47e93d,_0x26bbdd){_0x47e93d=_0x47e93d-0x0;var _0xe86c46=_0xc5ba[_0x47e93d];return _0xe86c46;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var moment=require(_0xac5b('0x2'));var BPromise=require(_0xac5b('0x3'));var rs=require(_0xac5b('0x4'));var fs=require('fs');var Redis=require(_0xac5b('0x5'));var db=require(_0xac5b('0x6'))['db'];var utils=require(_0xac5b('0x7'));var logger=require(_0xac5b('0x8'))(_0xac5b('0x9'));var config=require(_0xac5b('0xa'));var jayson=require(_0xac5b('0xb'));var client=jayson[_0xac5b('0xc')][_0xac5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x38602a,_0xc09fbc,_0xc193a7){return new BPromise(function(_0x4a7fc7,_0x525e20){return client[_0xac5b('0xe')](_0x38602a,_0xc193a7)['then'](function(_0x3c5bd3){logger[_0xac5b('0xf')](_0xac5b('0x10'),_0xc09fbc,_0xac5b('0x11'));logger[_0xac5b('0x12')](_0xac5b('0x13'),_0xc09fbc,_0xac5b('0x11'),JSON[_0xac5b('0x14')](_0x3c5bd3));if(_0x3c5bd3[_0xac5b('0x15')]){if(_0x3c5bd3['error'][_0xac5b('0x16')]===0x1f4){logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);return _0x525e20(_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);}logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);return _0x4a7fc7(_0x3c5bd3[_0xac5b('0x15')]['message']);}else{logger[_0xac5b('0xf')](_0xac5b('0x10'),_0xc09fbc,_0xac5b('0x11'));_0x4a7fc7(_0x3c5bd3[_0xac5b('0x18')][_0xac5b('0x17')]);}})[_0xac5b('0x19')](function(_0x363de5){logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x363de5);_0x525e20(_0x363de5);});});}exports[_0xac5b('0x1a')]=function(_0x11e6fa){var _0x551ccf=this;return new Promise(function(_0x2db8d1,_0x4c46e5){return db[_0xac5b('0x1b')]['create'](_0x11e6fa[_0xac5b('0x1c')],{'raw':_0x11e6fa[_0xac5b('0x1d')]?_0x11e6fa['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3dbc5b){logger['info'](_0xac5b('0x1a'),_0x11e6fa);logger[_0xac5b('0x12')](_0xac5b('0x1a'),_0x11e6fa,JSON[_0xac5b('0x14')](_0x3dbc5b));_0x2db8d1(_0x3dbc5b);})[_0xac5b('0x19')](function(_0x5a4b94){logger['error']('CreateAttachment',_0x5a4b94[_0xac5b('0x17')],_0x11e6fa);_0x4c46e5(_0x551ccf['error'](0x1f4,_0x5a4b94[_0xac5b('0x17')]));});});};
\ No newline at end of file
+var _0xaf80=['client','request','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateAttachment','options','then','debug','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d5ad0,_0x40aeae){var _0x57a56b=function(_0x560999){while(--_0x560999){_0x1d5ad0['push'](_0x1d5ad0['shift']());}};_0x57a56b(++_0x40aeae);}(_0xaf80,0x1ef));var _0x0af8=function(_0x5d6b3f,_0x4f99b7){_0x5d6b3f=_0x5d6b3f-0x0;var _0x1421e9=_0xaf80[_0x5d6b3f];return _0x1421e9;};'use strict';var _=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var moment=require(_0x0af8('0x2'));var BPromise=require(_0x0af8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0af8('0x4'));var logger=require(_0x0af8('0x5'))(_0x0af8('0x6'));var config=require(_0x0af8('0x7'));var jayson=require(_0x0af8('0x8'));var client=jayson[_0x0af8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bce2c,_0x28f555,_0x538c1c){return new BPromise(function(_0x207a9b,_0x430bd4){return client[_0x0af8('0xa')](_0x4bce2c,_0x538c1c)['then'](function(_0xc0d5eb){logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,'request\x20sent');logger['debug'](_0x0af8('0xd'),_0x28f555,_0x0af8('0xe'),JSON[_0x0af8('0xf')](_0xc0d5eb));if(_0xc0d5eb[_0x0af8('0x10')]){if(_0xc0d5eb[_0x0af8('0x10')]['code']===0x1f4){logger[_0x0af8('0x10')](_0x0af8('0xc'),_0x28f555,_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);return _0x430bd4(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}logger[_0x0af8('0x10')]('Attachment,\x20%s,\x20%s',_0x28f555,_0xc0d5eb['error'][_0x0af8('0x11')]);return _0x207a9b(_0xc0d5eb[_0x0af8('0x10')][_0x0af8('0x11')]);}else{logger[_0x0af8('0xb')](_0x0af8('0xc'),_0x28f555,_0x0af8('0xe'));_0x207a9b(_0xc0d5eb[_0x0af8('0x12')][_0x0af8('0x11')]);}})['catch'](function(_0x5f4275){logger['error'](_0x0af8('0xc'),_0x28f555,_0x5f4275);_0x430bd4(_0x5f4275);});});}exports[_0x0af8('0x13')]=function(_0x54e946){var _0x2ace30=this;return new Promise(function(_0x230a68,_0x38068d){return db['Attachment']['create'](_0x54e946['body'],{'raw':_0x54e946[_0x0af8('0x14')]?_0x54e946[_0x0af8('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x0af8('0x15')](function(_0x4891e6){logger['info'](_0x0af8('0x13'),_0x54e946);logger[_0x0af8('0x16')](_0x0af8('0x13'),_0x54e946,JSON[_0x0af8('0xf')](_0x4891e6));_0x230a68(_0x4891e6);})[_0x0af8('0x17')](function(_0x52778f){logger['error'](_0x0af8('0x13'),_0x52778f[_0x0af8('0x11')],_0x54e946);_0x38068d(_0x2ace30[_0x0af8('0x10')](0x1f4,_0x52778f[_0x0af8('0x11')]));});});};
\ No newline at end of file