trafficmonitor init...2

This commit is contained in:
최준흠 2025-11-19 11:34:53 +09:00
parent c2abd37cf6
commit e86582941d
8 changed files with 6 additions and 68 deletions

View File

@ -10,5 +10,4 @@ abstract class AuthDTO extends CommonDTO
{
parent::__construct();
}
abstract public function toArray();
}

View File

@ -15,11 +15,4 @@ class GoogleDTO extends AuthDTO
}
}
}
public function toArray(): array
{
return [
'access_code' => $this->access_code,
];
}
}

View File

@ -16,12 +16,4 @@ class LocalDTO extends AuthDTO
}
}
}
public function toArray(): array
{
return [
'id' => $this->id,
'passwd' => $this->passwd,
];
}
}

View File

@ -20,16 +20,4 @@ class CollectorDTO extends CommonDTO
}
}
}
public function toArray(): array
{
return [
'uid' => $this->uid,
'trafficinfo_uid' => $this->trafficinfo_uid,
'in' => $this->in,
'out' => $this->out,
'raw_in' => $this->raw_in,
'raw_out' => $this->raw_out,
];
}
}

View File

@ -18,4 +18,10 @@ abstract class CommonDTO
"Undefined property or method: " . static::class . "::{$name}"
);
}
final public function toArray(): array
{
// $this가 가진 모든 public 프로퍼티와 그 값을 배열로 반환합니다.
return get_object_vars($this);
}
}

View File

@ -19,15 +19,4 @@ class MylogDTO extends CommonDTO
}
}
}
public function toArray(): array
{
return [
'uid' => $this->uid,
'user_uid' => $this->user_uid,
'title' => $this->title,
'content' => $this->content,
'status' => $this->status,
];
}
}

View File

@ -22,18 +22,4 @@ class TrafficDTO extends CommonDTO
}
}
}
public function toArray(): array
{
return [
'uid' => $this->uid,
'client' => $this->client,
'server' => $this->server,
'server_ip' => $this->server_ip,
'switch' => $this->switch,
'ip' => $this->ip,
'interface' => $this->interface,
'status' => $this->status,
];
}
}

View File

@ -36,19 +36,4 @@ class UserDTO extends CommonDTO
}
return parent::__get($name);
}
public function toArray(): array
{
return [
'uid' => $this->uid,
'id' => $this->id,
'passwd' => $this->passwd,
'confirmpassword' => $this->confirmpassword,
'name' => $this->name,
'email' => $this->email,
'mobile' => $this->mobile,
'role' => $this->role,
'status' => $this->status,
];
}
}