PostService.java 3.4 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.vo.result.LifePostResult;
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
6
import org.apache.ibatis.annotations.Param;
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

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

    /**
     * 方法说明:根据生活须知文章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 已提交
35 36 37 38 39

    /**
     * 方法说明:根据文章id更新点赞数
     * @author zyx
     * @date 2022/4/29 11:47
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
40 41
     * @param userId:用户id
     * @param postId:文章id
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
42 43
     * @return:com.nav.common.api.CommonResult
    **/
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
44
    public CommonResult updateLikeCountById(long userId,long postId);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
45 46 47 48 49 50 51 52 53 54


    /**
     * 方法说明:根据文章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 已提交
55 56 57 58 59

    /**
     * 方法说明:根据关键字模糊搜索生活须知文章
     * @author zyx
     * @date 2022/4/29 12:40
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
60
     * @param keyword:关键字
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
61 62
     * @return:com.nav.common.api.CommonResult
    **/
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
63
    public CommonResult getLifePostByKeyword(String keyword);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
64 65 66 67 68 69 70 71

    /**
     * 方法说明:根据文章id返回全部评论
     * @author zyx
     * @date 2022/4/29 19:56
     * @param id:文章id
     * @return:java.util.List<com.nav.pojo.Comment>
    **/
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
72
    public CommonResult getCommentByPostId(long id);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
73 74 75 76 77 78 79 80 81

    /**
     * 方法说明:根据标签筛选生活须知文章
     * @author zyx
     * @date 2022/4/30 11:16
     * @param tag:标签
     * @return:java.util.List<com.nav.vo.result.LifePostResult>
    **/
    public CommonResult getLifePostByTag(String tag);
LKJKJOIUIU's avatar
LKJKJOIUIU 已提交
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

    /**
     * 方法说明:根据用户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/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 已提交
112 113 114 115 116 117 118 119 120 121

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