Implement creator studio and upload updates
This commit is contained in:
15
app/Contracts/Images/SubjectDetectorInterface.php
Normal file
15
app/Contracts/Images/SubjectDetectorInterface.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Contracts\Images;
|
||||
|
||||
use App\Data\Images\SubjectDetectionResultData;
|
||||
|
||||
interface SubjectDetectorInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
*/
|
||||
public function detect(string $sourcePath, int $sourceWidth, int $sourceHeight, array $context = []): ?SubjectDetectionResultData;
|
||||
}
|
||||
24
app/Contracts/Moderation/ModerationRuleInterface.php
Normal file
24
app/Contracts/Moderation/ModerationRuleInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts\Moderation;
|
||||
|
||||
interface ModerationRuleInterface
|
||||
{
|
||||
/**
|
||||
* Analyze the given content and return an array of findings.
|
||||
*
|
||||
* Each finding is an associative array with:
|
||||
* - 'rule' => string (rule identifier)
|
||||
* - 'score' => int (score contribution)
|
||||
* - 'reason' => string (human-readable reason)
|
||||
* - 'links' => array (matched URLs, if any)
|
||||
* - 'domains' => array (matched domains, if any)
|
||||
* - 'keywords' => array (matched keywords, if any)
|
||||
*
|
||||
* @param string $content The raw text content to analyze
|
||||
* @param string $normalized Lowercase/trimmed version for matching
|
||||
* @param array $context Optional metadata (user_id, artwork_id, content_type, etc.)
|
||||
* @return array<int, array>
|
||||
*/
|
||||
public function analyze(string $content, string $normalized, array $context = []): array;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts\Moderation;
|
||||
|
||||
use App\Data\Moderation\ModerationResultData;
|
||||
use App\Data\Moderation\ModerationSuggestionData;
|
||||
|
||||
interface ModerationSuggestionProviderInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
*/
|
||||
public function suggest(string $content, ModerationResultData $result, array $context = []): ModerationSuggestionData;
|
||||
}
|
||||
Reference in New Issue
Block a user