创作中心模块包含首页展示、个人中心、帖子审核。
“首页展示”支持广告轮播展示、推广帖子优先展示、分页显示所有帖子、导航栏便捷标签筛选帖子、全局标题模糊搜索帖子、点击帖子“查看更多”进入帖子详情页。帖子详情页展示帖子封面图片、作者时间、详细内容(可以插入种子链接对种子进行介绍与推广)等基本信息、对帖子点赞收藏举报评论回复、查看相关推荐帖子。相关推荐会推荐当前帖子作者的其他帖子(最多推荐5篇),还会推荐具有相似标签的其他帖子,两者总共最多推荐9篇帖子。
“个人中心”包含“我的中心”和“我的收藏”。
“我的中心”中可以管理已经成功发布的帖子(编辑、删除帖子),还可以发布新帖子。发布新帖子时除了填写帖子基本信息以外,帖子标签支持下拉多项选择,用户还可以选择帖子推广项目并进行支付。设置了多种推广项目,包含广告轮播推广、帖子置顶展示、限时优先展示、分类页首条展示。系统后台执行自动定时任务,每小时对帖子的推广时效性进行检查,如超出推广时限,则取消帖子的推广显示特权。用户点击发布帖子后帖子处于待审核状态,需要管理员审核通过才能正常发布在首页展示页面。编辑帖子时用户可以追加帖子推广,但如果帖子处于推广状态,则禁止修改推广项目。
“我的收藏”中可以便捷查看所有已收藏的帖子。
“帖子审核”包含“帖子发布管理”和“帖子举报管理”。“帖子审核”板块具有权限管理,只有管理员界面能够进入。
“帖子发布管理”对所有待审核帖子进行处理,支持预览待审核帖子详细内容,批准通过和拒绝通过选项。
“帖子举报管理”对所有用户的举报请求进行人工审核,如果举报内容属实,则将帖子下架处理,如果举报内容不属实,驳回举报请求。所有举报请求的处理结果均留存显示,方便后续再次审查。+ bugfix
Change-Id: Iafa37f603aed3337484a3fc96d1cc70b83e8df0c
diff --git a/ruoyi-admin/src/main/resources/mapper/post/PostMapper.xml b/ruoyi-admin/src/main/resources/mapper/post/PostMapper.xml
new file mode 100644
index 0000000..5254e6f
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/mapper/post/PostMapper.xml
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.controller.post.mapper.PostContentMapper">
+
+ <resultMap type="Post" id="PostResult">
+ <id property="postId" column="post_id" />
+ <result property="title" column="title" />
+ <result property="content" column="content" />
+ <result property="summary" column="summary" />
+ <result property="coverImage" column="cover_image" />
+ <result property="authorId" column="author_id" />
+ <result property="author" column="author" />
+ <result property="views" column="views" />
+ <result property="comments" column="comments" />
+ <result property="favorites" column="favorites" />
+ <result property="likes" column="likes" />
+ <result property="status" column="status" />
+ <result property="publishTime" column="publish_time" />
+ <result property="tags" column="tags" />
+ <result property="promotionPlanId" column="promotion_plan_id"/>
+ <result property="createBy" column="create_by" />
+ <result property="createTime" column="create_time" />
+ <result property="updateBy" column="update_by" />
+ <result property="updateTime" column="update_time" />
+ <result property="remark" column="remark" />
+ </resultMap>
+
+ <sql id="selectPostVo">
+ select post_id, title, content, summary, cover_image, author_id, author, views, comments, favorites, likes,
+ status, publish_time, tags, promotion_plan_id, create_by, create_time, update_by, update_time, remark
+ from post
+ </sql>
+
+ <select id="selectPostList" parameterType="Post" resultMap="PostResult">
+ <include refid="selectPostVo"/>
+ <where>
+ <if test="title != null and title != ''">
+ AND title like concat('%', #{title}, '%')
+ </if>
+ <if test="author != null and author != ''">
+ AND author like concat('%', #{author}, '%')
+ </if>
+ <if test="status != null and status != ''">
+ AND status = #{status}
+ </if>
+ <if test="tags != null and tags != ''">
+ AND tags like concat('%', #{tags}, '%')
+ </if>
+ <if test="authorId != null">
+ AND author_id = #{authorId}
+ </if>
+ </where>
+ order by
+ case when promotion_plan_id is not null then 0 else 1 end,
+ create_time desc
+ </select>
+
+ <select id="selectPostById" parameterType="Long" resultMap="PostResult">
+ <include refid="selectPostVo"/>
+ where post_id = #{postId}
+ </select>
+
+ <select id="selectAuthorOtherPosts" resultMap="PostResult">
+ <include refid="selectPostVo"/>
+ where author_id = #{authorId} and post_id != #{postId} and status = '1'
+ order by create_time desc
+ limit #{limit}
+ </select>
+
+ <select id="selectSimilarTagsPosts" resultMap="PostResult">
+ <include refid="selectPostVo"/>
+ <where>
+ post_id != #{postId} and status = '1'
+ <if test="tags != null and tags != ''">
+ AND tags like concat('%', #{tags}, '%')
+ </if>
+ </where>
+ order by create_time desc
+ limit #{limit}
+ </select>
+
+ <insert id="insertPost" parameterType="Post" useGeneratedKeys="true" keyProperty="postId">
+ insert into post (
+ title,
+ content,
+ summary,
+ cover_image,
+ author_id,
+ author,
+ views,
+ comments,
+ favorites,
+ likes,
+ status,
+ publish_time,
+ tags,
+ promotion_plan_id,
+ create_by,
+ create_time,
+ update_by,
+ update_time,
+ remark
+ ) values (
+ #{title},
+ #{content},
+ #{summary},
+ #{coverImage},
+ #{authorId},
+ #{author},
+ #{views},
+ #{comments},
+ #{favorites},
+ #{likes},
+ #{status},
+ #{publishTime},
+ #{tags},
+ #{promotionPlanId},
+ #{createBy},
+ now(),
+ #{updateBy},
+ now(),
+ #{remark}
+ )
+ </insert>
+
+ <update id="updatePost" parameterType="Post">
+ update post
+ <set>
+ <if test="title != null and title != ''">title = #{title},</if>
+ <if test="content != null">content = #{content},</if>
+ <if test="summary != null">summary = #{summary},</if>
+ <if test="coverImage != null">cover_image = #{coverImage},</if>
+ <if test="status != null and status != ''">status = #{status},</if>
+ <if test="tags != null">tags = #{tags},</if>
+ <if test="promotionPlanId != null">promotion_plan_id = #{promotionPlanId},</if>
+ <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ update_time = now(),
+ <if test="remark != null">remark = #{remark},</if>
+ </set>
+ where post_id = #{postId}
+ </update>
+
+ <delete id="deletePostById" parameterType="Long">
+ delete from post where post_id = #{postId}
+ </delete>
+
+ <delete id="deletePostByIds" parameterType="Long">
+ delete from post where post_id in
+ <foreach collection="array" item="postId" open="(" separator="," close=")">
+ #{postId}
+ </foreach>
+ </delete>
+
+ <update id="updatePostViews" parameterType="Long">
+ update post set views = views + 1 where post_id = #{postId}
+ </update>
+
+ <update id="updatePostComments" parameterType="Post">
+ update post set comments = comments + #{comments} where post_id = #{postId}
+ </update>
+
+ <update id="updatePostFavorites" parameterType="Post">
+ update post set favorites = favorites + #{favorites} where post_id = #{postId}
+ </update>
+
+ <update id="updatePostLikes" parameterType="Post">
+ update post set likes = likes + #{likes} where post_id = #{postId}
+ </update>
+
+</mapper>
\ No newline at end of file