using System.Collections.Generic; using IRaCIS.Application.Interfaces; using IRaCIS.Application.ViewModels; using System; using IRaCIS.Core.Application.Contracts.RequestAndResponse; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; namespace IRaCIS.Api.Controllers { [Route("message")] [ApiController, Authorize, ApiExplorerSettings(GroupName = "Common")] public class MessageController : ControllerBase { private IMessageService _app; public MessageController(IMessageService app) { _app = app; } /// /// 删除消息 /// /// 消息Id /// [HttpDelete, Route("deleteMessage/{messageId:guid}")] public IResponseOutput DeleteSysMessage(Guid messageId) { return _app.DeleteSysMessage(messageId); } /// /// 分页获取系统消息 /// /// 医生Id /// 分页大小 /// 也索引 /// [HttpGet, Route("getMessageList/{doctorId:guid}/{pageIndex:int:min(1)}/{pageSize:int:range(1,100)}")] public IResponseOutput> GetMessageList(Guid doctorId, int pageSize, int pageIndex) { return ResponseOutput.Ok(_app.GetMessageList(doctorId, pageSize, pageIndex)) ; } /// /// 将消息标记已读 /// /// /// [HttpGet, Route("markedAsRead/{messageId:guid}")] public IResponseOutput MarkedAsRead(Guid messageId) { return _app.MarkedAsRead(messageId); } } }