dataLists(new SvAccountLists()); } /** * @desc 平台 */ public function add() { try { $params = (new SvAccountValidate())->post()->goCheck('add'); $result = SvAccountLogic::addSvAccount($params); if ($result) { return $this->success(data: SvAccountLogic::getReturnData()); } return $this->fail(SvAccountLogic::getError()); } catch (HttpResponseException $e) { return $this->fail($e->getResponse()->getData()['msg'] ?? ''); } } /** * @desc 平台 */ public function update() { try { $params = (new SvAccountValidate())->post()->goCheck('update'); $result = SvAccountLogic::updateSvAccount($params); if ($result) { return $this->success(data: SvAccountLogic::getReturnData()); } return $this->fail(SvAccountLogic::getError()); } catch (HttpResponseException $e) { return $this->fail($e->getResponse()->getData()['msg'] ?? ''); } } /** * @desc 平台 */ public function ai() { try { $params = (new SvAccountValidate())->post()->goCheck('ai'); $result = SvAccountLogic::updateSvAccountAi($params); if ($result) { return $this->success(data: SvAccountLogic::getReturnData()); } return $this->fail(SvAccountLogic::getError()); } catch (HttpResponseException $e) { return $this->fail($e->getResponse()->getData()['msg'] ?? ''); } } /** * @desc 下线 */ public function offline() { try { $params = (new SvAccountValidate())->post()->goCheck('offline'); $result = SvAccountLogic::offlineSvAccount($params); if ($result) { return $this->success(data: SvAccountLogic::getReturnData()); } return $this->fail(SvAccountLogic::getError()); } catch (HttpResponseException $e) { return $this->fail($e->getResponse()->getData()['msg'] ?? ''); } } /** * @desc 获取详情 */ public function detail() { try { $params = (new SvAccountValidate())->get()->goCheck('detail'); $result = SvAccountLogic::detailSvAccount($params); if ($result) { return $this->data(SvAccountLogic::getReturnData()); } return $this->fail(SvAccountLogic::getError()); } catch (HttpResponseException $e) { return $this->fail($e->getResponse()->getData()['msg'] ?? ''); } } /** * @desc 删除 */ public function delete() { try { $params = (new SvAccountValidate())->post()->goCheck('delete'); $result = SvAccountLogic::deleteSvAccount($params); if ($result) { return $this->success(); } return $this->fail(SvAccountLogic::getError()); } catch (HttpResponseException $e) { return $this->fail($e->getResponse()->getData()['msg'] ?? ''); } } }