Skip to content

Commit

Permalink
Revert "レコメンド機能の作成(フェーズ3)"
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoya0819 authored Aug 29, 2024
1 parent 71ea8a0 commit ad63356
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 442 deletions.
4 changes: 0 additions & 4 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,3 @@ AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME="${APP_NAME}"

PRTIMES_API_TOKEN=""

OPENAI_API_TOKEN=""
37 changes: 0 additions & 37 deletions backend/_ide_helper_models.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
* @property string $keyword
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\PressRelease> $pressReleases
* @property-read int|null $press_releases_count
* @method static \Illuminate\Database\Eloquent\Builder|Keyword newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Keyword newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Keyword query()
Expand All @@ -39,23 +37,15 @@ class Keyword extends \Eloquent {}
* @property int $id
* @property string $company_id
* @property string $release_id
* @property string $title
* @property string $summary
* @property string $release_created_at
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Keyword> $keywords
* @property-read int|null $keywords_count
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease query()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereCompanyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereReleaseCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereReleaseId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereSummary($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereUpdatedAt($value)
*/
class PressRelease extends \Eloquent {}
Expand All @@ -76,8 +66,6 @@ class PressRelease extends \Eloquent {}
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
* @property-read int|null $notifications_count
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ViewHistory> $view_histories
* @property-read int|null $view_histories_count
* @method static \Database\Factories\UserFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User newQuery()
Expand All @@ -95,28 +83,3 @@ class PressRelease extends \Eloquent {}
class User extends \Eloquent {}
}

namespace App\Models{
/**
*
*
* @property int $id
* @property int $score
* @property int $user_id
* @property int $keyword_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\Keyword $keyword
* @property-read \App\Models\User $user
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory query()
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory whereKeywordId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory whereScore($value)
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ViewHistory whereUserId($value)
*/
class ViewHistory extends \Eloquent {}
}

59 changes: 0 additions & 59 deletions backend/app/Http/Controllers/Api/PressRelease/ViewController.php

This file was deleted.

123 changes: 0 additions & 123 deletions backend/app/Jobs/PressReleaseAnalyze.php

This file was deleted.

2 changes: 1 addition & 1 deletion backend/app/Libs/Bedrock.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Bedrock

public function __construct(
private readonly string $model_id = "anthropic.claude-3-haiku-20240307-v1:0",
private readonly string $anthropic_version = "bedrock-2023-05-31",
private readonly string $anthropic_version = "anthropic.claude-3-haiku-20240307-v1:0",
private readonly int $max_token = 1000,
array $client_configs = [
"region" => "us-east-1",
Expand Down
6 changes: 3 additions & 3 deletions backend/app/Models/Keyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ class Keyword extends Model
use HasFactory;

protected $fillable = [
"keyword"
"keyword",
"weight"
];

/**
* @return BelongsToMany
*/
public function pressReleases(): BelongsToMany
{
return $this->belongsToMany(PressRelease::class)
->withPivot("weight");
return $this->belongsToMany(PressRelease::class);
}
}
3 changes: 1 addition & 2 deletions backend/app/Models/PressRelease.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class PressRelease extends Model
*/
public function keywords(): BelongsToMany
{
return $this->belongsToMany(Keyword::class)
->withPivot("weight");
return $this->belongsToMany(Keyword::class);
}
}
10 changes: 1 addition & 9 deletions backend/app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Models;

// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

Expand All @@ -24,12 +24,4 @@ class User extends Authenticatable
'age',
'prefecture'
];

/**
* @return HasMany
*/
public function view_histories(): HasMany
{
return $this->hasMany(ViewHistory::class);
}
}
33 changes: 0 additions & 33 deletions backend/app/Models/ViewHistory.php

This file was deleted.

11 changes: 4 additions & 7 deletions backend/app/UseCases/Keyword/CreateOrFirstAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@

class CreateOrFirstAction
{
/**
* @param string $keyword
* @return Keyword
*/
public static function run(
string $keyword
string $keyword,
int $weight
): Keyword {
// @todo barryvdh/laravel-ide-helperにより強制的に型付け
/* @var Keyword */
return Keyword::createOrFirst(
["keyword" => $keyword],
["keyword" => $keyword]
compact("keyword", "weight"),
compact("keyword", "weight")
);
}
}
Loading

0 comments on commit ad63356

Please sign in to comment.