Browse Source

feat: 领域服务添加接口

pull/89/head
王军 3 years ago
parent
commit
d328b8cd12
  1. 4
      aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application/DataDictionaries/DataDictionaryAppService.cs
  2. 2
      aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Domain/DataDictionaries/DataDictionaryManager.cs
  3. 71
      aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Domain/DataDictionaries/IDataDictionaryManager.cs
  4. 4
      aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Files/FileAppService.cs
  5. 2
      aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/FileManager.cs
  6. 15
      aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/IFileManager.cs
  7. 4
      aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application/Notifications/NotificationAppService.cs
  8. 71
      aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationManager.cs
  9. 2
      aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/NotificationManager.cs

4
aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application/DataDictionaries/DataDictionaryAppService.cs

@ -10,11 +10,11 @@ namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries
/// </summary>
private readonly IDataDictionaryRepository _dataDictionaryRepository;
private readonly DataDictionaryManager _dataDictionaryManager;
private readonly IDataDictionaryManager _dataDictionaryManager;
public DataDictionaryAppService(
IDataDictionaryRepository dataDictionaryRepository,
DataDictionaryManager dataDictionaryManager)
IDataDictionaryManager dataDictionaryManager)
{
_dataDictionaryRepository = dataDictionaryRepository;
_dataDictionaryManager = dataDictionaryManager;

2
aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Domain/DataDictionaries/DataDictionaryManager.cs

@ -1,6 +1,6 @@
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries
{
public class DataDictionaryManager : DataDictionaryDomainService
public class DataDictionaryManager : DataDictionaryDomainService, IDataDictionaryManager
{
private readonly IDataDictionaryRepository _dataDictionaryRepository;
private readonly IDistributedCache<DataDictionaryDto> _cache;

71
aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Domain/DataDictionaries/IDataDictionaryManager.cs

@ -0,0 +1,71 @@
namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries;
public interface IDataDictionaryManager
{
Task<DataDictionaryDto> FindByIdAsync(
Guid id,
CancellationToken cancellationToken = default);
Task<DataDictionaryDto> FindByCodeAsync(
string code,
CancellationToken cancellationToken = default);
/// <summary>
/// 创建字典类型
/// </summary>
/// <param name="code"></param>
/// <param name="displayText"></param>
/// <param name="description"></param>
Task<DataDictionary> CreateAsync(string code, string displayText, string description);
/// <summary>
/// 新增字典明细
/// </summary>
/// <param name="dataDictionaryId"></param>
/// <param name="code"></param>
/// <param name="displayText"></param>
/// <param name="description"></param>
/// <param name="order"></param>
/// <exception cref="DataDictionaryDomainException"></exception>
Task<DataDictionary> CreateDetailAsync(
Guid dataDictionaryId,
string code,
string displayText,
string description,
int order);
/// <summary>
/// 设置字典明细状态
/// </summary>
Task<DataDictionary> SetStatus(
Guid dataDictionaryId,
Guid dataDictionaryDetailId,
bool isEnabled);
/// <summary>
/// 更新数据字典明细
/// </summary>
Task<DataDictionary> UpdateDetailAsync(
Guid dataDictionaryId,
Guid dataDictionaryDetailId,
string displayText,
string description,
int order);
Task DeleteAsync(Guid dataDictionaryId, Guid dataDictionayDetailId);
Task<DataDictionary> UpdateAsync(
Guid dataDictionaryId,
string displayText,
string description);
/// <summary>
/// 删除字典类型
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task DeleteDataDictionaryTypeAsync(Guid id);
IAbpLazyServiceProvider LazyServiceProvider { get; set; }
IServiceProvider ServiceProvider { get; set; }
}

4
aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Application/Files/FileAppService.cs

@ -3,10 +3,10 @@
[Authorize]
public class FileAppService : FileManagementAppService, IFileAppService
{
private readonly FileManager _fileManager;
private readonly IFileManager _fileManager;
private readonly IConfiguration _configuration;
public FileAppService(FileManager fileManager, IConfiguration configuration)
public FileAppService(IFileManager fileManager, IConfiguration configuration)
{
_fileManager = fileManager;
_configuration = configuration;

2
aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/FileManager.cs

@ -1,6 +1,6 @@
namespace Lion.AbpPro.FileManagement.Files;
public class FileManager : DomainService
public class FileManager : DomainService, IFileManager
{
private readonly IFileRepository _fileRepository;

15
aspnet-core/modules/FileManagement/src/Lion.AbpPro.FileManagement.Domain/Files/IFileManager.cs

@ -0,0 +1,15 @@
namespace Lion.AbpPro.FileManagement.Files;
public interface IFileManager
{
Task CreateAsync(string fileName, string filePath);
Task<List<File>> PagingAsync(
string filter = null,
int maxResultCount = 10,
int skipCount = 0);
Task<long> CountAsync(string filter = null);
IAbpLazyServiceProvider LazyServiceProvider { get; set; }
IServiceProvider ServiceProvider { get; set; }
}

4
aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Application/Notifications/NotificationAppService.cs

@ -3,12 +3,12 @@ namespace Lion.AbpPro.NotificationManagement.Notifications
[Authorize]
public class NotificationAppService : NotificationManagementAppService, INotificationAppService
{
private readonly NotificationManager _notificationManager;
private readonly INotificationManager _notificationManager;
private readonly ICurrentUser _currentUser;
public NotificationAppService(
NotificationManager notificationManager,
INotificationManager notificationManager,
ICurrentUser currentUser)
{
_notificationManager = notificationManager;

71
aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/INotificationManager.cs

@ -0,0 +1,71 @@
using Volo.Abp.DependencyInjection;
namespace Lion.AbpPro.NotificationManagement.Notifications;
public interface INotificationManager
{
/// <summary>
/// 分页获取消息
/// </summary>
Task<List<Notification>> GetPagingListAsync(
Guid? userId,
MessageType messageType,
int maxResultCount = 10,
int skipCount = 0);
/// <summary>
/// 获取消息总条数
/// </summary>
Task<long> GetPagingCountAsync(Guid? userId, MessageType messageType);
/// <summary>
/// 发送警告文本消息
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">消息内容</param>
/// <param name="receiveIds">接受人,发送给谁。</param>
Task SendCommonWarningMessageAsync(string title, string content, List<Guid> receiveIds);
/// <summary>
/// 发送普通文本消息
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">消息内容</param>
/// <param name="receiveIds">接受人,发送给谁。</param>
Task SendCommonInformationMessageAsync(string title, string content, List<Guid> receiveIds);
/// <summary>
/// 发送错误文本消息
/// </summary>
Task SendCommonErrorMessageAsync(string title, string content, List<Guid> receiveIds);
/// <summary>
/// 发送警告广播消息
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">消息内容</param>
Task SendBroadCastWarningMessageAsync(string title, string content);
/// <summary>
/// 发送正常广播消息
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">消息内容</param>
Task SendBroadCastInformationMessageAsync(string title, string content);
/// <summary>
/// 发送错误广播消息
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">消息内容</param>
Task SendBroadCastErrorMessageAsync(string title, string content);
/// <summary>
/// 消息设置为已读
/// </summary>
/// <param name="id">消息Id</param>
Task SetReadAsync(Guid id);
IAbpLazyServiceProvider LazyServiceProvider { get; set; }
IServiceProvider ServiceProvider { get; set; }
}

2
aspnet-core/modules/NotificationManagement/src/Lion.AbpPro.NotificationManagement.Domain/Notifications/NotificationManager.cs

@ -2,7 +2,7 @@ using Lion.AbpPro.NotificationManagement.Notifications.LocalEvents;
namespace Lion.AbpPro.NotificationManagement.Notifications
{
public class NotificationManager : NotificationManagementDomainService
public class NotificationManager : NotificationManagementDomainService, INotificationManager
{
private readonly INotificationRepository _notificationRepository;

Loading…
Cancel
Save