Upload beautify
This commit is contained in:
42
app/Models/ArtworkSimilarity.php
Normal file
42
app/Models/ArtworkSimilarity.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
final class ArtworkSimilarity extends Model
|
||||
{
|
||||
protected $table = 'artwork_similarities';
|
||||
|
||||
protected $fillable = [
|
||||
'artwork_id',
|
||||
'similar_artwork_id',
|
||||
'model',
|
||||
'model_version',
|
||||
'algo_version',
|
||||
'rank',
|
||||
'score',
|
||||
'generated_at',
|
||||
'meta',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'rank' => 'integer',
|
||||
'score' => 'float',
|
||||
'generated_at' => 'datetime',
|
||||
'meta' => 'array',
|
||||
];
|
||||
|
||||
public function artwork(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class, 'artwork_id');
|
||||
}
|
||||
|
||||
public function similarArtwork(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class, 'similar_artwork_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user