added board name parameter
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Json;
|
||||
using System.Web.Http;
|
||||
using HttpGetAttribute = Microsoft.AspNetCore.Mvc.HttpGetAttribute;
|
||||
using RouteAttribute = Microsoft.AspNetCore.Mvc.RouteAttribute;
|
||||
|
||||
namespace NeDvachAPI.Controllers
|
||||
{
|
||||
@@ -8,13 +11,13 @@ namespace NeDvachAPI.Controllers
|
||||
public class ListController : ControllerBase
|
||||
{
|
||||
[HttpGet(Name = "GetPosts")]
|
||||
public string Get()
|
||||
public string Get([FromUri] string board = null)
|
||||
{
|
||||
|
||||
//Post[] posts = DBchat.DbList();
|
||||
List<Post> posts = DBchat.DbList();
|
||||
List<Post> posts = DBchat.DbList(board);
|
||||
string postsJson = JsonSerializer.Serialize(posts);
|
||||
Console.WriteLine("Запрошен список постов");
|
||||
Console.WriteLine("Запрошен список постов из борды " + board);
|
||||
return postsJson ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user