forest/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java

123 lines
3.1 KiB
Java
Raw Normal View History

2019-11-18 01:22:27 +08:00
package com.rymcu.vertical.mapper;
import com.rymcu.vertical.core.mapper.Mapper;
import com.rymcu.vertical.dto.ArticleDTO;
2019-12-18 01:14:18 +08:00
import com.rymcu.vertical.dto.ArticleTagDTO;
2019-11-18 01:22:27 +08:00
import com.rymcu.vertical.dto.Author;
import com.rymcu.vertical.entity.Article;
2019-11-18 19:04:39 +08:00
import com.rymcu.vertical.entity.ArticleContent;
2019-11-18 01:22:27 +08:00
import org.apache.ibatis.annotations.Param;
import java.util.List;
2020-03-30 17:24:36 +08:00
/**
* @author ronger
*/
2019-11-18 01:22:27 +08:00
public interface ArticleMapper extends Mapper<Article> {
2020-03-30 17:24:36 +08:00
/**
* 获取文章列表
* @param searchText
* @param tag
* @return
*/
2019-11-18 01:22:27 +08:00
List<ArticleDTO> selectArticles(@Param("searchText") String searchText, @Param("tag") String tag);
2020-03-30 17:24:36 +08:00
/**
* 根据用户 ID 获取作者信息
* @param id
* @return
*/
2019-11-18 01:22:27 +08:00
Author selectAuthor(@Param("id") Integer id);
2020-03-30 17:24:36 +08:00
/**
* 根据文章 ID 查询文章
* @param id
* @param type
* @return
*/
ArticleDTO selectArticleDTOById(@Param("id") Integer id, @Param("type") int type);
2019-11-18 01:22:27 +08:00
2020-03-30 17:24:36 +08:00
/**
* 保存文章内容
* @param idArticle
* @param articleContent
* @param articleContentHtml
* @return
*/
2019-11-18 01:22:27 +08:00
Integer insertArticleContent(@Param("idArticle") Integer idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml);
2020-03-30 17:24:36 +08:00
/**
* 更新文章内容
* @param idArticle
* @param articleContent
* @param articleContentHtml
* @return
*/
2019-11-18 01:22:27 +08:00
Integer updateArticleContent(@Param("idArticle") Integer idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml);
2019-11-18 19:04:39 +08:00
2020-03-30 17:24:36 +08:00
/**
* 获取文章正文内容
* @param idArticle
* @return
*/
2019-11-18 19:04:39 +08:00
ArticleContent selectArticleContent(@Param("idArticle") Integer idArticle);
2020-03-30 17:24:36 +08:00
/**
* 获取主题下文章列表
* @param topicName
* @return
*/
2019-12-26 00:05:28 +08:00
List<ArticleDTO> selectArticlesByTopicUri(@Param("topicName") String topicName);
2020-03-30 17:24:36 +08:00
/**
* 获取标签下文章列表
* @param tagName
* @return
*/
List<ArticleDTO> selectArticlesByTagName(@Param("tagName") String tagName);
2020-03-30 17:24:36 +08:00
/**
* 获取用户文章列表
* @param idUser
* @return
*/
List<ArticleDTO> selectUserArticles(@Param("idUser") Integer idUser);
2019-12-18 01:14:18 +08:00
2020-03-30 17:24:36 +08:00
/**
* 删除文章标签
* @param id
* @return
*/
2019-12-18 01:14:18 +08:00
Integer deleteTagArticle(@Param("id") Integer id);
2020-03-30 17:24:36 +08:00
/**
* 获取文章标签列表
* @param idArticle
* @return
*/
2019-12-18 01:14:18 +08:00
List<ArticleTagDTO> selectTags(@Param("idArticle") Integer idArticle);
2020-01-14 14:24:18 +08:00
/**
2020-03-30 17:24:36 +08:00
* 更新文章浏览数
2020-01-14 14:24:18 +08:00
* @param id
* @param articleViewCount
* @return
*/
Integer updateArticleViewCount(@Param("id") Integer id, @Param("articleViewCount") Integer articleViewCount);
2020-03-30 17:24:36 +08:00
/**
* 获取草稿列表
* @param idUser
* @return
*/
List<ArticleDTO> selectDrafts(@Param("idUser") Integer idUser);
/**
* 删除未使用的文章标签
* @param idArticleTag
* @return
*/
Integer deleteUnusedArticleTag(@Param("idArticleTag") Integer idArticleTag);
2019-11-18 01:22:27 +08:00
}