Built motion from commit 5b5850835.|1.0.25
[motion.git] / server / api / telephone / telephone.controller.js
index d054977..0b7fee4 100644 (file)
@@ -1 +1 @@
-var _0xcbcf=["\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"];_0xcbcf[0];var _=require(_0xcbcf[1]);var Util=require(_0xcbcf[2]);var amiUtil=require(_0xcbcf[3]);var userTools=require(_0xcbcf[4]);var logger=require(_0xcbcf[6])(_0xcbcf[5]);var sequelize=require(_0xcbcf[8])[_0xcbcf[7]];var Telephone=require(_0xcbcf[8])[_0xcbcf[9]];var Setting=require(_0xcbcf[8])[_0xcbcf[10]];var BPromise=require(_0xcbcf[11]);function handleError(_0xbd05xb,_0xbd05xc){_0xbd05xc= _0xbd05xc|| 500;return function(_0xbd05xd){logger[_0xcbcf[13]](_0xbd05xd[_0xcbcf[12]]);_0xbd05xb[_0xcbcf[15]](_0xbd05xc)[_0xcbcf[14]](_0xbd05xd)}}function responseWithResult(_0xbd05xb,_0xbd05xc){_0xbd05xc= _0xbd05xc|| 200;return function(_0xbd05xf){if(_0xbd05xf){_0xbd05xb[_0xcbcf[15]](_0xbd05xc)[_0xcbcf[16]](_0xbd05xf)}}}function handleEntityNotFound(_0xbd05xb){return function(_0xbd05xf){if(!_0xbd05xf){_0xbd05xb[_0xcbcf[15]](404)[_0xcbcf[17]]();return null};return _0xbd05xf}}function saveUpdates(_0xbd05x12,_0xbd05x13){return function(_0xbd05xf){return _0xbd05xf[_0xcbcf[19]](_0xbd05x12,{transaction:_0xbd05x13})[_0xcbcf[18]](function(_0xbd05x14){return _0xbd05x14})}}function removeEntity(_0xbd05xb){return function(_0xbd05xf){if(_0xbd05xf){return _0xbd05xf[_0xcbcf[20]]()[_0xcbcf[18]](function(){_0xbd05xb[_0xcbcf[15]](204)[_0xcbcf[17]]()})}}}exports[_0xcbcf[21]]= function(_0xbd05x16,_0xbd05xb){return Telephone[_0xcbcf[27]](_0xcbcf[26])[_0xcbcf[25]](Util[_0xcbcf[24]](_0xbd05x16[_0xcbcf[23]]))[_0xcbcf[18]](function(_0xbd05x17){_0xbd05xb[_0xcbcf[15]](200)[_0xcbcf[14]](_0xbd05x17)})[_0xcbcf[22]](function(_0xbd05xd){return handleError(_0xbd05xb,_0xbd05xd)})};exports[_0xcbcf[28]]= function(_0xbd05x16,_0xbd05xb){Telephone[_0xcbcf[31]](_0xbd05x16[_0xcbcf[30]][_0xcbcf[29]])[_0xcbcf[18]](handleEntityNotFound(_0xbd05xb))[_0xcbcf[18]](responseWithResult(_0xbd05xb))[_0xcbcf[22]](handleError(_0xbd05xb))};exports[_0xcbcf[32]]= function(_0xbd05x16,_0xbd05xb){_0xbd05x16[_0xcbcf[34]][_0xcbcf[33]]= _0xcbcf[26];return sequelize[_0xcbcf[42]](function(_0xbd05x13){return Setting[_0xcbcf[31]](1)[_0xcbcf[18]](function(_0xbd05x18){var _0xbd05x19=String(_0xbd05x16[_0xcbcf[34]][_0xcbcf[38]]);var _0xbd05x1a=_0xbd05x18[_0xcbcf[39]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0xbd05x1a[_0xcbcf[40]](_0xbd05x19)){throw  new Error(_0xcbcf[41])};return Telephone[_0xcbcf[32]](_0xbd05x16[_0xcbcf[34]],{transaction:_0xbd05x13})})[_0xcbcf[18]](userTools[_0xcbcf[37]]({transaction:_0xbd05x13}))[_0xcbcf[18]](responseWithResult(_0xbd05xb,201))})[_0xcbcf[22]](sequelize.UniqueConstraintError,function(_0xbd05xd){return Util[_0xcbcf[36]][_0xcbcf[35]](_0xbd05xb,_0xbd05xd)})[_0xcbcf[22]](handleError(_0xbd05xb))};exports[_0xcbcf[43]]= function(_0xbd05x16,_0xbd05xb){if(_0xbd05x16[_0xcbcf[34]][_0xcbcf[29]]){delete _0xbd05x16[_0xcbcf[34]][_0xcbcf[29]]};delete _0xbd05x16[_0xcbcf[34]][_0xcbcf[44]];delete _0xbd05x16[_0xcbcf[34]][_0xcbcf[38]];delete _0xbd05x16[_0xcbcf[34]][_0xcbcf[45]];return sequelize[_0xcbcf[42]](function(_0xbd05x13){return Telephone[_0xcbcf[31]](_0xbd05x16[_0xcbcf[30]][_0xcbcf[29]])[_0xcbcf[18]](handleEntityNotFound(_0xbd05xb))[_0xcbcf[18]](saveUpdates(_0xbd05x16[_0xcbcf[34]],_0xbd05x13))[_0xcbcf[18]](responseWithResult(_0xbd05xb))})[_0xcbcf[22]](sequelize.UniqueConstraintError,function(_0xbd05xd){return Util[_0xcbcf[36]][_0xcbcf[35]](_0xbd05xb,_0xbd05xd)})[_0xcbcf[22]](handleError(_0xbd05xb))};exports[_0xcbcf[20]]= function(_0xbd05x16,_0xbd05xb){return Telephone[_0xcbcf[31]](_0xbd05x16[_0xcbcf[30]][_0xcbcf[29]])[_0xcbcf[18]](handleEntityNotFound(_0xbd05xb))[_0xcbcf[18]](removeEntity(_0xbd05xb))[_0xcbcf[22]](handleError(_0xbd05xb))};exports[_0xcbcf[46]]= function(_0xbd05x16,_0xbd05xb){return Telephone[_0xcbcf[20]]({where:{id:_0xbd05x16[_0xcbcf[23]][_0xcbcf[48]]},individualHooks:true})[_0xcbcf[18]](function(){return _0xbd05xb[_0xcbcf[47]](204)})[_0xcbcf[22]](function(_0xbd05xd){return handleError(_0xbd05xb,_0xbd05xd)})}
\ No newline at end of file
+var _0x1b4e=["\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"];_0x1b4e[0];var _=require(_0x1b4e[1]);var Util=require(_0x1b4e[2]);var amiUtil=require(_0x1b4e[3]);var userTools=require(_0x1b4e[4]);var logger=require(_0x1b4e[6])(_0x1b4e[5]);var sequelize=require(_0x1b4e[8])[_0x1b4e[7]];var Telephone=require(_0x1b4e[8])[_0x1b4e[9]];var Setting=require(_0x1b4e[8])[_0x1b4e[10]];var BPromise=require(_0x1b4e[11]);function handleError(_0xf920xb,_0xf920xc){_0xf920xc= _0xf920xc|| 500;return function(_0xf920xd){logger[_0x1b4e[13]](_0xf920xd[_0x1b4e[12]]);_0xf920xb[_0x1b4e[15]](_0xf920xc)[_0x1b4e[14]](_0xf920xd)}}function responseWithResult(_0xf920xb,_0xf920xc){_0xf920xc= _0xf920xc|| 200;return function(_0xf920xf){if(_0xf920xf){_0xf920xb[_0x1b4e[15]](_0xf920xc)[_0x1b4e[16]](_0xf920xf)}}}function handleEntityNotFound(_0xf920xb){return function(_0xf920xf){if(!_0xf920xf){_0xf920xb[_0x1b4e[15]](404)[_0x1b4e[17]]();return null};return _0xf920xf}}function saveUpdates(_0xf920x12,_0xf920x13){return function(_0xf920xf){return _0xf920xf[_0x1b4e[19]](_0xf920x12,{transaction:_0xf920x13})[_0x1b4e[18]](function(_0xf920x14){return _0xf920x14})}}function removeEntity(_0xf920xb){return function(_0xf920xf){if(_0xf920xf){return _0xf920xf[_0x1b4e[20]]()[_0x1b4e[18]](function(){_0xf920xb[_0x1b4e[15]](204)[_0x1b4e[17]]()})}}}exports[_0x1b4e[21]]= function(_0xf920x16,_0xf920xb){return Telephone[_0x1b4e[27]](_0x1b4e[26])[_0x1b4e[25]](Util[_0x1b4e[24]](_0xf920x16[_0x1b4e[23]]))[_0x1b4e[18]](function(_0xf920x17){_0xf920xb[_0x1b4e[15]](200)[_0x1b4e[14]](_0xf920x17)})[_0x1b4e[22]](function(_0xf920xd){return handleError(_0xf920xb,_0xf920xd)})};exports[_0x1b4e[28]]= function(_0xf920x16,_0xf920xb){Telephone[_0x1b4e[31]](_0xf920x16[_0x1b4e[30]][_0x1b4e[29]])[_0x1b4e[18]](handleEntityNotFound(_0xf920xb))[_0x1b4e[18]](responseWithResult(_0xf920xb))[_0x1b4e[22]](handleError(_0xf920xb))};exports[_0x1b4e[32]]= function(_0xf920x16,_0xf920xb){_0xf920x16[_0x1b4e[34]][_0x1b4e[33]]= _0x1b4e[26];return sequelize[_0x1b4e[42]](function(_0xf920x13){return Setting[_0x1b4e[31]](1)[_0x1b4e[18]](function(_0xf920x18){var _0xf920x19=String(_0xf920x16[_0x1b4e[34]][_0x1b4e[38]]);var _0xf920x1a=_0xf920x18[_0x1b4e[39]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0xf920x1a[_0x1b4e[40]](_0xf920x19)){throw  new Error(_0x1b4e[41])};return Telephone[_0x1b4e[32]](_0xf920x16[_0x1b4e[34]],{transaction:_0xf920x13})})[_0x1b4e[18]](userTools[_0x1b4e[37]]({transaction:_0xf920x13}))[_0x1b4e[18]](responseWithResult(_0xf920xb,201))})[_0x1b4e[22]](sequelize.UniqueConstraintError,function(_0xf920xd){return Util[_0x1b4e[36]][_0x1b4e[35]](_0xf920xb,_0xf920xd)})[_0x1b4e[22]](handleError(_0xf920xb))};exports[_0x1b4e[43]]= function(_0xf920x16,_0xf920xb){if(_0xf920x16[_0x1b4e[34]][_0x1b4e[29]]){delete _0xf920x16[_0x1b4e[34]][_0x1b4e[29]]};delete _0xf920x16[_0x1b4e[34]][_0x1b4e[44]];delete _0xf920x16[_0x1b4e[34]][_0x1b4e[38]];delete _0xf920x16[_0x1b4e[34]][_0x1b4e[45]];return sequelize[_0x1b4e[42]](function(_0xf920x13){return Telephone[_0x1b4e[31]](_0xf920x16[_0x1b4e[30]][_0x1b4e[29]])[_0x1b4e[18]](handleEntityNotFound(_0xf920xb))[_0x1b4e[18]](saveUpdates(_0xf920x16[_0x1b4e[34]],_0xf920x13))[_0x1b4e[18]](responseWithResult(_0xf920xb))})[_0x1b4e[22]](sequelize.UniqueConstraintError,function(_0xf920xd){return Util[_0x1b4e[36]][_0x1b4e[35]](_0xf920xb,_0xf920xd)})[_0x1b4e[22]](handleError(_0xf920xb))};exports[_0x1b4e[20]]= function(_0xf920x16,_0xf920xb){return Telephone[_0x1b4e[31]](_0xf920x16[_0x1b4e[30]][_0x1b4e[29]])[_0x1b4e[18]](handleEntityNotFound(_0xf920xb))[_0x1b4e[18]](removeEntity(_0xf920xb))[_0x1b4e[22]](handleError(_0xf920xb))};exports[_0x1b4e[46]]= function(_0xf920x16,_0xf920xb){return Telephone[_0x1b4e[20]]({where:{id:_0xf920x16[_0x1b4e[23]][_0x1b4e[48]]},individualHooks:true})[_0x1b4e[18]](function(){return _0xf920xb[_0x1b4e[47]](204)})[_0x1b4e[22]](function(_0xf920xd){return handleError(_0xf920xb,_0xf920xd)})}
\ No newline at end of file