From 766105022cc764ac7dde0ac9d96f672d48561e0a Mon Sep 17 00:00:00 2001 From: ronger Date: Mon, 30 Mar 2020 17:24:36 +0800 Subject: [PATCH] =?UTF-8?q?:speech=5Fballoon:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rymcu/vertical/mapper/ArticleMapper.java | 83 ++++++++++++++++++- .../rymcu/vertical/mapper/CommentMapper.java | 43 ++++++++++ .../com/rymcu/vertical/mapper/TagMapper.java | 52 ++++++++++++ 3 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/rymcu/vertical/mapper/CommentMapper.java diff --git a/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java b/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java index 71b036c..959525f 100644 --- a/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java +++ b/src/main/java/com/rymcu/vertical/mapper/ArticleMapper.java @@ -10,34 +10,113 @@ import org.apache.ibatis.annotations.Param; import java.util.List; +/** + * @author ronger + */ public interface ArticleMapper extends Mapper
{ + + /** + * 获取文章列表 + * @param searchText + * @param tag + * @return + */ List selectArticles(@Param("searchText") String searchText, @Param("tag") String tag); + /** + * 根据用户 ID 获取作者信息 + * @param id + * @return + */ Author selectAuthor(@Param("id") Integer id); - ArticleDTO selectArticleDTOById(@Param("id") Integer id); + /** + * 根据文章 ID 查询文章 + * @param id + * @param type + * @return + */ + ArticleDTO selectArticleDTOById(@Param("id") Integer id, @Param("type") int type); + /** + * 保存文章内容 + * @param idArticle + * @param articleContent + * @param articleContentHtml + * @return + */ Integer insertArticleContent(@Param("idArticle") Integer idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml); + /** + * 更新文章内容 + * @param idArticle + * @param articleContent + * @param articleContentHtml + * @return + */ Integer updateArticleContent(@Param("idArticle") Integer idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml); + /** + * 获取文章正文内容 + * @param idArticle + * @return + */ ArticleContent selectArticleContent(@Param("idArticle") Integer idArticle); + /** + * 获取主题下文章列表 + * @param topicName + * @return + */ List selectArticlesByTopicUri(@Param("topicName") String topicName); + /** + * 获取标签下文章列表 + * @param tagName + * @return + */ List selectArticlesByTagName(@Param("tagName") String tagName); + /** + * 获取用户文章列表 + * @param idUser + * @return + */ List selectUserArticles(@Param("idUser") Integer idUser); + /** + * 删除文章标签 + * @param id + * @return + */ Integer deleteTagArticle(@Param("id") Integer id); + /** + * 获取文章标签列表 + * @param idArticle + * @return + */ List selectTags(@Param("idArticle") Integer idArticle); /** - * + * 更新文章浏览数 * @param id * @param articleViewCount * @return */ Integer updateArticleViewCount(@Param("id") Integer id, @Param("articleViewCount") Integer articleViewCount); + + /** + * 获取草稿列表 + * @param idUser + * @return + */ + List selectDrafts(@Param("idUser") Integer idUser); + + /** + * 删除未使用的文章标签 + * @param idArticleTag + * @return + */ + Integer deleteUnusedArticleTag(@Param("idArticleTag") Integer idArticleTag); } diff --git a/src/main/java/com/rymcu/vertical/mapper/CommentMapper.java b/src/main/java/com/rymcu/vertical/mapper/CommentMapper.java new file mode 100644 index 0000000..21dde41 --- /dev/null +++ b/src/main/java/com/rymcu/vertical/mapper/CommentMapper.java @@ -0,0 +1,43 @@ +package com.rymcu.vertical.mapper; + +import com.rymcu.vertical.core.mapper.Mapper; +import com.rymcu.vertical.dto.Author; +import com.rymcu.vertical.dto.CommentDTO; +import com.rymcu.vertical.entity.Comment; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author ronger + */ +public interface CommentMapper extends Mapper { + /** + * 获取文章评论列表 + * @param idArticle + * @return + */ + List selectArticleComments(@Param("idArticle") Integer idArticle); + + /** + * 查询评论作者 + * @param commentAuthorId + * @return + */ + Author selectAuthor(@Param("commentAuthorId") Integer commentAuthorId); + + /** + * 查询父评论作者 + * @param commentOriginalCommentId + * @return + */ + Author selectCommentOriginalAuthor(@Param("commentOriginalCommentId") Integer commentOriginalCommentId); + + /** + * 更新文章评论分享链接 + * @param idComment + * @param commentSharpUrl + * @return + */ + Integer updateCommentSharpUrl(@Param("idComment") Integer idComment, @Param("commentSharpUrl") String commentSharpUrl); +} diff --git a/src/main/java/com/rymcu/vertical/mapper/TagMapper.java b/src/main/java/com/rymcu/vertical/mapper/TagMapper.java index dcd8d30..f2643a6 100644 --- a/src/main/java/com/rymcu/vertical/mapper/TagMapper.java +++ b/src/main/java/com/rymcu/vertical/mapper/TagMapper.java @@ -1,19 +1,71 @@ package com.rymcu.vertical.mapper; import com.rymcu.vertical.core.mapper.Mapper; +import com.rymcu.vertical.dto.LabelModel; import com.rymcu.vertical.entity.Tag; import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * @author ronger + */ public interface TagMapper extends Mapper { + + /** + * 插入标签文章表(vertical_tag_article)相关信息 + * @param idTag + * @param idArticle + * @return + */ Integer insertTagArticle(@Param("idTag") Integer idTag, @Param("idArticle") Integer idArticle); + /** + * 统计标签使用数(文章) + * @param idTag + * @param idArticle + * @return + */ Integer selectCountTagArticleById(@Param("idTag") Integer idTag, @Param("idArticle") Integer idArticle); + /** + * 获取用户标签数 + * @param idUser + * @param idTag + * @return + */ Integer selectCountUserTagById(@Param("idUser") Integer idUser, @Param("idTag") Integer idTag); + /** + * 插入用户标签信息 + * @param idTag + * @param idUser + * @param type + * @return + */ Integer insertUserTag(@Param("idTag") Integer idTag, @Param("idUser") Integer idUser, @Param("type") Integer type); + /** + * 删除未使用标签 + * @return + */ Integer deleteUnusedTag(); + /** + * 更新标签信息 + * @param idTag + * @param tagUri + * @param tagIconPath + * @param tagStatus + * @param tagDescription + * @param tagReservation + * @return + */ Integer update(@Param("idTag") Integer idTag, @Param("tagUri") String tagUri, @Param("tagIconPath") String tagIconPath, @Param("tagStatus") String tagStatus, @Param("tagDescription") String tagDescription, @Param("tagReservation") String tagReservation); + + /** + * 查询标签列表 + * @return + */ + List selectTagLabels(); }