Built motion from commit 16cc8f1.|1.0.14
[motion.git] / server / api / telephone / telephone.controller.js
index 0f80cd2..24765d5 100644 (file)
@@ -1 +1 @@
-var _0x5e07=["\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","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64\x73"];_0x5e07[0];var _=require(_0x5e07[1]);var Util=require(_0x5e07[2]);var amiUtil=require(_0x5e07[3]);var userTools=require(_0x5e07[4]);var sequelize=require(_0x5e07[6])[_0x5e07[5]];var Telephone=require(_0x5e07[6])[_0x5e07[7]];var Setting=require(_0x5e07[6])[_0x5e07[8]];var BPromise=require(_0x5e07[9]);function handleError(_0x78bcxa,_0x78bcxb){_0x78bcxb= _0x78bcxb|| 500;return function(_0x78bcxc){_0x78bcxa[_0x5e07[11]](_0x78bcxb)[_0x5e07[10]](_0x78bcxc)}}function responseWithResult(_0x78bcxa,_0x78bcxb){_0x78bcxb= _0x78bcxb|| 200;return function(_0x78bcxe){if(_0x78bcxe){_0x78bcxa[_0x5e07[11]](_0x78bcxb)[_0x5e07[12]](_0x78bcxe)}}}function handleEntityNotFound(_0x78bcxa){return function(_0x78bcxe){if(!_0x78bcxe){_0x78bcxa[_0x5e07[11]](404)[_0x5e07[13]]();return null};return _0x78bcxe}}function saveUpdates(_0x78bcx11,_0x78bcx12){return function(_0x78bcxe){return _0x78bcxe[_0x5e07[15]](_0x78bcx11,{transaction:_0x78bcx12})[_0x5e07[14]](function(_0x78bcx13){return _0x78bcx13})}}function removeEntity(_0x78bcxa){return function(_0x78bcxe){if(_0x78bcxe){return _0x78bcxe[_0x5e07[16]]()[_0x5e07[14]](function(){_0x78bcxa[_0x5e07[11]](204)[_0x5e07[13]]()})}}}exports[_0x5e07[17]]= function(_0x78bcx15,_0x78bcxa){return Telephone[_0x5e07[23]](_0x5e07[22])[_0x5e07[21]](Util[_0x5e07[20]](_0x78bcx15[_0x5e07[19]]))[_0x5e07[14]](function(_0x78bcx16){_0x78bcxa[_0x5e07[11]](200)[_0x5e07[10]](_0x78bcx16)})[_0x5e07[18]](function(_0x78bcxc){return handleError(_0x78bcxa,_0x78bcxc)})};exports[_0x5e07[24]]= function(_0x78bcx15,_0x78bcxa){Telephone[_0x5e07[27]](_0x78bcx15[_0x5e07[26]][_0x5e07[25]])[_0x5e07[14]](handleEntityNotFound(_0x78bcxa))[_0x5e07[14]](responseWithResult(_0x78bcxa))[_0x5e07[18]](handleError(_0x78bcxa))};exports[_0x5e07[28]]= function(_0x78bcx15,_0x78bcxa){_0x78bcx15[_0x5e07[30]][_0x5e07[29]]= _0x5e07[22];return sequelize[_0x5e07[38]](function(_0x78bcx12){return Setting[_0x5e07[27]](1)[_0x5e07[14]](function(_0x78bcx17){var _0x78bcx18=String(_0x78bcx15[_0x5e07[30]][_0x5e07[34]]);var _0x78bcx19=_0x78bcx17[_0x5e07[35]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x78bcx19[_0x5e07[36]](_0x78bcx18)){throw  new Error(_0x5e07[37])};return Telephone[_0x5e07[28]](_0x78bcx15[_0x5e07[30]],{transaction:_0x78bcx12})})[_0x5e07[14]](userTools[_0x5e07[33]]({transaction:_0x78bcx12}))[_0x5e07[14]](responseWithResult(_0x78bcxa,201))})[_0x5e07[18]](sequelize.UniqueConstraintError,function(_0x78bcxc){return Util[_0x5e07[32]][_0x5e07[31]](_0x78bcxa,_0x78bcxc)})[_0x5e07[18]](handleError(_0x78bcxa))};exports[_0x5e07[39]]= function(_0x78bcx15,_0x78bcxa){if(_0x78bcx15[_0x5e07[30]][_0x5e07[25]]){delete _0x78bcx15[_0x5e07[30]][_0x5e07[25]]};delete _0x78bcx15[_0x5e07[30]][_0x5e07[40]];delete _0x78bcx15[_0x5e07[30]][_0x5e07[34]];delete _0x78bcx15[_0x5e07[30]][_0x5e07[41]];return sequelize[_0x5e07[38]](function(_0x78bcx12){return Telephone[_0x5e07[27]](_0x78bcx15[_0x5e07[26]][_0x5e07[25]])[_0x5e07[14]](handleEntityNotFound(_0x78bcxa))[_0x5e07[14]](saveUpdates(_0x78bcx15[_0x5e07[30]],_0x78bcx12))[_0x5e07[14]](responseWithResult(_0x78bcxa))})[_0x5e07[18]](sequelize.UniqueConstraintError,function(_0x78bcxc){return Util[_0x5e07[32]][_0x5e07[31]](_0x78bcxa,_0x78bcxc)})[_0x5e07[18]](handleError(_0x78bcxa))};exports[_0x5e07[16]]= function(_0x78bcx15,_0x78bcxa){return Telephone[_0x5e07[27]](_0x78bcx15[_0x5e07[26]][_0x5e07[25]])[_0x5e07[14]](handleEntityNotFound(_0x78bcxa))[_0x5e07[14]](removeEntity(_0x78bcxa))[_0x5e07[18]](handleError(_0x78bcxa))};exports[_0x5e07[42]]= function(_0x78bcx15,_0x78bcxa){return Telephone[_0x5e07[16]]({where:{id:_0x78bcx15[_0x5e07[19]][_0x5e07[44]]},individualHooks:true})[_0x5e07[14]](function(){return _0x78bcxa[_0x5e07[43]](204)})[_0x5e07[18]](function(_0x78bcxc){return handleError(_0x78bcxa,_0x78bcxc)})}
\ No newline at end of file
+var _0x2ed0=["\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","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64\x73"];_0x2ed0[0];var _=require(_0x2ed0[1]);var Util=require(_0x2ed0[2]);var amiUtil=require(_0x2ed0[3]);var userTools=require(_0x2ed0[4]);var sequelize=require(_0x2ed0[6])[_0x2ed0[5]];var Telephone=require(_0x2ed0[6])[_0x2ed0[7]];var Setting=require(_0x2ed0[6])[_0x2ed0[8]];var BPromise=require(_0x2ed0[9]);function handleError(_0x4220xa,_0x4220xb){_0x4220xb= _0x4220xb|| 500;return function(_0x4220xc){_0x4220xa[_0x2ed0[11]](_0x4220xb)[_0x2ed0[10]](_0x4220xc)}}function responseWithResult(_0x4220xa,_0x4220xb){_0x4220xb= _0x4220xb|| 200;return function(_0x4220xe){if(_0x4220xe){_0x4220xa[_0x2ed0[11]](_0x4220xb)[_0x2ed0[12]](_0x4220xe)}}}function handleEntityNotFound(_0x4220xa){return function(_0x4220xe){if(!_0x4220xe){_0x4220xa[_0x2ed0[11]](404)[_0x2ed0[13]]();return null};return _0x4220xe}}function saveUpdates(_0x4220x11,_0x4220x12){return function(_0x4220xe){return _0x4220xe[_0x2ed0[15]](_0x4220x11,{transaction:_0x4220x12})[_0x2ed0[14]](function(_0x4220x13){return _0x4220x13})}}function removeEntity(_0x4220xa){return function(_0x4220xe){if(_0x4220xe){return _0x4220xe[_0x2ed0[16]]()[_0x2ed0[14]](function(){_0x4220xa[_0x2ed0[11]](204)[_0x2ed0[13]]()})}}}exports[_0x2ed0[17]]= function(_0x4220x15,_0x4220xa){return Telephone[_0x2ed0[23]](_0x2ed0[22])[_0x2ed0[21]](Util[_0x2ed0[20]](_0x4220x15[_0x2ed0[19]]))[_0x2ed0[14]](function(_0x4220x16){_0x4220xa[_0x2ed0[11]](200)[_0x2ed0[10]](_0x4220x16)})[_0x2ed0[18]](function(_0x4220xc){return handleError(_0x4220xa,_0x4220xc)})};exports[_0x2ed0[24]]= function(_0x4220x15,_0x4220xa){Telephone[_0x2ed0[27]](_0x4220x15[_0x2ed0[26]][_0x2ed0[25]])[_0x2ed0[14]](handleEntityNotFound(_0x4220xa))[_0x2ed0[14]](responseWithResult(_0x4220xa))[_0x2ed0[18]](handleError(_0x4220xa))};exports[_0x2ed0[28]]= function(_0x4220x15,_0x4220xa){_0x4220x15[_0x2ed0[30]][_0x2ed0[29]]= _0x2ed0[22];return sequelize[_0x2ed0[38]](function(_0x4220x12){return Setting[_0x2ed0[27]](1)[_0x2ed0[14]](function(_0x4220x17){var _0x4220x18=String(_0x4220x15[_0x2ed0[30]][_0x2ed0[34]]);var _0x4220x19=_0x4220x17[_0x2ed0[35]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x4220x19[_0x2ed0[36]](_0x4220x18)){throw  new Error(_0x2ed0[37])};return Telephone[_0x2ed0[28]](_0x4220x15[_0x2ed0[30]],{transaction:_0x4220x12})})[_0x2ed0[14]](userTools[_0x2ed0[33]]({transaction:_0x4220x12}))[_0x2ed0[14]](responseWithResult(_0x4220xa,201))})[_0x2ed0[18]](sequelize.UniqueConstraintError,function(_0x4220xc){return Util[_0x2ed0[32]][_0x2ed0[31]](_0x4220xa,_0x4220xc)})[_0x2ed0[18]](handleError(_0x4220xa))};exports[_0x2ed0[39]]= function(_0x4220x15,_0x4220xa){if(_0x4220x15[_0x2ed0[30]][_0x2ed0[25]]){delete _0x4220x15[_0x2ed0[30]][_0x2ed0[25]]};delete _0x4220x15[_0x2ed0[30]][_0x2ed0[40]];delete _0x4220x15[_0x2ed0[30]][_0x2ed0[34]];delete _0x4220x15[_0x2ed0[30]][_0x2ed0[41]];return sequelize[_0x2ed0[38]](function(_0x4220x12){return Telephone[_0x2ed0[27]](_0x4220x15[_0x2ed0[26]][_0x2ed0[25]])[_0x2ed0[14]](handleEntityNotFound(_0x4220xa))[_0x2ed0[14]](saveUpdates(_0x4220x15[_0x2ed0[30]],_0x4220x12))[_0x2ed0[14]](responseWithResult(_0x4220xa))})[_0x2ed0[18]](sequelize.UniqueConstraintError,function(_0x4220xc){return Util[_0x2ed0[32]][_0x2ed0[31]](_0x4220xa,_0x4220xc)})[_0x2ed0[18]](handleError(_0x4220xa))};exports[_0x2ed0[16]]= function(_0x4220x15,_0x4220xa){return Telephone[_0x2ed0[27]](_0x4220x15[_0x2ed0[26]][_0x2ed0[25]])[_0x2ed0[14]](handleEntityNotFound(_0x4220xa))[_0x2ed0[14]](removeEntity(_0x4220xa))[_0x2ed0[18]](handleError(_0x4220xa))};exports[_0x2ed0[42]]= function(_0x4220x15,_0x4220xa){return Telephone[_0x2ed0[16]]({where:{id:_0x4220x15[_0x2ed0[19]][_0x2ed0[44]]},individualHooks:true})[_0x2ed0[14]](function(){return _0x4220xa[_0x2ed0[43]](204)})[_0x2ed0[18]](function(_0x4220xc){return handleError(_0x4220xa,_0x4220xc)})}
\ No newline at end of file