添加消息类型枚举和相关字段,优化消息记录服务的添加方法,更新多个组件以支持新增分类对话框
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 38s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s

This commit is contained in:
孙诚
2026-01-06 13:45:39 +08:00
parent baa77341bc
commit 10b02df6e2
10 changed files with 178 additions and 149 deletions

View File

@@ -5,7 +5,7 @@ public interface IMessageRecordService
Task<(IEnumerable<MessageRecord> List, long Total)> GetPagedListAsync(int pageIndex, int pageSize);
Task<MessageRecord?> GetByIdAsync(long id);
Task<bool> AddAsync(MessageRecord message);
Task<bool> AddAsync(string title, string content);
Task<bool> AddAsync(string title, string content, MessageType type = MessageType.Text);
Task<bool> MarkAsReadAsync(long id);
Task<bool> MarkAllAsReadAsync();
Task<bool> DeleteAsync(long id);
@@ -29,12 +29,13 @@ public class MessageRecordService(IMessageRecordRepository messageRepo, INotific
return await messageRepo.AddAsync(message);
}
public async Task<bool> AddAsync(string title, string content)
public async Task<bool> AddAsync(string title, string content, MessageType type = MessageType.Text)
{
var message = new MessageRecord
{
Title = title,
Content = content,
MessageType = type,
IsRead = false
};
var result = await messageRepo.AddAsync(message);