添加消息类型枚举和相关字段,优化消息记录服务的添加方法,更新多个组件以支持新增分类对话框
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user