package com.mosquito.project.permission;

import com.mosquito.project.permission.entity.UserComplaintEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户投诉Repository
 */
@Repository
public interface UserComplaintRepository extends JpaRepository<UserComplaintEntity, Long> {

    List<UserComplaintEntity> findByUserIdOrderByCreatedAtDesc(Long userId);

    Page<UserComplaintEntity> findByUserId(Long userId, Pageable pageable);

    List<UserComplaintEntity> findByStatusOrderByCreatedAtDesc(String status);
}