blob: a349b590818ba63694af201d06fa8e37a70dcce1 [file] [log] [blame]
wuchimedese5722e32025-04-13 17:38:50 +08001package com.example.g8backend.service;
2
3import com.example.g8backend.entity.Post;
4import com.baomidou.mybatisplus.extension.service.IService;
夜雨声烦f4b8b6f2025-04-24 00:58:36 +08005import org.springframework.transaction.annotation.Transactional;
wuchimedes5a842b22025-04-21 22:01:39 +08006
wuchimedese5722e32025-04-13 17:38:50 +08007import java.util.List;
8
9public interface IPostService extends IService<Post> {
10 List<Post> getPostsByUserId(Long userId);
wuchimedes5a842b22025-04-21 22:01:39 +080011 void createPost(Post post);
12 void createPost(Post post, Long[] tagIds);
223010711f457dc2025-04-15 17:35:55 +080013 Post updatePost(Post post);
14 List<Post> getPostsByType(String postType);
15 Long getPostLikeCount(Long postId);
16 void likePost(Long userId, Long postId);
17 void unlikePost(Long userId, Long postId);
夜雨声烦4527a722025-04-23 17:04:25 +080018
19 List<Post> searchPosts(String keyword, List<Long> tagIds, String author); // 更新为支持多个标签
夜雨声烦f4b8b6f2025-04-24 00:58:36 +080020
21 @Transactional
22 void recordViewHistory(Long userId, Long postId);
wuchimedese5722e32025-04-13 17:38:50 +080023}