<?php

namespace App\Http\Services\V1;

use App\Generated\V1\Messages\Banner\PositionListMessage;
use App\Models\BannerModel;

class BannerService
{
    public function positionList(PositionListMessage $message)
    {
        $position = $message->getPosition();

        $banners = BannerModel::where('position', $position)->orderBy('sort', 'desc')->get();

        $message->setResponse($banners);
    }
}
