Built motion from commit 27e0a5d.|1.0.8
[motion.git] / server / api / telephone / telephone.controller.js
index 374fb68..33b5dd7 100644 (file)
@@ -1 +1 @@
-var _0x8cda=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x61\x6D\x69\x2F\x75\x74\x69\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x74\x6F\x6F\x6C\x73\x2F\x75\x73\x65\x72","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x53\x65\x74\x74\x69\x6E\x67","\x62\x6C\x75\x65\x62\x69\x72\x64","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x73\x63\x6F\x70\x65","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x72\x6F\x6C\x65","\x62\x6F\x64\x79","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x73\x65\x63\x75\x72\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x74\x65\x73\x74","\x57\x72\x6F\x6E\x67\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x6D\x61\x74\x21","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6E\x61\x6D\x65","\x70\x72\x75\x6E\x65","\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x73","\x61\x70\x70","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64\x73"];_0x8cda[0];var _=require(_0x8cda[1]);var Util=require(_0x8cda[2]);var amiUtil=require(_0x8cda[3]);var userTools=require(_0x8cda[4]);var sequelize=require(_0x8cda[6])[_0x8cda[5]];var Telephone=require(_0x8cda[6])[_0x8cda[7]];var Setting=require(_0x8cda[6])[_0x8cda[8]];var BPromise=require(_0x8cda[9]);function handleError(_0x9296xa,_0x9296xb){_0x9296xb= _0x9296xb|| 500;return function(_0x9296xc){_0x9296xa[_0x8cda[11]](_0x9296xb)[_0x8cda[10]](_0x9296xc)}}function responseWithResult(_0x9296xa,_0x9296xb){_0x9296xb= _0x9296xb|| 200;return function(_0x9296xe){if(_0x9296xe){_0x9296xa[_0x8cda[11]](_0x9296xb)[_0x8cda[12]](_0x9296xe)}}}function handleEntityNotFound(_0x9296xa){return function(_0x9296xe){if(!_0x9296xe){_0x9296xa[_0x8cda[11]](404)[_0x8cda[13]]();return null};return _0x9296xe}}function saveUpdates(_0x9296x11,_0x9296x12){return function(_0x9296xe){return _0x9296xe[_0x8cda[15]](_0x9296x11,{transaction:_0x9296x12})[_0x8cda[14]](function(_0x9296x13){return _0x9296x13})}}function removeEntity(_0x9296xa){return function(_0x9296xe){if(_0x9296xe){return _0x9296xe[_0x8cda[16]]()[_0x8cda[14]](function(){_0x9296xa[_0x8cda[11]](204)[_0x8cda[13]]()})}}}exports[_0x8cda[17]]= function(_0x9296x15,_0x9296xa){return Telephone[_0x8cda[23]](_0x8cda[22])[_0x8cda[21]](Util[_0x8cda[20]](_0x9296x15[_0x8cda[19]]))[_0x8cda[14]](function(_0x9296x16){_0x9296xa[_0x8cda[11]](200)[_0x8cda[10]](_0x9296x16)})[_0x8cda[18]](function(_0x9296xc){return handleError(_0x9296xa,_0x9296xc)})};exports[_0x8cda[24]]= function(_0x9296x15,_0x9296xa){Telephone[_0x8cda[27]](_0x9296x15[_0x8cda[26]][_0x8cda[25]])[_0x8cda[14]](handleEntityNotFound(_0x9296xa))[_0x8cda[14]](responseWithResult(_0x9296xa))[_0x8cda[18]](handleError(_0x9296xa))};exports[_0x8cda[28]]= function(_0x9296x15,_0x9296xa){_0x9296x15[_0x8cda[30]][_0x8cda[29]]= _0x8cda[22];return sequelize[_0x8cda[38]](function(_0x9296x12){return Setting[_0x8cda[27]](1)[_0x8cda[14]](function(_0x9296x17){var _0x9296x18=String(_0x9296x15[_0x8cda[30]][_0x8cda[34]]);var _0x9296x19=_0x9296x17[_0x8cda[35]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^[a-zA-Z0-9]{6,}$/;if(!_0x9296x19[_0x8cda[36]](_0x9296x18)){throw  new Error(_0x8cda[37])};return Telephone[_0x8cda[28]](_0x9296x15[_0x8cda[30]],{transaction:_0x9296x12})})[_0x8cda[14]](userTools[_0x8cda[33]]({transaction:_0x9296x12}))[_0x8cda[14]](responseWithResult(_0x9296xa,201))})[_0x8cda[18]](sequelize.UniqueConstraintError,function(_0x9296xc){return Util[_0x8cda[32]][_0x8cda[31]](_0x9296xa,_0x9296xc)})[_0x8cda[18]](handleError(_0x9296xa))};exports[_0x8cda[39]]= function(_0x9296x15,_0x9296xa){if(_0x9296x15[_0x8cda[30]][_0x8cda[25]]){delete _0x9296x15[_0x8cda[30]][_0x8cda[25]]};delete _0x9296x15[_0x8cda[30]][_0x8cda[40]];if(_0x9296x15[_0x8cda[30]][_0x8cda[34]]){var _0x9296x18=String(_0x9296x15[_0x8cda[30]][_0x8cda[34]]);if(!(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/[_0x8cda[36]](_0x9296x18))){throw  new Error(_0x8cda[37])}};delete _0x9296x15[_0x8cda[30]][_0x8cda[41]];var _0x9296x1a;return sequelize[_0x8cda[38]](function(_0x9296x12){return Telephone[_0x8cda[27]](_0x9296x15[_0x8cda[26]][_0x8cda[25]])[_0x8cda[14]](handleEntityNotFound(_0x9296xa))[_0x8cda[14]](saveUpdates(_0x9296x15[_0x8cda[30]],_0x9296x12))[_0x8cda[14]](function(_0x9296x1c){_0x9296x1a= _0x9296x1c;return _0x9296x1c})[_0x8cda[14]](userTools[_0x8cda[46]]({transaction:_0x9296x12}))[_0x8cda[14]](function(_0x9296x1b){_0x9296x15[_0x8cda[45]][_0x8cda[44]][_0x8cda[43]][_0x8cda[10]]({message:_0x8cda[42],doc:_0x9296x1b});return _0x9296x1a})[_0x8cda[14]](responseWithResult(_0x9296xa))})[_0x8cda[18]](sequelize.UniqueConstraintError,function(_0x9296xc){return Util[_0x8cda[32]][_0x8cda[31]](_0x9296xa,_0x9296xc)})[_0x8cda[18]](handleError(_0x9296xa))};exports[_0x8cda[16]]= function(_0x9296x15,_0x9296xa){return Telephone[_0x8cda[27]](_0x9296x15[_0x8cda[26]][_0x8cda[25]])[_0x8cda[14]](handleEntityNotFound(_0x9296xa))[_0x8cda[14]](removeEntity(_0x9296xa))[_0x8cda[18]](handleError(_0x9296xa))};exports[_0x8cda[47]]= function(_0x9296x15,_0x9296xa){return Telephone[_0x8cda[16]]({where:{id:_0x9296x15[_0x8cda[19]][_0x8cda[49]]},individualHooks:true})[_0x8cda[14]](function(){return _0x9296xa[_0x8cda[48]](204)})[_0x8cda[18]](function(_0x9296xc){return handleError(_0x9296xa,_0x9296xc)})}
\ No newline at end of file
+var _0x5177=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x61\x6D\x69\x2F\x75\x74\x69\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x74\x6F\x6F\x6C\x73\x2F\x75\x73\x65\x72","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x53\x65\x74\x74\x69\x6E\x67","\x62\x6C\x75\x65\x62\x69\x72\x64","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x73\x63\x6F\x70\x65","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x72\x6F\x6C\x65","\x62\x6F\x64\x79","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x73\x65\x63\x75\x72\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x74\x65\x73\x74","\x57\x72\x6F\x6E\x67\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x6D\x61\x74\x21","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6E\x61\x6D\x65","\x70\x72\x75\x6E\x65","\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x73","\x61\x70\x70","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64\x73"];_0x5177[0];var _=require(_0x5177[1]);var Util=require(_0x5177[2]);var amiUtil=require(_0x5177[3]);var userTools=require(_0x5177[4]);var sequelize=require(_0x5177[6])[_0x5177[5]];var Telephone=require(_0x5177[6])[_0x5177[7]];var Setting=require(_0x5177[6])[_0x5177[8]];var BPromise=require(_0x5177[9]);function handleError(_0x15c7xa,_0x15c7xb){_0x15c7xb= _0x15c7xb|| 500;return function(_0x15c7xc){_0x15c7xa[_0x5177[11]](_0x15c7xb)[_0x5177[10]](_0x15c7xc)}}function responseWithResult(_0x15c7xa,_0x15c7xb){_0x15c7xb= _0x15c7xb|| 200;return function(_0x15c7xe){if(_0x15c7xe){_0x15c7xa[_0x5177[11]](_0x15c7xb)[_0x5177[12]](_0x15c7xe)}}}function handleEntityNotFound(_0x15c7xa){return function(_0x15c7xe){if(!_0x15c7xe){_0x15c7xa[_0x5177[11]](404)[_0x5177[13]]();return null};return _0x15c7xe}}function saveUpdates(_0x15c7x11,_0x15c7x12){return function(_0x15c7xe){return _0x15c7xe[_0x5177[15]](_0x15c7x11,{transaction:_0x15c7x12})[_0x5177[14]](function(_0x15c7x13){return _0x15c7x13})}}function removeEntity(_0x15c7xa){return function(_0x15c7xe){if(_0x15c7xe){return _0x15c7xe[_0x5177[16]]()[_0x5177[14]](function(){_0x15c7xa[_0x5177[11]](204)[_0x5177[13]]()})}}}exports[_0x5177[17]]= function(_0x15c7x15,_0x15c7xa){return Telephone[_0x5177[23]](_0x5177[22])[_0x5177[21]](Util[_0x5177[20]](_0x15c7x15[_0x5177[19]]))[_0x5177[14]](function(_0x15c7x16){_0x15c7xa[_0x5177[11]](200)[_0x5177[10]](_0x15c7x16)})[_0x5177[18]](function(_0x15c7xc){return handleError(_0x15c7xa,_0x15c7xc)})};exports[_0x5177[24]]= function(_0x15c7x15,_0x15c7xa){Telephone[_0x5177[27]](_0x15c7x15[_0x5177[26]][_0x5177[25]])[_0x5177[14]](handleEntityNotFound(_0x15c7xa))[_0x5177[14]](responseWithResult(_0x15c7xa))[_0x5177[18]](handleError(_0x15c7xa))};exports[_0x5177[28]]= function(_0x15c7x15,_0x15c7xa){_0x15c7x15[_0x5177[30]][_0x5177[29]]= _0x5177[22];return sequelize[_0x5177[38]](function(_0x15c7x12){return Setting[_0x5177[27]](1)[_0x5177[14]](function(_0x15c7x17){var _0x15c7x18=String(_0x15c7x15[_0x5177[30]][_0x5177[34]]);var _0x15c7x19=_0x15c7x17[_0x5177[35]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^[a-zA-Z0-9]{6,}$/;if(!_0x15c7x19[_0x5177[36]](_0x15c7x18)){throw  new Error(_0x5177[37])};return Telephone[_0x5177[28]](_0x15c7x15[_0x5177[30]],{transaction:_0x15c7x12})})[_0x5177[14]](userTools[_0x5177[33]]({transaction:_0x15c7x12}))[_0x5177[14]](responseWithResult(_0x15c7xa,201))})[_0x5177[18]](sequelize.UniqueConstraintError,function(_0x15c7xc){return Util[_0x5177[32]][_0x5177[31]](_0x15c7xa,_0x15c7xc)})[_0x5177[18]](handleError(_0x15c7xa))};exports[_0x5177[39]]= function(_0x15c7x15,_0x15c7xa){if(_0x15c7x15[_0x5177[30]][_0x5177[25]]){delete _0x15c7x15[_0x5177[30]][_0x5177[25]]};delete _0x15c7x15[_0x5177[30]][_0x5177[40]];if(_0x15c7x15[_0x5177[30]][_0x5177[34]]){var _0x15c7x18=String(_0x15c7x15[_0x5177[30]][_0x5177[34]]);if(!(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/[_0x5177[36]](_0x15c7x18))){throw  new Error(_0x5177[37])}};delete _0x15c7x15[_0x5177[30]][_0x5177[41]];var _0x15c7x1a;return sequelize[_0x5177[38]](function(_0x15c7x12){return Telephone[_0x5177[27]](_0x15c7x15[_0x5177[26]][_0x5177[25]])[_0x5177[14]](handleEntityNotFound(_0x15c7xa))[_0x5177[14]](saveUpdates(_0x15c7x15[_0x5177[30]],_0x15c7x12))[_0x5177[14]](function(_0x15c7x1c){_0x15c7x1a= _0x15c7x1c;return _0x15c7x1c})[_0x5177[14]](userTools[_0x5177[46]]({transaction:_0x15c7x12}))[_0x5177[14]](function(_0x15c7x1b){_0x15c7x15[_0x5177[45]][_0x5177[44]][_0x5177[43]][_0x5177[10]]({message:_0x5177[42],doc:_0x15c7x1b});return _0x15c7x1a})[_0x5177[14]](responseWithResult(_0x15c7xa))})[_0x5177[18]](sequelize.UniqueConstraintError,function(_0x15c7xc){return Util[_0x5177[32]][_0x5177[31]](_0x15c7xa,_0x15c7xc)})[_0x5177[18]](handleError(_0x15c7xa))};exports[_0x5177[16]]= function(_0x15c7x15,_0x15c7xa){return Telephone[_0x5177[27]](_0x15c7x15[_0x5177[26]][_0x5177[25]])[_0x5177[14]](handleEntityNotFound(_0x15c7xa))[_0x5177[14]](removeEntity(_0x15c7xa))[_0x5177[18]](handleError(_0x15c7xa))};exports[_0x5177[47]]= function(_0x15c7x15,_0x15c7xa){return Telephone[_0x5177[16]]({where:{id:_0x15c7x15[_0x5177[19]][_0x5177[49]]},individualHooks:true})[_0x5177[14]](function(){return _0x15c7xa[_0x5177[48]](204)})[_0x5177[18]](function(_0x15c7xc){return handleError(_0x15c7xa,_0x15c7xc)})}
\ No newline at end of file