Built motion from commit 3c79b9529.|1.0.22
[motion.git] / server / api / telephone / telephone.controller.js
index 8daa8a9..5afd8ee 100644 (file)
@@ -1 +1 @@
-var _0x7402=["\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","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\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"];_0x7402[0];var _=require(_0x7402[1]);var Util=require(_0x7402[2]);var amiUtil=require(_0x7402[3]);var userTools=require(_0x7402[4]);var logger=require(_0x7402[6])(_0x7402[5]);var sequelize=require(_0x7402[8])[_0x7402[7]];var Telephone=require(_0x7402[8])[_0x7402[9]];var Setting=require(_0x7402[8])[_0x7402[10]];var BPromise=require(_0x7402[11]);function handleError(_0x85ffxb,_0x85ffxc){_0x85ffxc= _0x85ffxc|| 500;return function(_0x85ffxd){logger[_0x7402[13]](_0x85ffxd[_0x7402[12]]);_0x85ffxb[_0x7402[15]](_0x85ffxc)[_0x7402[14]](_0x85ffxd)}}function responseWithResult(_0x85ffxb,_0x85ffxc){_0x85ffxc= _0x85ffxc|| 200;return function(_0x85ffxf){if(_0x85ffxf){_0x85ffxb[_0x7402[15]](_0x85ffxc)[_0x7402[16]](_0x85ffxf)}}}function handleEntityNotFound(_0x85ffxb){return function(_0x85ffxf){if(!_0x85ffxf){_0x85ffxb[_0x7402[15]](404)[_0x7402[17]]();return null};return _0x85ffxf}}function saveUpdates(_0x85ffx12,_0x85ffx13){return function(_0x85ffxf){return _0x85ffxf[_0x7402[19]](_0x85ffx12,{transaction:_0x85ffx13})[_0x7402[18]](function(_0x85ffx14){return _0x85ffx14})}}function removeEntity(_0x85ffxb){return function(_0x85ffxf){if(_0x85ffxf){return _0x85ffxf[_0x7402[20]]()[_0x7402[18]](function(){_0x85ffxb[_0x7402[15]](204)[_0x7402[17]]()})}}}exports[_0x7402[21]]= function(_0x85ffx16,_0x85ffxb){return Telephone[_0x7402[27]](_0x7402[26])[_0x7402[25]](Util[_0x7402[24]](_0x85ffx16[_0x7402[23]]))[_0x7402[18]](function(_0x85ffx17){_0x85ffxb[_0x7402[15]](200)[_0x7402[14]](_0x85ffx17)})[_0x7402[22]](function(_0x85ffxd){return handleError(_0x85ffxb,_0x85ffxd)})};exports[_0x7402[28]]= function(_0x85ffx16,_0x85ffxb){Telephone[_0x7402[31]](_0x85ffx16[_0x7402[30]][_0x7402[29]])[_0x7402[18]](handleEntityNotFound(_0x85ffxb))[_0x7402[18]](responseWithResult(_0x85ffxb))[_0x7402[22]](handleError(_0x85ffxb))};exports[_0x7402[32]]= function(_0x85ffx16,_0x85ffxb){_0x85ffx16[_0x7402[34]][_0x7402[33]]= _0x7402[26];return sequelize[_0x7402[42]](function(_0x85ffx13){return Setting[_0x7402[31]](1)[_0x7402[18]](function(_0x85ffx18){var _0x85ffx19=String(_0x85ffx16[_0x7402[34]][_0x7402[38]]);var _0x85ffx1a=_0x85ffx18[_0x7402[39]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x85ffx1a[_0x7402[40]](_0x85ffx19)){throw  new Error(_0x7402[41])};return Telephone[_0x7402[32]](_0x85ffx16[_0x7402[34]],{transaction:_0x85ffx13})})[_0x7402[18]](userTools[_0x7402[37]]({transaction:_0x85ffx13}))[_0x7402[18]](responseWithResult(_0x85ffxb,201))})[_0x7402[22]](sequelize.UniqueConstraintError,function(_0x85ffxd){return Util[_0x7402[36]][_0x7402[35]](_0x85ffxb,_0x85ffxd)})[_0x7402[22]](handleError(_0x85ffxb))};exports[_0x7402[43]]= function(_0x85ffx16,_0x85ffxb){if(_0x85ffx16[_0x7402[34]][_0x7402[29]]){delete _0x85ffx16[_0x7402[34]][_0x7402[29]]};delete _0x85ffx16[_0x7402[34]][_0x7402[44]];delete _0x85ffx16[_0x7402[34]][_0x7402[38]];delete _0x85ffx16[_0x7402[34]][_0x7402[45]];return sequelize[_0x7402[42]](function(_0x85ffx13){return Telephone[_0x7402[31]](_0x85ffx16[_0x7402[30]][_0x7402[29]])[_0x7402[18]](handleEntityNotFound(_0x85ffxb))[_0x7402[18]](saveUpdates(_0x85ffx16[_0x7402[34]],_0x85ffx13))[_0x7402[18]](responseWithResult(_0x85ffxb))})[_0x7402[22]](sequelize.UniqueConstraintError,function(_0x85ffxd){return Util[_0x7402[36]][_0x7402[35]](_0x85ffxb,_0x85ffxd)})[_0x7402[22]](handleError(_0x85ffxb))};exports[_0x7402[20]]= function(_0x85ffx16,_0x85ffxb){return Telephone[_0x7402[31]](_0x85ffx16[_0x7402[30]][_0x7402[29]])[_0x7402[18]](handleEntityNotFound(_0x85ffxb))[_0x7402[18]](removeEntity(_0x85ffxb))[_0x7402[22]](handleError(_0x85ffxb))};exports[_0x7402[46]]= function(_0x85ffx16,_0x85ffxb){return Telephone[_0x7402[20]]({where:{id:_0x85ffx16[_0x7402[23]][_0x7402[48]]},individualHooks:true})[_0x7402[18]](function(){return _0x85ffxb[_0x7402[47]](204)})[_0x7402[22]](function(_0x85ffxd){return handleError(_0x85ffxb,_0x85ffxd)})}
\ No newline at end of file
+var _0xf5a6=["\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","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\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"];_0xf5a6[0];var _=require(_0xf5a6[1]);var Util=require(_0xf5a6[2]);var amiUtil=require(_0xf5a6[3]);var userTools=require(_0xf5a6[4]);var logger=require(_0xf5a6[6])(_0xf5a6[5]);var sequelize=require(_0xf5a6[8])[_0xf5a6[7]];var Telephone=require(_0xf5a6[8])[_0xf5a6[9]];var Setting=require(_0xf5a6[8])[_0xf5a6[10]];var BPromise=require(_0xf5a6[11]);function handleError(_0xcad6xb,_0xcad6xc){_0xcad6xc= _0xcad6xc|| 500;return function(_0xcad6xd){logger[_0xf5a6[13]](_0xcad6xd[_0xf5a6[12]]);_0xcad6xb[_0xf5a6[15]](_0xcad6xc)[_0xf5a6[14]](_0xcad6xd)}}function responseWithResult(_0xcad6xb,_0xcad6xc){_0xcad6xc= _0xcad6xc|| 200;return function(_0xcad6xf){if(_0xcad6xf){_0xcad6xb[_0xf5a6[15]](_0xcad6xc)[_0xf5a6[16]](_0xcad6xf)}}}function handleEntityNotFound(_0xcad6xb){return function(_0xcad6xf){if(!_0xcad6xf){_0xcad6xb[_0xf5a6[15]](404)[_0xf5a6[17]]();return null};return _0xcad6xf}}function saveUpdates(_0xcad6x12,_0xcad6x13){return function(_0xcad6xf){return _0xcad6xf[_0xf5a6[19]](_0xcad6x12,{transaction:_0xcad6x13})[_0xf5a6[18]](function(_0xcad6x14){return _0xcad6x14})}}function removeEntity(_0xcad6xb){return function(_0xcad6xf){if(_0xcad6xf){return _0xcad6xf[_0xf5a6[20]]()[_0xf5a6[18]](function(){_0xcad6xb[_0xf5a6[15]](204)[_0xf5a6[17]]()})}}}exports[_0xf5a6[21]]= function(_0xcad6x16,_0xcad6xb){return Telephone[_0xf5a6[27]](_0xf5a6[26])[_0xf5a6[25]](Util[_0xf5a6[24]](_0xcad6x16[_0xf5a6[23]]))[_0xf5a6[18]](function(_0xcad6x17){_0xcad6xb[_0xf5a6[15]](200)[_0xf5a6[14]](_0xcad6x17)})[_0xf5a6[22]](function(_0xcad6xd){return handleError(_0xcad6xb,_0xcad6xd)})};exports[_0xf5a6[28]]= function(_0xcad6x16,_0xcad6xb){Telephone[_0xf5a6[31]](_0xcad6x16[_0xf5a6[30]][_0xf5a6[29]])[_0xf5a6[18]](handleEntityNotFound(_0xcad6xb))[_0xf5a6[18]](responseWithResult(_0xcad6xb))[_0xf5a6[22]](handleError(_0xcad6xb))};exports[_0xf5a6[32]]= function(_0xcad6x16,_0xcad6xb){_0xcad6x16[_0xf5a6[34]][_0xf5a6[33]]= _0xf5a6[26];return sequelize[_0xf5a6[42]](function(_0xcad6x13){return Setting[_0xf5a6[31]](1)[_0xf5a6[18]](function(_0xcad6x18){var _0xcad6x19=String(_0xcad6x16[_0xf5a6[34]][_0xf5a6[38]]);var _0xcad6x1a=_0xcad6x18[_0xf5a6[39]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0xcad6x1a[_0xf5a6[40]](_0xcad6x19)){throw  new Error(_0xf5a6[41])};return Telephone[_0xf5a6[32]](_0xcad6x16[_0xf5a6[34]],{transaction:_0xcad6x13})})[_0xf5a6[18]](userTools[_0xf5a6[37]]({transaction:_0xcad6x13}))[_0xf5a6[18]](responseWithResult(_0xcad6xb,201))})[_0xf5a6[22]](sequelize.UniqueConstraintError,function(_0xcad6xd){return Util[_0xf5a6[36]][_0xf5a6[35]](_0xcad6xb,_0xcad6xd)})[_0xf5a6[22]](handleError(_0xcad6xb))};exports[_0xf5a6[43]]= function(_0xcad6x16,_0xcad6xb){if(_0xcad6x16[_0xf5a6[34]][_0xf5a6[29]]){delete _0xcad6x16[_0xf5a6[34]][_0xf5a6[29]]};delete _0xcad6x16[_0xf5a6[34]][_0xf5a6[44]];delete _0xcad6x16[_0xf5a6[34]][_0xf5a6[38]];delete _0xcad6x16[_0xf5a6[34]][_0xf5a6[45]];return sequelize[_0xf5a6[42]](function(_0xcad6x13){return Telephone[_0xf5a6[31]](_0xcad6x16[_0xf5a6[30]][_0xf5a6[29]])[_0xf5a6[18]](handleEntityNotFound(_0xcad6xb))[_0xf5a6[18]](saveUpdates(_0xcad6x16[_0xf5a6[34]],_0xcad6x13))[_0xf5a6[18]](responseWithResult(_0xcad6xb))})[_0xf5a6[22]](sequelize.UniqueConstraintError,function(_0xcad6xd){return Util[_0xf5a6[36]][_0xf5a6[35]](_0xcad6xb,_0xcad6xd)})[_0xf5a6[22]](handleError(_0xcad6xb))};exports[_0xf5a6[20]]= function(_0xcad6x16,_0xcad6xb){return Telephone[_0xf5a6[31]](_0xcad6x16[_0xf5a6[30]][_0xf5a6[29]])[_0xf5a6[18]](handleEntityNotFound(_0xcad6xb))[_0xf5a6[18]](removeEntity(_0xcad6xb))[_0xf5a6[22]](handleError(_0xcad6xb))};exports[_0xf5a6[46]]= function(_0xcad6x16,_0xcad6xb){return Telephone[_0xf5a6[20]]({where:{id:_0xcad6x16[_0xf5a6[23]][_0xf5a6[48]]},individualHooks:true})[_0xf5a6[18]](function(){return _0xcad6xb[_0xf5a6[47]](204)})[_0xf5a6[22]](function(_0xcad6xd){return handleError(_0xcad6xb,_0xcad6xd)})}
\ No newline at end of file