using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Message.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Messages;
///
///
///
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}store/message")]
public class MessageController : AbpController
{
private readonly INotifyMessageService _notifyMessageService;
private readonly IUserNotifyMessageService _userNotifyMessageService;
///
///
///
///
///
public MessageController(
INotifyMessageService notifyMessageService,
IUserNotifyMessageService userNotifyMessageService)
{
_notifyMessageService = notifyMessageService;
_userNotifyMessageService = userNotifyMessageService;
}
///
///
///
///
///
[HttpGet("{messageId}")]
public virtual async Task GetMessageAsync(Guid messageId)
{
return await _notifyMessageService.GetAsync(messageId).ConfigureAwait(false);
}
///
///
///
///
///
[HttpGet("list/{userId}")]
public virtual async Task> GetListAsync(Guid userId)
{
return await _userNotifyMessageService.GetListAsync(userId).ConfigureAwait(false);
}
///
///
///
///
///
[HttpGet("not-read-list/{userId}")]
public virtual async Task> GetNotReadListAsync(Guid userId)
{
return await _userNotifyMessageService.GetNotReadListAsync(userId).ConfigureAwait(false);
}
///
///
///
///
[HttpPost("read/{id}")]
public virtual async Task ReadAsync(Guid id)
{
await _userNotifyMessageService.ReadAsync(id).ConfigureAwait(false);
}
///
///
///
///
///
[HttpGet("count/{userId}")]
public virtual async Task GetCountAsync(Guid userId)
{
return await _userNotifyMessageService.GetCountAsync(userId).ConfigureAwait(false);
}
///
///
///
///
///
[HttpGet("not-read-count/{userId}")]
public virtual async Task GetNotReadCountAsync(Guid userId)
{
return await _userNotifyMessageService.GetNotReadCountAsync(userId).ConfigureAwait(false);
}
}