| package com.example.g8backend.service; |
| |
| import com.example.g8backend.entity.Post; |
| import com.baomidou.mybatisplus.extension.service.IService; |
| import org.springframework.transaction.annotation.Transactional; |
| |
| import java.util.List; |
| |
| public interface IPostService extends IService<Post> { |
| List<Post> getPostsByUserId(Long userId); |
| void createPost(Post post); |
| void createPost(Post post, Long[] tagIds); |
| Post updatePost(Post post); |
| List<Post> getPostsByType(String postType); |
| Long getPostLikeCount(Long postId); |
| void likePost(Long userId, Long postId); |
| void unlikePost(Long userId, Long postId); |
| |
| List<Post> searchPosts(String keyword, List<Long> tagIds, String author); // 更新为支持多个标签 |
| |
| @Transactional |
| void recordViewHistory(Long userId, Long postId); |
| } |