package com.example.demo.repository;

import java.util.List;

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 com.example.demo.model.WorkflowVideo;

@Repository
public interface WorkflowVideoRepository extends JpaRepository<WorkflowVideo, Long> {

    /** 公开列表：只查已启用的，按 sortOrder 升序、创建时间降序 */
    List<WorkflowVideo> findByIsActiveTrueOrderBySortOrderAscCreatedAtDesc();

    /** 管理后台分页列表 */
    Page<WorkflowVideo> findAllByOrderBySortOrderAscCreatedAtDesc(Pageable pageable);
}
