package com.nav.service; import com.nav.common.api.CommonResult; import com.nav.pojo.Comment; import com.nav.pojo.Post; import com.nav.vo.result.LifePostResult; import org.apache.ibatis.annotations.Param; import org.springframework.web.bind.annotation.PathVariable; import java.util.List; /** * 类说明 * post的service接口 * @author zyx * @date 2022/4/28 20:40 */ public interface PostService { /** * 方法说明:查询所有生活须知文章 * @author zyx * @date 2022/4/28 20:40 * @param * @return:com.nav.common.api.CommonResult **/ public CommonResult getLifePostList(long userId); /** * 方法说明:根据生活须知文章id返回文章详情 * @author zyx * @date 2022/4/29 11:09 * @param id:文章id * @return:com.nav.common.api.CommonResult **/ public CommonResult getLifePostById(long id); /** * 方法说明:根据生活须知用户id文章id返回文章详情 * @author zyx * @date 2022/5/3 20:25 * @param userId:用户id * @param postId:文章id * @return:com.nav.common.api.CommonResult **/ public CommonResult getLifePostByUserIdPostId(long userId,long postId); /** * 方法说明:根据文章id更新点赞数 * @author zyx * @date 2022/4/29 11:47 * @param userId:用户id * @param postId:文章id * @return:com.nav.common.api.CommonResult **/ public CommonResult updateLikeCountById(long userId,long postId); /** * 方法说明:根据文章id更新浏览量 * @author zyx * @date 2022/4/29 11:48 * @param id:文章id * @return:com.nav.common.api.CommonResult **/ public CommonResult updateViewCountById(long id); /** * 方法说明:根据关键字模糊搜索生活须知文章 * @author zyx * @date 2022/4/29 12:40 * @param keyword:关键字 * @param userId:用户id * @return:com.nav.common.api.CommonResult **/ public CommonResult getLifePostByKeyword(String keyword,long userId); /** * 方法说明:根据文章id返回全部评论 * @author zyx * @date 2022/4/29 19:56 * @param id:文章id * @return:java.util.List **/ public CommonResult getCommentByPostId(long id); /** * 方法说明:根据标签筛选生活须知文章 * @author zyx * @date 2022/4/30 11:16 * @param tag:标签 * @param userId:用户id * @return:java.util.List **/ public CommonResult getLifePostByTag(String tag,long userId); /** * 方法说明:根据用户id和文章id查找该用户是否点过赞 * @author zyx * @date 2022/4/30 16:11 * @param userId:用户id * @param postId:文章id * @return:int :1点过赞,0没点过赞 **/ public int getLikeById(long userId, long postId); /** * 方法说明:根据用户id和文章id查找该用户是否已收藏 * @author zyx * @date 2022/5/2 22:47 * @param userId * @param postId * @return:int :1已收藏,0未收藏 **/ public int getCollectById(long userId, long postId); /** * 方法说明:根据用户id和文章id减少点赞数 * @author zyx * @date 2022/4/30 16:21 * @param userId:用户id * @param postId:文章id * @return:int :点赞数 **/ public CommonResult updateDownLikeCountById( long userId,long postId); /** * 方法说明:先判断用户是否点过赞,如果点过赞,则取消点赞,否则点赞数加一 * @author zyx * @date 2022/4/30 16:39 * @param userId:用户id * @param postId:文章id * @return:com.nav.common.api.CommonResult **/ public CommonResult updateLikeCount( long userId,long postId); /** * 方法说明:先判断用户是否收藏过,如果已收藏,则取消收藏,否则收藏数加一 * @author zyx * @date 2022/5/1 11:42 * @param userId:用户id * @param postId:文章id * @return:com.nav.common.api.CommonResult **/ public CommonResult updateCollectionCountById(long userId,long postId); /** * 方法说明:用户对某篇文章发表评论 * @author zyx * @date 2022/5/6 21:10 * @param comment * @return:void **/ public void addCommentByPostId(Comment comment); /** * 方法说明:根据用户id,文章id删除文章 * @author zyx * @date 2022/5/14 10:11 * @param userId:用户id * @param postId:文章id **/ public CommonResult deletePostByUserIdPostId(long userId,long postId); /** * 方法说明:根据评论id,用户id删除评论 * @author zyx * @date 2022/5/14 11:17 * @param commentId * @param userId **/ public CommonResult deleteCommentByCommentIdUserId(long commentId,long userId); /** * 方法说明:查询所有娱乐天地文章 * @author zyx * @date 2022/6/5 13:38 * @param userId * @return:com.nav.common.api.CommonResult **/ public CommonResult getEntertainmentPostList(long userId); /** * 方法说明:根据用户id娱乐天地文章id返回文章详情 * @author zyx * @date 2022/6/5 13:48 * @param userId:用户id * @param postId:文章id * @return:com.nav.common.api.CommonResult **/ public CommonResult getEntertainmentPostByUserIdPostId(long userId,long postId); /** * 方法说明:根据标签筛选娱乐天地文章 * @author zyx * @date 2022/6/5 13:57 * @param tag:标签内容 * @param userId:用户id * @return:com.nav.common.api.CommonResult **/ public CommonResult getEntertainmentPostByTag(String tag,long userId); /** * 方法说明:发布帖子 * @author zyx * @date 2022/6/6 21:08 * @param post:帖子封装类,tag:帖子对应标签 * @return:com.nav.common.api.CommonResult **/ public CommonResult addPost(Post post,String tag); }