FFXIV_Lodestone_Handler/app/Http/Controllers/LodestoneLinkController.php

73 lines
2.1 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Services\LodestoneApiService;
use App\Services\LodestoneCacheService;
use App\Services\LodestoneLinkingService;
class LodestoneLinkController extends Controller
{
private $lodestoneLinkingService;
private $lodestoneCacheService;
private $lodestoneApiService;
public function __construct(
LodestoneLinkingService $lodestoneLinkingService,
LodestoneCacheService $lodestoneCacheService,
LodestoneApiService $lodestoneApiService
)
{
$this->lodestoneLinkingService = $lodestoneLinkingService;
$this->lodestoneCacheService = $lodestoneCacheService;
$this->lodestoneApiService = $lodestoneApiService;
}
public function checkDiscordName(
string $server,
string $name,
int $discordUserId
) {
$lodestoneId = $this->lodestoneCacheService->getCharacterByName($server, $name, $this->lodestoneApiService)->lodestoneId;
return $this->lodestoneLinkingService->getLinkDiscord($lodestoneId, $discordUserId);
}
public function checkDiscordId(
int $lodestoneId,
int $discordUserId
) {
return $this->lodestoneLinkingService->getLinkDiscord($lodestoneId, $discordUserId);
}
public function checkWebsiteName(
string $server,
string $name,
string $hostname,
int $websiteUserId
) {
$lodestoneId = $this->lodestoneCacheService->getCharacterByName($server, $name, $this->lodestoneApiService)->lodestoneId;
return $this->lodestoneLinkingService->getLinkWebsite($lodestoneId, $hostname, $websiteUserId);
}
public function checkWebsiteId(
int $lodestoneId,
string $hostname,
int $websiteUserId
) {
return $this->lodestoneLinkingService->getLinkWebsite($lodestoneId, $hostname, $websiteUserId);
}
public function linkDiscord(
int $lodestoneId,
int $discordUserId
) {}
public function linkWebsite(
int $lodestoneId,
string $hostname,
int $websiteId
) {}
}