|
@@ -1,3 +1,5 @@
|
|
|
+
|
|
|
+using OASystem.Domain.Dtos.System;
|
|
|
using Org.BouncyCastle.Asn1.Cms;
|
|
|
using System.Collections;
|
|
|
using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
|
|
@@ -16,7 +18,7 @@ namespace OASystem.API.Controllers
|
|
|
private readonly DepartmentRepository _sysDepRep;
|
|
|
private readonly UsersRepository _userRep;
|
|
|
private readonly IMapper _mapper;
|
|
|
-
|
|
|
+ private readonly MessageRepository _messageRep;
|
|
|
private readonly SetDataRepository _setDataRepository;
|
|
|
private readonly SystemMenuPermissionRepository _SystemMenuPermissionRepository;
|
|
|
private readonly CompanyRepository _CompanyRepository;
|
|
@@ -30,12 +32,13 @@ namespace OASystem.API.Controllers
|
|
|
public SystemController( CompanyRepository syscom, DepartmentRepository sysDepRep, UsersRepository userRep,
|
|
|
IMapper mapper, SetDataRepository setDataRepository, CompanyRepository companyRepository,
|
|
|
SystemMenuPermissionRepository systemMenuPermissionRepository, PageFunctionPermissionRepository pageFunctionPermissionRepository,
|
|
|
- SystemMenuAndFunctionRepository systemMenuAndFunctionRepository, JobPostAuthorityRepository jobPostAuthorityRepository, JobPostRepository jobRep
|
|
|
- , UserAuthorityRepository userAuthorityRepository)
|
|
|
+ SystemMenuAndFunctionRepository systemMenuAndFunctionRepository, JobPostAuthorityRepository jobPostAuthorityRepository,
|
|
|
+ JobPostRepository jobRep,UserAuthorityRepository userAuthorityRepository, MessageRepository messageRep)
|
|
|
|
|
|
{
|
|
|
_syscomRep = syscom;
|
|
|
_sysDepRep = sysDepRep;
|
|
|
+ _messageRep = messageRep;
|
|
|
_userRep = userRep;
|
|
|
_mapper = mapper;
|
|
|
_setDataRepository = setDataRepository;
|
|
@@ -49,8 +52,81 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
#region 消息
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取消息列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> GetMsgList(MsgDto dto)
|
|
|
+ {
|
|
|
+ var msgData = await _messageRep.GetMsgList(dto);
|
|
|
+
|
|
|
+ if (msgData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, msgData.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(true, msgData.Data));
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取消息详细信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> GetMsgInfo(MsgInfoDto dto)
|
|
|
+ {
|
|
|
+ var msgData = await _messageRep.GetMsgInfo(dto);
|
|
|
+
|
|
|
+ if (msgData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, msgData.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(true, msgData.Data));
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 消息设置已读
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> SetMessageRead(MsgSetReadDto dto)
|
|
|
+ {
|
|
|
+ var msgData = await _messageRep.SetMsgRead(dto);
|
|
|
+
|
|
|
+ if (msgData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, msgData.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(true, msgData.Data));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 消息设置已读
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> DeleMsg(MsgDeleteDto dto)
|
|
|
+ {
|
|
|
+ var msgData = await _messageRep.DelMsg(dto);
|
|
|
+
|
|
|
+ if (msgData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, msgData.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(true, msgData.Data));
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 类型表
|