package com.sikey.wa04.business.infrastructure.repository;

import com.sikey.wa04.business.infrastructure.dto.model.PushRegistrationModel;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.springframework.data.domain.Limit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PushRegistrationRepository extends JpaRepository<PushRegistrationModel, Long> {
    List<PushRegistrationModel> findByUserId(@Size(max = 36) @NotNull String userId);

    PushRegistrationModel findFirstByUserId(@Size(max = 36) @NotNull String userId);

    void deleteByUserId(@Size(max = 36) @NotNull String userId);

    void deleteByRegId(@NotBlank(message = "注册ID不能为空") String regId);
}
