PostService.java 6.0 KB
Newer Older
1 2
package com.nav.service;

LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
3
import com.nav.common.api.CommonResult;
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
4
import com.nav.pojo.Comment;
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
5
import com.nav.pojo.Post;
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
6
import com.nav.vo.result.LifePostResult;
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
7
import org.apache.ibatis.annotations.Param;
8
import org.springframework.web.bind.annotation.PathVariable;
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

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
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
25
     * @return:com.nav.common.api.CommonResult
26
    **/
27
    public CommonResult getLifePostList(long userId);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
28 29 30 31 32 33 34 35 36

    /**
     * 方法说明:根据生活须知文章id返回文章详情
     * @author zyx
     * @date 2022/4/29 11:09
     * @param id:文章id
     * @return:com.nav.common.api.CommonResult
    **/
    public CommonResult getLifePostById(long id);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
37

38 39 40 41 42 43 44 45 46 47
    /**
     * 方法说明:根据生活须知用户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);

LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
48 49 50 51
    /**
     * 方法说明:根据文章id更新点赞数
     * @author zyx
     * @date 2022/4/29 11:47
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
52 53
     * @param userId:用户id
     * @param postId:文章id
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
54 55
     * @return:com.nav.common.api.CommonResult
    **/
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
56
    public CommonResult updateLikeCountById(long userId,long postId);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
57 58 59 60 61 62 63 64 65 66


    /**
     * 方法说明:根据文章id更新浏览量
     * @author zyx
     * @date 2022/4/29 11:48
     * @param id:文章id
     * @return:com.nav.common.api.CommonResult
    **/
    public CommonResult updateViewCountById(long id);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
67 68 69 70 71

    /**
     * 方法说明:根据关键字模糊搜索生活须知文章
     * @author zyx
     * @date 2022/4/29 12:40
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
72
     * @param keyword:关键字
73
     * @param userId:用户id
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
74 75
     * @return:com.nav.common.api.CommonResult
    **/
76
    public CommonResult getLifePostByKeyword(String keyword,long userId);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
77 78 79 80 81 82 83 84

    /**
     * 方法说明:根据文章id返回全部评论
     * @author zyx
     * @date 2022/4/29 19:56
     * @param id:文章id
     * @return:java.util.List<com.nav.pojo.Comment>
    **/
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
85
    public CommonResult getCommentByPostId(long id);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
86 87 88 89 90 91

    /**
     * 方法说明:根据标签筛选生活须知文章
     * @author zyx
     * @date 2022/4/30 11:16
     * @param tag:标签
92
     * @param userId:用户id
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
93 94
     * @return:java.util.List<com.nav.vo.result.LifePostResult>
    **/
95
    public CommonResult getLifePostByTag(String tag,long userId);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
96 97 98 99 100 101 102 103 104 105 106

    /**
     * 方法说明:根据用户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);

107 108 109 110 111 112 113 114 115 116
    /**
     * 方法说明:根据用户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);

LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
    /**
     * 方法说明:根据用户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);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
136 137 138 139 140 141 142 143 144 145

    /**
     * 方法说明:先判断用户是否收藏过,如果已收藏,则取消收藏,否则收藏数加一
     * @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);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
146

LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
147 148 149 150 151 152 153 154
    /**
     * 方法说明:用户对某篇文章发表评论
     * @author zyx
     * @date 2022/5/6 21:10
     * @param comment
     * @return:void
     **/
    public void addCommentByPostId(Comment comment);
155

156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
    /**
     * 方法说明:根据用户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);


175 176 177
    /**
     * 方法说明:查询所有娱乐天地文章
     * @author zyx
178
     * @date 2022/6/5 13:38
179 180
     * @param userId
     * @return:com.nav.common.api.CommonResult
181
     **/
182 183 184 185 186
    public CommonResult getEntertainmentPostList(long userId);

    /**
     * 方法说明:根据用户id娱乐天地文章id返回文章详情
     * @author zyx
187
     * @date 2022/6/5 13:48
188 189 190
     * @param userId:用户id
     * @param postId:文章id
     * @return:com.nav.common.api.CommonResult
191
     **/
192 193 194 195 196
    public CommonResult getEntertainmentPostByUserIdPostId(long userId,long postId);

    /**
     * 方法说明:根据标签筛选娱乐天地文章
     * @author zyx
197
     * @date 2022/6/5 13:57
198 199 200
     * @param tag:标签内容
     * @param userId:用户id
     * @return:com.nav.common.api.CommonResult
201
     **/
202
    public CommonResult getEntertainmentPostByTag(String tag,long userId);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
203 204 205 206 207 208 209 210 211

    /**
     * 方法说明:发布帖子
     * @author zyx
     * @date 2022/6/6 21:08
     * @param post:帖子封装类,tag:帖子对应标签
     * @return:com.nav.common.api.CommonResult
     **/
    public CommonResult addPost(Post post,String tag);
212
}