feat(service): đổi sản phẩm của dịch vụ, 2FA bắt buộc, đính kèm campaign mail, thu hồi IP

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-27 14:24:13 +07:00
co-authored by Claude Sonnet 5.5
parent 6315a392c0
commit a6b641015e
13 changed files with 197 additions and 9 deletions
@@ -6,6 +6,7 @@ use App\Models\Customer;
use App\Models\IpPool;
use App\Models\IpPoolLog;
use App\Services\IpPool\IpAllocationService;
use App\Services\IpPool\IpReleaseService;
use App\Support\MailAttachments;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -46,6 +47,18 @@ trait ManagesIpPoolAllocation
return response()->json(['error' => false, 'message' => "Đã thu hồi {$count} IP và gửi email thông báo"]);
}
public function release(Request $request, IpReleaseService $release): JsonResponse
{
$data = $request->validate([
'ids' => 'required|array|min:1|max:1000',
'ids.*' => 'integer',
'note' => 'nullable|string|max:2000',
]);
$count = $release->release($data['ids'], $data['note'] ?? null, $request->user('admin'));
return response()->json(['error' => false, 'message' => "Đã giải phóng {$count} IP khỏi dịch vụ/VM"]);
}
public function logs(int $id): JsonResponse
{
$pool = IpPool::withTrashed()->findOrFail($id);