vreksam/WebApi/Controllers/SearchController.cs

35 lines
885 B
C#
Raw Normal View History

2017-06-12 15:26:34 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using BL.Interfaces;
namespace WebApi.Controllers
{
public class SearchController : ApiController
{
private readonly IFoorumService _foorumService;
public SearchController(IFoorumService foorumService)
{
_foorumService = foorumService;
}
2017-06-12 15:53:50 +03:00
public IHttpActionResult GetAuthor(string author)
2017-06-12 15:26:34 +03:00
{
return Ok(_foorumService.SearchFoorumAuthor(author));
}
2017-06-12 15:53:50 +03:00
public IHttpActionResult GetTitle(string title)
{
return Ok(_foorumService.SearchFoorumTitle(title));
}
public IHttpActionResult GetAuthorPosts(string authorPosts)
{
return Ok(_foorumService.SearchPostAuthor(authorPosts));
}
2017-06-12 15:26:34 +03:00
}
}