feat: 添加待确认分类功能,支持获取和确认未分类交易记录;优化相关组件和服务
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 24s
Docker Build & Deploy / Deploy to Production (push) Successful in 10s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 24s
Docker Build & Deploy / Deploy to Production (push) Successful in 10s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
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, MessageType type = MessageType.Text);
|
||||
Task<bool> AddAsync(string title, string content, MessageType type = MessageType.Text, string? url = null);
|
||||
Task<bool> MarkAsReadAsync(long id);
|
||||
Task<bool> MarkAllAsReadAsync();
|
||||
Task<bool> DeleteAsync(long id);
|
||||
@@ -29,19 +29,20 @@ public class MessageRecordService(IMessageRecordRepository messageRepo, INotific
|
||||
return await messageRepo.AddAsync(message);
|
||||
}
|
||||
|
||||
public async Task<bool> AddAsync(string title, string content, MessageType type = MessageType.Text)
|
||||
public async Task<bool> AddAsync(string title, string content, MessageType type = MessageType.Text, string? url = null)
|
||||
{
|
||||
var message = new MessageRecord
|
||||
{
|
||||
Title = title,
|
||||
Content = content,
|
||||
MessageType = type,
|
||||
Url = url,
|
||||
IsRead = false
|
||||
};
|
||||
var result = await messageRepo.AddAsync(message);
|
||||
if (result)
|
||||
{
|
||||
await notificationService.SendNotificationAsync(title);
|
||||
await notificationService.SendNotificationAsync(title, url);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user