package cn.reghao.oss.console.app.db.repository;

import cn.reghao.oss.console.app.model.po.UploadChannel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author reghao
 * @date 2024-02-23 15:05:30
 */
public interface UploadChannelRepository extends JpaRepository<UploadChannel, Integer> {
    int countByCreateBy(int createBy);
    List<UploadChannel> findByNodeIdAndCreateBy(int nodeId, int createBy);
    UploadChannel findByChannelIdAndCreateBy(int channelId, int createBy);
    UploadChannel findByPrefixAndCreateByAndNodeId(String prefix, int createBy, int nodeId);
    UploadChannel findByPrefixAndNodeId(String prefix, int nodeId);
    List<UploadChannel> findByNodeId(int nodeId);
    Page<UploadChannel> findByCreateBy(int createBy, Pageable pageable);
}
