servermgrv2 init...

This commit is contained in:
최준흠 2023-07-19 17:06:48 +09:00
parent 21cf0eca16
commit e901dfdeb7
5 changed files with 4 additions and 50 deletions

View File

@ -4,10 +4,8 @@ namespace App\Entities;
use CodeIgniter\Entity\Entity; use CodeIgniter\Entity\Entity;
class CommonEntity extends Entity abstract class CommonEntity extends Entity
{ {
public function getTitle() abstract public function getPrimaryKey();
{ abstract public function getTitle();
return "CommonEntity";
}
} }

View File

@ -14,22 +14,6 @@ class HPILOEntity extends CommonEntity
{ {
return $this->attributes['uid']; return $this->attributes['uid'];
} }
public function getID()
{
return $this->attributes['id'];
}
public function getPassword()
{
return $this->attributes['passwd'];
}
public function getIP()
{
return $this->attributes['ip'];
}
public function getPort()
{
return $this->attributes['port'];
}
public function getTitle() public function getTitle()
{ {
return "{$this->attributes['customer']} {$this->attributes['model']}"; return "{$this->attributes['customer']} {$this->attributes['model']}";

View File

@ -18,20 +18,8 @@ class UserEntity extends CommonEntity
{ {
return $this->attributes['name']; return $this->attributes['name'];
} }
public function getEmail()
{
return $this->attributes['email'];
}
public function getRole()
{
return $this->attributes['role'];
}
public function getPassword() public function getPassword()
{ {
return $this->attributes['passwd']; return $this->attributes['passwd'];
} }
public function getEncryptedPassword(string $password)
{
return password_hash($password, PASSWORD_DEFAULT);
}
} }

View File

@ -14,24 +14,8 @@ class UserSNSEntity extends CommonEntity
{ {
return $this->attributes['uid']; return $this->attributes['uid'];
} }
public function getUserUID()
{
return $this->attributes['user_uid'];
}
public function getSite()
{
return $this->attributes['site'];
}
public function getTitle() public function getTitle()
{ {
return $this->attributes['name']; return $this->attributes['name'];
} }
public function getEmail()
{
return $this->attributes['email'];
}
public function getStatus()
{
return $this->attributes['status'];
}
} }

View File

@ -105,7 +105,7 @@ class GoogleAdapter extends Adapter
if (is_null($snsEntity)) { if (is_null($snsEntity)) {
$snsEntity = $this->getUserSNSModel()->create($this->getSiteName(), $result); $snsEntity = $this->getUserSNSModel()->create($this->getSiteName(), $result);
} }
if (!$snsEntity->getUserUID()) { if (!$snsEntity->user_id) {
throw new \Exception($this->getSiteName() . "{$result['email']}:{$result['name']}님은 아직 사용자 지정이 되지 않았습니다."); throw new \Exception($this->getSiteName() . "{$result['email']}:{$result['name']}님은 아직 사용자 지정이 되지 않았습니다.");
} }
if ($snsEntity->getStatus() !== DEFAULTS['STATUS']) { if ($snsEntity->getStatus() !== DEFAULTS['STATUS']) {