using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace ChatRoomServer.Www.Controllers { using System.Data.Entity; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Web.Http.Cors; using System.Web.Mvc.Filters; using ChatRoomServer.Db; using FSLib.MvcWeb; using FSLib.Network.Http; [EnableCors("http://12306.liebao.cn,http://test.fishlee.net", "*", "*", "")] public class AnnouncementController : Controller { [AllowAnonymous] [HttpGet, OutputCache(Duration = 1200, VaryByHeader = "Origin")] public async Task List() { var client = new HttpClient(); var ctx = client.Create(HttpMethod.Get, $"http://{Request.Url.Host}:{Request.Url.Port}/api/announcement/list"); await ctx.SendTask(); return Content(ctx.Result, "application/json"); } } }