feat: 新增IM即时通讯(浮窗)、工作流、打印模块及工作台增强
- IM: 新增浮窗聊天(ImFloatWindow)、管理页(monitor/config/service/message)、SSE推送 - 工作流: 新增待办/我的流程页面及后端服务 - 打印: 新增打印模板、出库单打印(PrintPage)、模板种子脚本 - 工作台: 增强快捷入口与工作台数据 - 修复: TagsView页签关闭、CrudPage通用表格增强 - 移除导航菜单中的即时通讯入口,改为右下角浮窗
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
using System.Threading.Tasks;
|
||||
using F9MES.Application.Im;
|
||||
using F9MES.Common.Result;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace F9MES.Api.Controllers;
|
||||
|
||||
/// <summary>IM 系统管理:性能/服务监测、配置界面、系统消息与公告管理</summary>
|
||||
[ApiController]
|
||||
[Route("api/im/admin")]
|
||||
[Authorize]
|
||||
public class ImAdminController : ControllerBase
|
||||
{
|
||||
private readonly ImAdminService _svc;
|
||||
|
||||
public ImAdminController(ImAdminService svc)
|
||||
{
|
||||
_svc = svc;
|
||||
}
|
||||
|
||||
/// <summary>性能监测</summary>
|
||||
[HttpGet("performance")]
|
||||
public async Task<ActionResult> Performance()
|
||||
{
|
||||
return Ok(ApiResult.Ok(await _svc.PerformanceAsync()));
|
||||
}
|
||||
|
||||
/// <summary>服务监测</summary>
|
||||
[HttpGet("service")]
|
||||
public async Task<ActionResult> Service()
|
||||
{
|
||||
return Ok(ApiResult.Ok(await _svc.ServiceStatusAsync()));
|
||||
}
|
||||
|
||||
/// <summary>读取 IM 配置</summary>
|
||||
[HttpGet("config")]
|
||||
public async Task<ActionResult> Config()
|
||||
{
|
||||
return Ok(ApiResult.Ok(await _svc.GetConfigAsync()));
|
||||
}
|
||||
|
||||
/// <summary>保存 IM 配置</summary>
|
||||
[HttpPost("config")]
|
||||
public async Task<ActionResult> SaveConfig([FromBody] List<ImConfigInput> inputs)
|
||||
{
|
||||
await _svc.SaveConfigAsync(inputs ?? new());
|
||||
return Ok(ApiResult.Ok(true, "配置已保存"));
|
||||
}
|
||||
|
||||
/// <summary>系统消息管理分页(msgType=-1 全部)</summary>
|
||||
[HttpGet("messages")]
|
||||
public async Task<ActionResult> Messages([FromQuery] string? kw, [FromQuery] int msgType = -1, [FromQuery] int page = 1, [FromQuery] int size = 20)
|
||||
{
|
||||
return Ok(ApiResult.Ok(await _svc.GetMessagesAsync(kw, msgType, page, size)));
|
||||
}
|
||||
|
||||
/// <summary>删除消息</summary>
|
||||
[HttpDelete("messages/{id}")]
|
||||
public async Task<ActionResult> DeleteMessage(long id)
|
||||
{
|
||||
await _svc.DeleteMessageAsync(id);
|
||||
return Ok(ApiResult.Ok(true, "已删除"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user