[api] add notifications

This commit is contained in:
xiaomlove
2022-03-31 16:28:08 +08:00
parent 3e4a5766c4
commit f91cd6f20a
28 changed files with 274 additions and 44 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ class CommentController extends Controller
]; ];
$data = array_filter($data); $data = array_filter($data);
foreach ($allTypes as $type) { foreach ($allTypes as $type) {
if ($data['type'] == $type && empty($data[$type . "_id"])) { if ($data['type'] == $type && empty($data[$type])) {
throw new \InvalidArgumentException("require {$type}_id"); throw new \InvalidArgumentException("require {$type}_id");
} }
} }
@@ -51,6 +51,7 @@ class MessageController extends Controller
public function show($id) public function show($id)
{ {
$message = Message::query()->with(['send_user'])->findOrFail($id); $message = Message::query()->with(['send_user'])->findOrFail($id);
$message->update(['unread' => 'no']);
$resource = new MessageResource($message); $resource = new MessageResource($message);
$resource->additional([ $resource->additional([
'page_title' => nexus_trans('message.show.page_title'), 'page_title' => nexus_trans('message.show.page_title'),
+9 -2
View File
@@ -5,8 +5,11 @@ namespace App\Http\Controllers;
use App\Http\Resources\NewsResource; use App\Http\Resources\NewsResource;
use App\Models\News; use App\Models\News;
use App\Repositories\NewsRepository; use App\Repositories\NewsRepository;
use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Nexus\Database\NexusDB;
class NewsController extends Controller class NewsController extends Controller
{ {
@@ -95,17 +98,21 @@ class NewsController extends Controller
} }
/** /**
* @todo update the unread cache
*
* @return array * @return array
*/ */
public function latest() public function latest()
{ {
$user = Auth::user();
$result = News::query()->orderBy('id', 'desc')->first(); $result = News::query()->orderBy('id', 'desc')->first();
$resource = new NewsResource($result); $resource = new NewsResource($result);
$resource->additional([ $resource->additional([
'site_info' => site_info(), 'site_info' => site_info(),
]); ]);
/**
* Visiting the home page is the same as viewing the latest news
* @see functions.php line 2590
*/
$user->update(['last_home' => Carbon::now()]);
return $this->success($resource); return $this->success($resource);
} }
+1 -1
View File
@@ -53,7 +53,7 @@ class RewardController extends Controller
]); ]);
$result = $this->repository->store($request->torrent_id, $request->value, Auth::user()); $result = $this->repository->store($request->torrent_id, $request->value, Auth::user());
$resource = new RewardResource($result); $resource = new RewardResource($result);
return $this->success($resource); return $this->success($resource, '赠魔成功!');
} }
/** /**
+37 -3
View File
@@ -3,10 +3,13 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Resources\ThankResource; use App\Http\Resources\ThankResource;
use App\Models\Setting;
use App\Models\Thank; use App\Models\Thank;
use App\Models\Torrent; use App\Models\Torrent;
use App\Models\User;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
class ThankController extends Controller class ThankController extends Controller
{ {
@@ -39,17 +42,48 @@ class ThankController extends Controller
*/ */
public function store(Request $request) public function store(Request $request)
{ {
$user = Auth::user();
$request->validate(['torrent_id' => 'required']); $request->validate(['torrent_id' => 'required']);
$torrentId = $request->torrent_id; $torrentId = $request->torrent_id;
$torrent = Torrent::query()->findOrFail($torrentId, Torrent::$commentFields); $torrent = Torrent::query()->findOrFail($torrentId, Torrent::$commentFields);
$torrent->checkIsNormal(); $torrent->checkIsNormal();
$user = Auth::user(); $torrentOwner = User::query()->findOrFail($torrent->owner);
if ($user->id == $torrentOwner->id) {
throw new \LogicException("you can't thank to yourself");
}
$torrentOwner->checkIsNormal();
if ($user->thank_torrent_logs()->where('torrentid', $torrentId)->exists()) { if ($user->thank_torrent_logs()->where('torrentid', $torrentId)->exists()) {
throw new \LogicException("you already thank this torrent"); throw new \LogicException("you already thank this torrent");
} }
$result = $user->thank_torrent_logs()->create(['torrentid' => $torrentId]);
$result = DB::transaction(function () use ($user, $torrentOwner, $torrent) {
$thank = $user->thank_torrent_logs()->create(['torrentid' => $torrent->id]);
$sayThanksBonus = Setting::get('bonus.saythanks');
$receiveThanksBonus = Setting::get('bonus.receivethanks');
if ($sayThanksBonus > 0) {
$affectedRows = User::query()
->where('id', $user->id)
->where('seedbonus', $user->seedbonus)
->increment('seedbonus', $sayThanksBonus);
if ($affectedRows != 1) {
do_log("affectedRows: $affectedRows, query: " . last_query(), 'error');
throw new \RuntimeException("increment user bonus fail.");
}
}
if ($receiveThanksBonus > 0) {
$affectedRows = User::query()
->where('id', $torrentOwner->id)
->where('seedbonus', $torrentOwner->seedbonus)
->increment('seedbonus', $receiveThanksBonus);
if ($affectedRows != 1) {
do_log("affectedRows: $affectedRows, query: " . last_query(), 'error');
throw new \RuntimeException("increment owner bonus fail.");
}
}
return $thank;
});
$resource = new ThankResource($result); $resource = new ThankResource($result);
return $this->success($resource); return $this->success($resource, '说谢谢成功!');
} }
/** /**
+8
View File
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Repositories\ToolRepository; use App\Repositories\ToolRepository;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class ToolController extends Controller class ToolController extends Controller
{ {
@@ -14,4 +15,11 @@ class ToolController extends Controller
$this->repository = $repository; $this->repository = $repository;
} }
public function notifications(): array
{
$user = Auth::user();
$result = $this->repository->getNotificationCount($user);
return $this->success($result);
}
} }
+3 -1
View File
@@ -35,12 +35,14 @@ class TorrentResource extends JsonResource
'numfiles' => $this->numfiles, 'numfiles' => $this->numfiles,
'sp_state' => $this->sp_state, 'sp_state' => $this->sp_state,
'sp_state_real' => $this->sp_state_real, 'sp_state_real' => $this->sp_state_real,
'sp_state_real_text' => $this->spStateRealText, 'promotion_info' => $this->promotionInfo,
'hr' => $this->hr, 'hr' => $this->hr,
'pick_type' => $this->picktype, 'pick_type' => $this->picktype,
'pick_time' => $this->picktime, 'pick_time' => $this->picktime,
'pick_info' => $this->pickInfo,
'download_url' => $this->download_url, 'download_url' => $this->download_url,
'user' => new UserResource($this->whenLoaded('user')), 'user' => new UserResource($this->whenLoaded('user')),
'anonymous' => $this->anonymous,
'basic_category' => new CategoryResource($this->whenLoaded('basic_category')), 'basic_category' => new CategoryResource($this->whenLoaded('basic_category')),
'tags' => TagResource::collection($this->whenLoaded('tags')), 'tags' => TagResource::collection($this->whenLoaded('tags')),
'thanks' => ThankResource::collection($this->whenLoaded('thanks')), 'thanks' => ThankResource::collection($this->whenLoaded('thanks')),
+3 -1
View File
@@ -39,11 +39,13 @@ class Comment extends NexusModel
], ],
]; ];
public function scopeType(Builder $query, $type) public function scopeType(Builder $query, string $type, int $typeValue)
{ {
foreach (self::TYPE_MAPS as $key => $value) { foreach (self::TYPE_MAPS as $key => $value) {
if ($type != $key) { if ($type != $key) {
$query->where($value['foreign_key'], 0); $query->where($value['foreign_key'], 0);
} else {
$query->where($value['foreign_key'], $typeValue);
} }
} }
return $query; return $query;
+66 -7
View File
@@ -69,18 +69,77 @@ class Torrent extends NexusModel
const PROMOTION_ONE_THIRD_DOWN = 7; const PROMOTION_ONE_THIRD_DOWN = 7;
public static array $promotionTypes = [ public static array $promotionTypes = [
self::PROMOTION_NORMAL => ['text' => 'Normal', 'up_multiplier' => 1, 'down_multiplier' => 1], self::PROMOTION_NORMAL => [
self::PROMOTION_FREE => ['text' => 'Free', 'up_multiplier' => 1, 'down_multiplier' => 0], 'text' => 'Normal',
self::PROMOTION_TWO_TIMES_UP => ['text' => '2X', 'up_multiplier' => 2, 'down_multiplier' => 1], 'up_multiplier' => 1,
self::PROMOTION_FREE_TWO_TIMES_UP => ['text' => '2X Free', 'up_multiplier' => 2, 'down_multiplier' => 0], 'down_multiplier' => 1,
self::PROMOTION_HALF_DOWN => ['text' => '50%', 'up_multiplier' => 1, 'down_multiplier' => 0.5], 'color' => ''
self::PROMOTION_HALF_DOWN_TWO_TIMES_UP => ['text' => '2X 50%', 'up_multiplier' => 2, 'down_multiplier' => 0.5], ],
self::PROMOTION_ONE_THIRD_DOWN => ['text' => '30%', 'up_multiplier' => 1, 'down_multiplier' => 0.3], self::PROMOTION_FREE => [
'text' => 'Free',
'up_multiplier' => 1,
'down_multiplier' => 0,
'color' => 'linear-gradient(to right, rgba(0,52,206,0.5), rgba(0,52,206,1), rgba(0,52,206,0.5))'
],
self::PROMOTION_TWO_TIMES_UP => [
'text' => '2X',
'up_multiplier' => 2,
'down_multiplier' => 1,
'color' => 'linear-gradient(to right, rgba(0,153,0,0.5), rgba(0,153,0,1), rgba(0,153,0,0.5))'
],
self::PROMOTION_FREE_TWO_TIMES_UP => [
'text' => '2X Free',
'up_multiplier' => 2,
'down_multiplier' => 0,
'color' => 'linear-gradient(to right, rgba(0,153,0,1), rgba(0,52,206,1)'
],
self::PROMOTION_HALF_DOWN => [
'text' => '50%',
'up_multiplier' => 1,
'down_multiplier' => 0.5,
'color' => 'linear-gradient(to right, rgba(220,0,3,0.5), rgba(220,0,3,1), rgba(220,0,3,0.5))'
],
self::PROMOTION_HALF_DOWN_TWO_TIMES_UP => [
'text' => '2X 50%',
'up_multiplier' => 2,
'down_multiplier' => 0.5,
'color' => 'linear-gradient(to right, rgba(0,153,0,1), rgba(220,0,3,1)'
],
self::PROMOTION_ONE_THIRD_DOWN => [
'text' => '30%',
'up_multiplier' => 1,
'down_multiplier' => 0.3,
'color' => 'linear-gradient(to right, rgba(65,23,73,0.5), rgba(65,23,73,1), rgba(65,23,73,0.5))'
],
];
const PICK_NORMAL = 'normal';
const PICK_HOT = 'hot';
const PICK_CLASSIC = 'classic';
const PICK_RECOMMENDED = 'recommended';
public static array $pickTypes = [
self::PICK_NORMAL => ['text' => self::PICK_NORMAL, 'color' => ''],
self::PICK_HOT => ['text' => self::PICK_HOT, 'color' => '#e78d0f'],
self::PICK_CLASSIC => ['text' => self::PICK_CLASSIC, 'color' => '#77b300'],
self::PICK_RECOMMENDED => ['text' => self::PICK_RECOMMENDED, 'color' => '#820084'],
]; ];
const BONUS_REWARD_VALUES = [50, 100, 200, 500, 1000]; const BONUS_REWARD_VALUES = [50, 100, 200, 500, 1000];
public function getPickInfoAttribute()
{
$info = self::$pickTypes[$this->picktype] ?? null;
if ($info) {
$info['text'] = nexus_trans('torrent.pick_info.' . $this->picktype);
return $info;
}
}
public function getPromotionInfoAttribute()
{
return self::$promotionTypes[$this->sp_state_real] ?? null;
}
public function getSpStateRealTextAttribute() public function getSpStateRealTextAttribute()
{ {
+4 -1
View File
@@ -4,6 +4,7 @@ namespace App\Repositories;
use App\Exceptions\ClientNotAllowedException; use App\Exceptions\ClientNotAllowedException;
use App\Models\AgentAllow; use App\Models\AgentAllow;
use App\Models\AgentDeny; use App\Models\AgentDeny;
use Nexus\Database\NexusDB;
class AgentAllowRepository extends BaseRepository class AgentAllowRepository extends BaseRepository
{ {
@@ -72,10 +73,12 @@ class AgentAllowRepository extends BaseRepository
public function checkClient($peerId, $agent, $debug = false) public function checkClient($peerId, $agent, $debug = false)
{ {
//check from high version to low version, if high version allow, stop! //check from high version to low version, if high version allow, stop!
$allows = AgentAllow::query() $allows = NexusDB::remember("all_agent_allows", 600, function () {
return AgentAllow::query()
->orderBy('peer_id_start', 'desc') ->orderBy('peer_id_start', 'desc')
->orderBy('agent_start', 'desc') ->orderBy('agent_start', 'desc')
->get(); ->get();
});
$agentAllowPassed = null; $agentAllowPassed = null;
$versionTooLowStr = ''; $versionTooLowStr = '';
foreach ($allows as $agentAllow) { foreach ($allows as $agentAllow) {
+2 -2
View File
@@ -75,8 +75,8 @@ class AttendanceRepository extends BaseRepository
->where('uid', $uid) ->where('uid', $uid)
->orderBy('id', 'desc'); ->orderBy('id', 'desc');
if (!empty($date)) { if (!empty($date)) {
$query->where('added', '>=', Carbon::today()) $query->where('added', '>=', Carbon::parse($date)->startOfDay())
->where('added', '<', Carbon::tomorrow()); ->where('added', '<=', Carbon::parse($date)->endOfDay());
} }
return $query->first(); return $query->first();
} }
+5 -5
View File
@@ -41,8 +41,9 @@ class CommentRepository extends BaseRepository
$model = new $modelName; $model = new $modelName;
$target = $model->newQuery()->with('user')->find($params[$type]); $target = $model->newQuery()->with('user')->find($params[$type]);
return DB::transaction(function () use ($params, $user, $target) { return DB::transaction(function () use ($params, $user, $target) {
$params['added'] = Carbon::now();
$comment = $user->comments()->create($params); $comment = $user->comments()->create($params);
$commentCount = Comment::query()->type($params['type'])->count(); $commentCount = Comment::query()->type($params['type'], $params[$params['type']])->count();
$target->comments = $commentCount; $target->comments = $commentCount;
$target->save(); $target->save();
@@ -60,7 +61,7 @@ class CommentRepository extends BaseRepository
'receiver' => $target->user->id, 'receiver' => $target->user->id,
'subject' => $messageInfo['subject'], 'subject' => $messageInfo['subject'],
'msg' => $messageInfo['body'], 'msg' => $messageInfo['body'],
'added' => Carbon::now() 'added' => $params['added'],
]; ];
Message::query()->insert($insert); Message::query()->insert($insert);
NexusDB::cache_del('user_'.$target->user->id.'_unread_message_count'); NexusDB::cache_del('user_'.$target->user->id.'_unread_message_count');
@@ -100,9 +101,8 @@ class CommentRepository extends BaseRepository
$targetScript = Comment::TYPE_MAPS[$type]['target_script']; $targetScript = Comment::TYPE_MAPS[$type]['target_script'];
$targetNameField = Comment::TYPE_MAPS[$type]['target_name_field']; $targetNameField = Comment::TYPE_MAPS[$type]['target_name_field'];
$body = sprintf( $body = sprintf(
'%s [url="%s/%s"]%s[/url]', '%s [url=%s]%s[/url]',
$trans[$type]['msg_torrent_receive_comment'], $trans['msg_torrent_receive_comment'],
getSchemeAndHttpHost(),
sprintf($targetScript, $target->id), sprintf($targetScript, $target->id),
$target->{$targetNameField} $target->{$targetNameField}
); );
+2 -1
View File
@@ -30,10 +30,11 @@ class RewardRepository extends BaseRepository
} }
$torrent = Torrent::query()->findOrFail($torrentId, Torrent::$commentFields); $torrent = Torrent::query()->findOrFail($torrentId, Torrent::$commentFields);
$torrent->checkIsNormal(); $torrent->checkIsNormal();
$torrentOwner = User::query()->findOrFail($torrent->owner, ['id', 'seedbonus']); $torrentOwner = User::query()->findOrFail($torrent->owner);
if ($user->id == $torrentOwner->id) { if ($user->id == $torrentOwner->id) {
throw new \LogicException("you can't reward to yourself."); throw new \LogicException("you can't reward to yourself.");
} }
$torrentOwner->checkIsNormal();
return DB::transaction(function () use ($torrentId, $value, $user, $torrentOwner) { return DB::transaction(function () use ($torrentId, $value, $user, $torrentOwner) {
$model = $user->reward_torrent_logs()->create([ $model = $user->reward_torrent_logs()->create([
'torrentid' => $torrentId, 'torrentid' => $torrentId,
+29
View File
@@ -1,7 +1,12 @@
<?php <?php
namespace App\Repositories; namespace App\Repositories;
use App\Models\Message;
use App\Models\News;
use App\Models\Poll;
use App\Models\PollAnswer;
use App\Models\Setting; use App\Models\Setting;
use App\Models\User;
use Illuminate\Encryption\Encrypter; use Illuminate\Encryption\Encrypter;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
@@ -192,4 +197,28 @@ class ToolRepository extends BaseRepository
return false; return false;
} }
} }
public function getNotificationCount(User $user): array
{
$result = [];
//attend or not
$attendRep = new AttendanceRepository();
$attendance = $attendRep->getAttendance($user->id, date('Ymd'));
$result['attendance'] = $attendance ? 0 : 1;
//unread news
$count = News::query()->where('added', '>', $user->last_home)->count();
$result['news'] = $count;
//unread messages
$count = Message::query()->where('receiver', $user->id)->where('unread', 'yes')->count();
$result['message'] = $count;
//un-vote poll
$total = Poll::query()->count();
$userVoteCount = PollAnswer::query()->where('userid', $user->id)->selectRaw('count(distinct(pollid)) as counts')->first()->counts;
$result['poll'] = $total - $userVoteCount;
return $result;
}
} }
+4 -1
View File
@@ -24,6 +24,7 @@ use Carbon\Carbon;
use Hashids\Hashids; use Hashids\Hashids;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Nexus\Database\NexusDB;
class TorrentRepository extends BaseRepository class TorrentRepository extends BaseRepository
{ {
@@ -372,12 +373,14 @@ class TorrentRepository extends BaseRepository
private function getTrackerReportAuthKeySecret($id, $uid, $initializeIfNotExists = false) private function getTrackerReportAuthKeySecret($id, $uid, $initializeIfNotExists = false)
{ {
$secret = TorrentSecret::query() $secret = NexusDB::remember("tracker_report_authkey_secret:$id:$uid", 3600*24, function () use ($id, $uid) {
return TorrentSecret::query()
->where('uid', $uid) ->where('uid', $uid)
->whereIn('torrent_id', [0, $id]) ->whereIn('torrent_id', [0, $id])
->orderBy('torrent_id', 'desc') ->orderBy('torrent_id', 'desc')
->orderBy('id', 'desc') ->orderBy('id', 'desc')
->first(); ->first();
});
if ($secret) { if ($secret) {
return $secret->secret; return $secret->secret;
} }
+2 -2
View File
@@ -104,7 +104,7 @@ class TrackerRepository extends BaseRepository
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage()); $repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
} catch (TrackerException $exception) { } catch (TrackerException $exception) {
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage()); $repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
} catch (\Exception $exception) { } catch (\Throwable $exception) {
//other system exception //other system exception
do_log("[" . get_class($exception) . "] " . $exception->getMessage() . "\n" . $exception->getTraceAsString(), 'error'); do_log("[" . get_class($exception) . "] " . $exception->getMessage() . "\n" . $exception->getTraceAsString(), 'error');
$repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId()); $repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId());
@@ -806,7 +806,7 @@ class TrackerRepository extends BaseRepository
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage()); $repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
} catch (TrackerException $exception) { } catch (TrackerException $exception) {
$repDict = $this->generateFailedAnnounceResponse($exception->getMessage()); $repDict = $this->generateFailedAnnounceResponse($exception->getMessage());
} catch (\Exception $exception) { } catch (\Throwable $exception) {
//other system exception //other system exception
do_log("[" . get_class($exception) . "] " . $exception->getMessage() . "\n" . $exception->getTraceAsString(), 'error'); do_log("[" . get_class($exception) . "] " . $exception->getMessage() . "\n" . $exception->getTraceAsString(), 'error');
$repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId()); $repDict = $this->generateFailedAnnounceResponse("system error, report to sysop please, hint: " . nexus()->getRequestId());
+3 -1
View File
@@ -35,7 +35,9 @@ if (!empty($_REQUEST['authkey'])) {
if (empty($decrypted)) { if (empty($decrypted)) {
err('Invalid authkey'); err('Invalid authkey');
} }
$userInfo = \App\Models\User::query()->where('id', $uid)->first(['id', 'passkey']); $userInfo = \Nexus\Database\NexusDB::remember("announce_user_passkey_$uid", 600, function () use ($uid) {
return \App\Models\User::query()->where('id', $uid)->first(['id', 'passkey']);
});
if (!$userInfo) { if (!$userInfo) {
err('Invalid authkey'); err('Invalid authkey');
} }
+5
View File
@@ -0,0 +1,5 @@
<?php
return [
'comment_buy_medal' => 'Spend :bonus bonus buy :medal_name',
];
+11
View File
@@ -0,0 +1,11 @@
<?php
return [
'index' => [
'page_title' => 'Message list',
],
'show' => [
'page_title' => 'Message detail',
]
];
+9
View File
@@ -0,0 +1,9 @@
<?php
return [
'index' => [
'page_title' => 'Rewards',
]
];
+13 -1
View File
@@ -25,5 +25,17 @@ return [
'numfiles_label' => 'Files', 'numfiles_label' => 'Files',
'bookmark_yes_label' => 'Bookmarked', 'bookmark_yes_label' => 'Bookmarked',
'bookmark_no_label' => 'Add to bookmark', 'bookmark_no_label' => 'Add to bookmark',
] 'reward_logs_label' => 'Reward',
'reward_yes_label' => 'Rewarded',
'reward_no_label' => 'Reward',
'download_label' => 'Download',
'thanks_yes_label' => 'Thanked',
'thanks_no_label' => 'Thank',
],
'pick_info' => [
'normal' => 'Normal',
'hot' => 'Hot',
'classic' => 'Classic',
'recommended' => 'Recommend',
],
]; ];
+1 -3
View File
@@ -5,7 +5,5 @@ return [
'index' => [ 'index' => [
'page_title' => '赠魔者列表', 'page_title' => '赠魔者列表',
], ],
'show' => [
'page_title' => '私信详情',
]
]; ];
+7 -1
View File
@@ -31,5 +31,11 @@ return [
'download_label' => '下载', 'download_label' => '下载',
'thanks_yes_label' => '已谢谢', 'thanks_yes_label' => '已谢谢',
'thanks_no_label' => '谢谢', 'thanks_no_label' => '谢谢',
] ],
'pick_info' => [
'normal' => '普通',
'hot' => '热门',
'classic' => '经典',
'recommended' => '推荐',
],
]; ];
+5
View File
@@ -0,0 +1,5 @@
<?php
return [
'comment_buy_medal' => '花費 :bonus 魔力購買了 :medal_name',
];
+11
View File
@@ -0,0 +1,11 @@
<?php
return [
'index' => [
'page_title' => '私信列表',
],
'show' => [
'page_title' => '私信詳情',
]
];
+9
View File
@@ -0,0 +1,9 @@
<?php
return [
'index' => [
'page_title' => '贈魔者列表',
],
];
+14 -2
View File
@@ -24,6 +24,18 @@ return [
'thank_users_count_label' => '謝謝', 'thank_users_count_label' => '謝謝',
'numfiles_label' => '文件', 'numfiles_label' => '文件',
'bookmark_yes_label' => '已收藏', 'bookmark_yes_label' => '已收藏',
'bookmark_no_label' => '加入收藏', 'bookmark_no_label' => '收藏',
] 'reward_logs_label' => '贈魔',
'reward_yes_label' => '已贈魔',
'reward_no_label' => '贈魔',
'download_label' => '下載',
'thanks_yes_label' => '已謝謝',
'thanks_no_label' => '謝謝',
],
'pick_info' => [
'normal' => '普通',
'hot' => '熱門',
'classic' => '經典',
'recommended' => '推薦',
],
]; ];
+1
View File
@@ -43,6 +43,7 @@ Route::group(['middleware' => ['auth:sanctum', 'locale']], function () {
Route::get('polls-latest', [\App\Http\Controllers\PollController::class, 'latest']); Route::get('polls-latest', [\App\Http\Controllers\PollController::class, 'latest']);
Route::post('polls-vote', [\App\Http\Controllers\PollController::class, 'vote']); Route::post('polls-vote', [\App\Http\Controllers\PollController::class, 'vote']);
Route::resource('rewards', \App\Http\Controllers\RewardController::class); Route::resource('rewards', \App\Http\Controllers\RewardController::class);
Route::get('notifications', [\App\Http\Controllers\ToolController::class, 'notifications']);
}); });
Route::group(['middleware' => ['admin']], function () { Route::group(['middleware' => ['admin']], function () {