Files
Swarm/DysonNetwork.Shared/Services/IMagicSpellService.cs
2025-07-08 23:55:31 +08:00

45 lines
1.3 KiB
C#

using DysonNetwork.Shared.Models;
using MagicOnion;
using NodaTime;
namespace DysonNetwork.Shared.Services;
public interface IMagicSpellService : IService<IMagicSpellService>
{
/// <summary>
/// Creates a new magic spell
/// </summary>
Task<MagicSpell> CreateMagicSpell(
Account account,
MagicSpellType type,
Dictionary<string, object> meta,
Instant? expiredAt = null,
Instant? affectedAt = null,
bool preventRepeat = false
);
/// <summary>
/// Gets a magic spell by its token
/// </summary>
Task<MagicSpell?> GetMagicSpellAsync(string token);
/// <summary>
/// Gets a magic spell by its ID.
/// </summary>
/// <param name="spellId">The ID of the magic spell.</param>
/// <returns>The magic spell if found, otherwise null.</returns>
Task<MagicSpell?> GetMagicSpellByIdAsync(Guid spellId);
/// <summary>
/// Applies a password reset magic spell.
/// </summary>
/// <param name="spell">The magic spell object.</param>
/// <param name="newPassword">The new password.</param>
Task ApplyPasswordReset(MagicSpell spell, string newPassword);
/// <summary>
/// Consumes a magic spell
/// </summary>
Task ApplyMagicSpell(string token);
}