package cn.reghao.tnb.search.app.blog.db.repository;

import cn.reghao.tnb.search.app.blog.model.po.ArticleTag;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author reghao
 * @date 2024-01-29 09:24:29
 */
public interface ArticleTagRepository extends JpaRepository<ArticleTag, Integer> {
    @Transactional
    @Modifying
    void deleteByArticleId(String articleId);

    List<ArticleTag> findByTagId(int tagId);
    int countByTagId(int tagId);
    List<ArticleTag> findByArticleId(String articleId);
}
