72 lines
1.7 KiB
Java
72 lines
1.7 KiB
Java
package com.yupi.springbootinit.service;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.yupi.springbootinit.model.dto.post.PostQueryRequest;
|
|
import com.yupi.springbootinit.model.entity.Post;
|
|
import com.yupi.springbootinit.model.vo.PostVO;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 帖子服务
|
|
*
|
|
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
|
|
* @from <a href="https://yupi.icu">编程导航知识星球</a>
|
|
*/
|
|
public interface PostService extends IService<Post> {
|
|
|
|
/**
|
|
* 校验
|
|
*
|
|
* @param post
|
|
* @param add
|
|
*/
|
|
void validPost(Post post, boolean add);
|
|
|
|
/**
|
|
* 获取查询条件
|
|
*
|
|
* @param postQueryRequest
|
|
* @return
|
|
*/
|
|
QueryWrapper<Post> getQueryWrapper(PostQueryRequest postQueryRequest);
|
|
|
|
/**
|
|
* 从 ES 查询
|
|
*
|
|
* @param postQueryRequest
|
|
* @return
|
|
*/
|
|
Page<Post> searchFromEs(PostQueryRequest postQueryRequest);
|
|
|
|
/**
|
|
* 获取帖子封装
|
|
*
|
|
* @param post
|
|
* @param request
|
|
* @return
|
|
*/
|
|
PostVO getPostVO(Post post, HttpServletRequest request);
|
|
|
|
/**
|
|
* 分页获取帖子封装
|
|
*
|
|
* @param postPage
|
|
* @param request
|
|
* @return
|
|
*/
|
|
Page<PostVO> getPostVOPage(Page<Post> postPage, HttpServletRequest request);
|
|
|
|
/**
|
|
* 获取帖子封装列表
|
|
*
|
|
* @param postList
|
|
* @param request
|
|
* @return
|
|
*/
|
|
List<PostVO> getPostVOList(List<Post> postList, HttpServletRequest request);
|
|
|
|
}
|