<?php

namespace App\Generated\Controllers\V1_1;

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

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();
    }

}
