<?php

namespace App\Generated\Controllers\V1;

use App\Generated\V1\Messages\Homepage\FeedScoreMessage;
use App\Http\Controllers\Controller;
use App\Http\Services\V1\HomepageService;
use App\Generated\V1\Messages\Homepage\FeedMessage;
use DB;
use App\Generated\V1\Messages\Homepage\ActivityTimeTableMessage;
use App\Generated\V1\Messages\Homepage\OpenidFeedMessage;

class HomepageController extends Controller
{
    public $handler;

    public function __construct(HomepageService $handler)
    {
        $this->handler = $handler;
    }

    public function feedScore(FeedScoreMessage $message)
    {
        $message->validateInput();
        $this->handler->feedScore($message);
        $message->validateOutput();
        return $message->getResponse();
    }

    public function openidFeed(OpenidFeedMessage $message)
    {
        $message->validateInput();
        $this->handler->openidFeed($message);
        $message->validateOutput();
        return $message->getResponse();
    }

    public function feed(FeedMessage $message)
    {
        $message->validateInput();
        $this->handler->feed($message);
        $message->validateOutput();
        return $message->getResponse();
    }

    public function activityTimeTable(ActivityTimeTableMessage $message)
    {
        $message->validateInput();
        $this->handler->activityTimeTable($message);
        $message->validateOutput();
        return $message->getResponse();
    }

}
