63 lines
1.9 KiB
C#
63 lines
1.9 KiB
C#
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;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除消息
|
|
/// </summary>
|
|
/// <param name="messageId">消息Id</param>
|
|
/// <returns></returns>
|
|
|
|
[HttpDelete, Route("deleteMessage/{messageId:guid}")]
|
|
public IResponseOutput DeleteSysMessage(Guid messageId)
|
|
{
|
|
return _app.DeleteSysMessage(messageId);
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分页获取系统消息
|
|
/// </summary>
|
|
/// <param name="doctorId">医生Id</param>
|
|
/// <param name="pageSize">分页大小</param>
|
|
/// <param name="pageIndex">也索引</param>
|
|
/// <returns></returns>
|
|
|
|
[HttpGet, Route("getMessageList/{doctorId:guid}/{pageIndex:int:min(1)}/{pageSize:int:range(1,100)}")]
|
|
public IResponseOutput<PageOutput<SysMessageDTO>> GetMessageList(Guid doctorId, int pageSize, int pageIndex)
|
|
{
|
|
return ResponseOutput.Ok(_app.GetMessageList(doctorId, pageSize, pageIndex)) ;
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 将消息标记已读
|
|
/// </summary>
|
|
/// <param name="messageId"></param>
|
|
/// <returns></returns>
|
|
|
|
[HttpGet, Route("markedAsRead/{messageId:guid}")]
|
|
public IResponseOutput MarkedAsRead(Guid messageId)
|
|
{
|
|
return _app.MarkedAsRead(messageId);
|
|
|
|
}
|
|
}
|
|
}
|