Built motion from commit 4d2cf597c.|1.0.26
[motion.git] / server / api / telephone / telephone.controller.js
index b37af5e..e538409 100644 (file)
@@ -1 +1 @@
-var _0x2e89=["\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"];_0x2e89[0];var _=require(_0x2e89[1]);var Util=require(_0x2e89[2]);var amiUtil=require(_0x2e89[3]);var userTools=require(_0x2e89[4]);var logger=require(_0x2e89[6])(_0x2e89[5]);var sequelize=require(_0x2e89[8])[_0x2e89[7]];var Telephone=require(_0x2e89[8])[_0x2e89[9]];var Setting=require(_0x2e89[8])[_0x2e89[10]];var BPromise=require(_0x2e89[11]);function handleError(_0x777cxb,_0x777cxc){_0x777cxc= _0x777cxc|| 500;return function(_0x777cxd){logger[_0x2e89[13]](_0x777cxd[_0x2e89[12]]);_0x777cxb[_0x2e89[15]](_0x777cxc)[_0x2e89[14]](_0x777cxd)}}function responseWithResult(_0x777cxb,_0x777cxc){_0x777cxc= _0x777cxc|| 200;return function(_0x777cxf){if(_0x777cxf){_0x777cxb[_0x2e89[15]](_0x777cxc)[_0x2e89[16]](_0x777cxf)}}}function handleEntityNotFound(_0x777cxb){return function(_0x777cxf){if(!_0x777cxf){_0x777cxb[_0x2e89[15]](404)[_0x2e89[17]]();return null};return _0x777cxf}}function saveUpdates(_0x777cx12,_0x777cx13){return function(_0x777cxf){return _0x777cxf[_0x2e89[19]](_0x777cx12,{transaction:_0x777cx13})[_0x2e89[18]](function(_0x777cx14){return _0x777cx14})}}function removeEntity(_0x777cxb){return function(_0x777cxf){if(_0x777cxf){return _0x777cxf[_0x2e89[20]]()[_0x2e89[18]](function(){_0x777cxb[_0x2e89[15]](204)[_0x2e89[17]]()})}}}exports[_0x2e89[21]]= function(_0x777cx16,_0x777cxb){return Telephone[_0x2e89[27]](_0x2e89[26])[_0x2e89[25]](Util[_0x2e89[24]](_0x777cx16[_0x2e89[23]]))[_0x2e89[18]](function(_0x777cx17){_0x777cxb[_0x2e89[15]](200)[_0x2e89[14]](_0x777cx17)})[_0x2e89[22]](function(_0x777cxd){return handleError(_0x777cxb,_0x777cxd)})};exports[_0x2e89[28]]= function(_0x777cx16,_0x777cxb){Telephone[_0x2e89[31]](_0x777cx16[_0x2e89[30]][_0x2e89[29]])[_0x2e89[18]](handleEntityNotFound(_0x777cxb))[_0x2e89[18]](responseWithResult(_0x777cxb))[_0x2e89[22]](handleError(_0x777cxb))};exports[_0x2e89[32]]= function(_0x777cx16,_0x777cxb){_0x777cx16[_0x2e89[34]][_0x2e89[33]]= _0x2e89[26];return sequelize[_0x2e89[42]](function(_0x777cx13){return Setting[_0x2e89[31]](1)[_0x2e89[18]](function(_0x777cx18){var _0x777cx19=String(_0x777cx16[_0x2e89[34]][_0x2e89[38]]);var _0x777cx1a=_0x777cx18[_0x2e89[39]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x777cx1a[_0x2e89[40]](_0x777cx19)){throw  new Error(_0x2e89[41])};return Telephone[_0x2e89[32]](_0x777cx16[_0x2e89[34]],{transaction:_0x777cx13})})[_0x2e89[18]](userTools[_0x2e89[37]]({transaction:_0x777cx13}))[_0x2e89[18]](responseWithResult(_0x777cxb,201))})[_0x2e89[22]](sequelize.UniqueConstraintError,function(_0x777cxd){return Util[_0x2e89[36]][_0x2e89[35]](_0x777cxb,_0x777cxd)})[_0x2e89[22]](handleError(_0x777cxb))};exports[_0x2e89[43]]= function(_0x777cx16,_0x777cxb){if(_0x777cx16[_0x2e89[34]][_0x2e89[29]]){delete _0x777cx16[_0x2e89[34]][_0x2e89[29]]};delete _0x777cx16[_0x2e89[34]][_0x2e89[44]];delete _0x777cx16[_0x2e89[34]][_0x2e89[38]];delete _0x777cx16[_0x2e89[34]][_0x2e89[45]];return sequelize[_0x2e89[42]](function(_0x777cx13){return Telephone[_0x2e89[31]](_0x777cx16[_0x2e89[30]][_0x2e89[29]])[_0x2e89[18]](handleEntityNotFound(_0x777cxb))[_0x2e89[18]](saveUpdates(_0x777cx16[_0x2e89[34]],_0x777cx13))[_0x2e89[18]](responseWithResult(_0x777cxb))})[_0x2e89[22]](sequelize.UniqueConstraintError,function(_0x777cxd){return Util[_0x2e89[36]][_0x2e89[35]](_0x777cxb,_0x777cxd)})[_0x2e89[22]](handleError(_0x777cxb))};exports[_0x2e89[20]]= function(_0x777cx16,_0x777cxb){return Telephone[_0x2e89[31]](_0x777cx16[_0x2e89[30]][_0x2e89[29]])[_0x2e89[18]](handleEntityNotFound(_0x777cxb))[_0x2e89[18]](removeEntity(_0x777cxb))[_0x2e89[22]](handleError(_0x777cxb))};exports[_0x2e89[46]]= function(_0x777cx16,_0x777cxb){return Telephone[_0x2e89[20]]({where:{id:_0x777cx16[_0x2e89[23]][_0x2e89[48]]},individualHooks:true})[_0x2e89[18]](function(){return _0x777cxb[_0x2e89[47]](204)})[_0x2e89[22]](function(_0x777cxd){return handleError(_0x777cxb,_0x777cxd)})}
\ No newline at end of file
+var _0x72ee=["\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"];_0x72ee[0];var _=require(_0x72ee[1]);var Util=require(_0x72ee[2]);var amiUtil=require(_0x72ee[3]);var userTools=require(_0x72ee[4]);var logger=require(_0x72ee[6])(_0x72ee[5]);var sequelize=require(_0x72ee[8])[_0x72ee[7]];var Telephone=require(_0x72ee[8])[_0x72ee[9]];var Setting=require(_0x72ee[8])[_0x72ee[10]];var BPromise=require(_0x72ee[11]);function handleError(_0xa759xb,_0xa759xc){_0xa759xc= _0xa759xc|| 500;return function(_0xa759xd){logger[_0x72ee[13]](_0xa759xd[_0x72ee[12]]);_0xa759xb[_0x72ee[15]](_0xa759xc)[_0x72ee[14]](_0xa759xd)}}function responseWithResult(_0xa759xb,_0xa759xc){_0xa759xc= _0xa759xc|| 200;return function(_0xa759xf){if(_0xa759xf){_0xa759xb[_0x72ee[15]](_0xa759xc)[_0x72ee[16]](_0xa759xf)}}}function handleEntityNotFound(_0xa759xb){return function(_0xa759xf){if(!_0xa759xf){_0xa759xb[_0x72ee[15]](404)[_0x72ee[17]]();return null};return _0xa759xf}}function saveUpdates(_0xa759x12,_0xa759x13){return function(_0xa759xf){return _0xa759xf[_0x72ee[19]](_0xa759x12,{transaction:_0xa759x13})[_0x72ee[18]](function(_0xa759x14){return _0xa759x14})}}function removeEntity(_0xa759xb){return function(_0xa759xf){if(_0xa759xf){return _0xa759xf[_0x72ee[20]]()[_0x72ee[18]](function(){_0xa759xb[_0x72ee[15]](204)[_0x72ee[17]]()})}}}exports[_0x72ee[21]]= function(_0xa759x16,_0xa759xb){return Telephone[_0x72ee[27]](_0x72ee[26])[_0x72ee[25]](Util[_0x72ee[24]](_0xa759x16[_0x72ee[23]]))[_0x72ee[18]](function(_0xa759x17){_0xa759xb[_0x72ee[15]](200)[_0x72ee[14]](_0xa759x17)})[_0x72ee[22]](function(_0xa759xd){return handleError(_0xa759xb,_0xa759xd)})};exports[_0x72ee[28]]= function(_0xa759x16,_0xa759xb){Telephone[_0x72ee[31]](_0xa759x16[_0x72ee[30]][_0x72ee[29]])[_0x72ee[18]](handleEntityNotFound(_0xa759xb))[_0x72ee[18]](responseWithResult(_0xa759xb))[_0x72ee[22]](handleError(_0xa759xb))};exports[_0x72ee[32]]= function(_0xa759x16,_0xa759xb){_0xa759x16[_0x72ee[34]][_0x72ee[33]]= _0x72ee[26];return sequelize[_0x72ee[42]](function(_0xa759x13){return Setting[_0x72ee[31]](1)[_0x72ee[18]](function(_0xa759x18){var _0xa759x19=String(_0xa759x16[_0x72ee[34]][_0x72ee[38]]);var _0xa759x1a=_0xa759x18[_0x72ee[39]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0xa759x1a[_0x72ee[40]](_0xa759x19)){throw  new Error(_0x72ee[41])};return Telephone[_0x72ee[32]](_0xa759x16[_0x72ee[34]],{transaction:_0xa759x13})})[_0x72ee[18]](userTools[_0x72ee[37]]({transaction:_0xa759x13}))[_0x72ee[18]](responseWithResult(_0xa759xb,201))})[_0x72ee[22]](sequelize.UniqueConstraintError,function(_0xa759xd){return Util[_0x72ee[36]][_0x72ee[35]](_0xa759xb,_0xa759xd)})[_0x72ee[22]](handleError(_0xa759xb))};exports[_0x72ee[43]]= function(_0xa759x16,_0xa759xb){if(_0xa759x16[_0x72ee[34]][_0x72ee[29]]){delete _0xa759x16[_0x72ee[34]][_0x72ee[29]]};delete _0xa759x16[_0x72ee[34]][_0x72ee[44]];delete _0xa759x16[_0x72ee[34]][_0x72ee[38]];delete _0xa759x16[_0x72ee[34]][_0x72ee[45]];return sequelize[_0x72ee[42]](function(_0xa759x13){return Telephone[_0x72ee[31]](_0xa759x16[_0x72ee[30]][_0x72ee[29]])[_0x72ee[18]](handleEntityNotFound(_0xa759xb))[_0x72ee[18]](saveUpdates(_0xa759x16[_0x72ee[34]],_0xa759x13))[_0x72ee[18]](responseWithResult(_0xa759xb))})[_0x72ee[22]](sequelize.UniqueConstraintError,function(_0xa759xd){return Util[_0x72ee[36]][_0x72ee[35]](_0xa759xb,_0xa759xd)})[_0x72ee[22]](handleError(_0xa759xb))};exports[_0x72ee[20]]= function(_0xa759x16,_0xa759xb){return Telephone[_0x72ee[31]](_0xa759x16[_0x72ee[30]][_0x72ee[29]])[_0x72ee[18]](handleEntityNotFound(_0xa759xb))[_0x72ee[18]](removeEntity(_0xa759xb))[_0x72ee[22]](handleError(_0xa759xb))};exports[_0x72ee[46]]= function(_0xa759x16,_0xa759xb){return Telephone[_0x72ee[20]]({where:{id:_0xa759x16[_0x72ee[23]][_0x72ee[48]]},individualHooks:true})[_0x72ee[18]](function(){return _0xa759xb[_0x72ee[47]](204)})[_0x72ee[22]](function(_0xa759xd){return handleError(_0xa759xb,_0xa759xd)})}
\ No newline at end of file