dbmsv3 init...1
This commit is contained in:
parent
8ebabb14b4
commit
3b6557d55c
@ -197,7 +197,12 @@ class ServerService extends EquipmentService implements ServiceInterface
|
||||
}
|
||||
public function create(array $formDatas): ServerEntity
|
||||
{
|
||||
$entity = parent::create($formDatas);
|
||||
//서버정보 생성
|
||||
try {
|
||||
$entity = parent::create($formDatas);
|
||||
} catch (\CodeIgniter\Database\Exceptions\DatabaseException $e) {
|
||||
throw new \Exception(__METHOD__ . "오류발생: IP중복일 가능성이 있습니다.");
|
||||
}
|
||||
//서버의 Type별 서버파트정보등록(서버파트연결 자동등록용)
|
||||
$entity = $this->getServerPartService()->setServer('create', $entity, []);
|
||||
if ($entity->getIP() !== null) { //IP가 정의되어 있으면
|
||||
@ -211,7 +216,11 @@ class ServerService extends EquipmentService implements ServiceInterface
|
||||
//수정전 정보
|
||||
$oldEntity = clone $entity; //반드시 clone 할것
|
||||
//서버정보 수정
|
||||
$entity = parent::modify($entity, $formDatas);
|
||||
try {
|
||||
$entity = parent::modify($entity, $formDatas);
|
||||
} catch (\CodeIgniter\Database\Exceptions\DatabaseException $e) {
|
||||
throw new \Exception(__METHOD__ . "오류발생: IP중복일 가능성이 있습니다.");
|
||||
}
|
||||
//서비스가 연결되어 있고 대체서버가 아니면, 서비스정보수정(청구액수정)
|
||||
if ($entity->getServiceInfoUID() !== null && $entity->getType() !== "alternative") {
|
||||
$this->getServiceService()->setAmount($this->getServiceService()->getEntity($entity->getServiceInfoUID()));
|
||||
|
||||
@ -155,7 +155,7 @@ class IPService extends PartService implements ServerInterface
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("{$action}은 정의되지 않은 작업입니다.");
|
||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: 정의되지 않은 작업입니다.");
|
||||
// break;
|
||||
}
|
||||
return $serverEntity;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user