Mineplex2018-withcommit/Website/Nautilus.Web.Impulse/Controllers/ClanController.cs

45 lines
1.0 KiB
C#
Raw Normal View History

2013-08-27 17:14:08 +02:00
using LOC.Core.Tokens.Clan;
namespace LOC.Website.Web.Controllers
{
using System.Web.Mvc;
using Common.Models;
using Newtonsoft.Json;
public class ClanController : Controller
{
private readonly IClanAdministrator _clanAdministrator;
public ClanController(IClanAdministrator clanAdministrator)
{
_clanAdministrator = clanAdministrator;
}
[HttpPost]
public void AddClan(ClanToken clan)
{
_clanAdministrator.AddClan(clan);
}
[HttpPost]
public void EditClan(ClanToken clan)
{
_clanAdministrator.EditClan(clan);
}
[HttpPost]
public void DeleteClan(ClanToken clan)
{
_clanAdministrator.DeleteClan(clan);
}
[HttpPost]
public ActionResult GetClans()
{
var clans = _clanAdministrator.GetClans();
var json = JsonConvert.SerializeObject(clans);
return Content(json, "application/json");
}
}
}