28 lines
943 B
C#
28 lines
943 B
C#
using DramaLing.Api.Models.Entities;
|
|
|
|
namespace DramaLing.Api.Repositories;
|
|
|
|
/// <summary>
|
|
/// User 專門的 Repository 介面
|
|
/// </summary>
|
|
public interface IUserRepository : IRepository<User>
|
|
{
|
|
// 用戶查詢
|
|
Task<User?> GetByEmailAsync(string email);
|
|
Task<User?> GetByUsernameAsync(string username);
|
|
Task<bool> ExistsByEmailAsync(string email);
|
|
Task<bool> ExistsByUsernameAsync(string username);
|
|
|
|
// 用戶設定相關
|
|
Task<User?> GetUserWithSettingsAsync(Guid userId);
|
|
Task<User?> GetUserWithStatsAsync(Guid userId);
|
|
|
|
// 學習進度統計
|
|
Task<Dictionary<string, object>> GetUserLearningStatsAsync(Guid userId);
|
|
Task<int> GetTotalStudyTimeAsync(Guid userId);
|
|
Task<DateTime?> GetLastActivityDateAsync(Guid userId);
|
|
|
|
// 用戶活躍度
|
|
Task<IEnumerable<User>> GetActiveUsersAsync(int days);
|
|
Task<IEnumerable<User>> GetNewUsersAsync(DateTime since);
|
|
} |