using ladaexpress.vn.Infrastructures.Services;
using Microsoft.AspNetCore.Mvc;

namespace ladaexpress.vn.Controllers
{
    public class TopicController : Controller
    {
        private readonly ITopicService _topicService;

        public TopicController(ITopicService topicService)
        {
            _topicService = topicService;
        }

        public async Task<IActionResult> Detail(int id)
        {
            var model = await _topicService.PrepareTopicDetail(id);
            if (model.Id > 0)
            {
                return View(model);
            }
            else
            {
                return NotFound();
            }

        }
    }
}
