feat: khởi tạo/huỷ domain Plesk qua job, gửi mail hoá đơn qua queue, đính kèm triển khai
- ProvisionDnsDomainJob/SuspendDnsDomainJob: tạo domain admin lên Plesk, huỷ = suspend (is_created=3) - Khách xem zone DNS được gán ở /dich-vu/domain, quản lý bản ghi A/AAAA/CNAME/TXT/MX/SRV - send-mail hoá đơn đẩy SendInvoiceMailJob, preview + sửa nội dung, ghi mail.order_id - invoice_attachments.type (payment_proof/deployment) - CacheService xoá theo SCAN pattern, Redis không persistent mặc định - Backfill transactions.public_code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
30898ea46f
commit
94614d9cb3
@@ -3,6 +3,7 @@
|
||||
namespace App\Services\Plesk;
|
||||
|
||||
use App\Models\DnsServer;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
use Illuminate\Http\Client\RequestException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -83,6 +84,28 @@ class PleskDomainService
|
||||
return false;
|
||||
}
|
||||
|
||||
public function suspend(DnsServer $server, string $domain): bool
|
||||
{
|
||||
$this->lastError = null;
|
||||
|
||||
try {
|
||||
$response = $this->plesk->client($server, 30)
|
||||
->post($this->plesk->url($server, 'cli', '/subscription/call'), ['params' => ['--webspace-off', $domain]]);
|
||||
} catch (ConnectionException $e) {
|
||||
$this->lastError = $e->getMessage();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($response->successful() && (int) $response->json('code', 1) === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->lastError = trim((string) ($response->json('stderr') ?: $response->json('message') ?: $response->body()));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getDomainInfo(DnsServer $server, string $domain = ''): array|false
|
||||
{
|
||||
if (empty($domain)) {
|
||||
|
||||
Reference in New Issue
Block a user