11
This commit is contained in:
@@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Application.Web.Controllers.Pub
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 公共接口
|
||||
/// </summary>
|
||||
@@ -12,20 +11,31 @@ namespace Application.Web.Controllers.Pub
|
||||
public class PubController : ControllerBase
|
||||
{
|
||||
private readonly IAreaService _areaService;
|
||||
public PubController(IAreaService areaService)
|
||||
{
|
||||
private readonly INoticeService _noticeService;
|
||||
public PubController(IAreaService areaService,INoticeService noticeService)
|
||||
{
|
||||
_areaService = areaService;
|
||||
_noticeService = noticeService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取首页信息
|
||||
/// </summary>
|
||||
/// <param name="sid"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> GetMain()
|
||||
public async Task<IPoAction> GetMain(string sid)
|
||||
{
|
||||
bool isOnline = false;
|
||||
if (!string.IsNullOrEmpty(sid))
|
||||
{
|
||||
isOnline = true;
|
||||
}
|
||||
|
||||
var areaData = await _areaService.GetAreaData();
|
||||
return PoAction.Ok(new{area=areaData});
|
||||
var notice = await _noticeService.GetNoticeDataByTake(5);
|
||||
|
||||
return PoAction.Ok(new { area = areaData ,notice,isOnline});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user