35 lines
885 B
C#
35 lines
885 B
C#
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;
|
|
}
|
|
|
|
|
|
public IHttpActionResult GetAuthor(string author)
|
|
{
|
|
return Ok(_foorumService.SearchFoorumAuthor(author));
|
|
}
|
|
public IHttpActionResult GetTitle(string title)
|
|
{
|
|
return Ok(_foorumService.SearchFoorumTitle(title));
|
|
}
|
|
|
|
public IHttpActionResult GetAuthorPosts(string authorPosts)
|
|
{
|
|
return Ok(_foorumService.SearchPostAuthor(authorPosts));
|
|
}
|
|
}
|
|
} |