using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Request.Inbox;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using GxPress.Repository.Interface;
using GxPress.Auth;
namespace GxPress.Api.AppControllers
{
///
/// 收件箱
///
[Route("api/app/inbox")]
[ApiController]
[Authorize]
public class InboxController : ControllerBase
{
private readonly IMiddleRepository middleRepository;
private readonly ILoginContext _loginContext;
public InboxController(IMiddleRepository middleRepository, ILoginContext loginContext)
{
this.middleRepository = middleRepository;
_loginContext = loginContext;
}
///
/// 搜索
///
///
///
[HttpPost("search")]
public async Task> Search(InboxSearchRequest request)
{
request.UserId = _loginContext.AccountId;
return await middleRepository.FindAsync(request);
}
}
}