- IDeviceRepository에 GetDevicesByTagIdAsync 메서드 추가 - DeviceRepository에 LIKE 기반 태그 참조 디바이스 조회 구현 - TagService.DeleteAsync에서 트랜잭션으로 원자적 처리: 디바이스 Tags JSON에서 삭제 대상 tagId 제거 후 태그 삭제
25 lines
1.1 KiB
C#
25 lines
1.1 KiB
C#
using SPMS.Domain.Entities;
|
|
using SPMS.Domain.Enums;
|
|
|
|
namespace SPMS.Domain.Interfaces;
|
|
|
|
public interface IDeviceRepository : IRepository<Device>
|
|
{
|
|
Task<Device?> GetByServiceAndTokenAsync(long serviceId, string deviceToken);
|
|
Task<Device?> GetByIdAndServiceAsync(long id, long serviceId);
|
|
Task<int> GetActiveCountByServiceAsync(long serviceId);
|
|
Task<IReadOnlyList<Device>> GetByPlatformAsync(long serviceId, Platform platform);
|
|
Task<(IReadOnlyList<Device> Items, int TotalCount)> GetPagedAsync(
|
|
long? serviceId, int page, int size,
|
|
Platform? platform = null, bool? pushAgreed = null,
|
|
bool? isActive = null, List<int>? tags = null,
|
|
string? keyword = null, bool? marketingAgreed = null);
|
|
Task<IReadOnlyList<Device>> GetAllFilteredAsync(
|
|
long? serviceId,
|
|
Platform? platform = null, bool? pushAgreed = null,
|
|
bool? isActive = null, List<int>? tags = null,
|
|
string? keyword = null, bool? marketingAgreed = null);
|
|
Task<Dictionary<long, int>> GetDeviceCountsByTagIdsAsync(IEnumerable<long> tagIds);
|
|
Task<IReadOnlyList<Device>> GetDevicesByTagIdAsync(long tagId);
|
|
}
|