You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
901 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include"PostDAO.h"
#include"UserDAO.h"
class PostService
{
private:
PostDAO postDAO_; //DAO数据操作层
bool UserExist(int _userId); //检查用户存在
std::vector<Post> HandleCheckPostsByUserId(int _userId); //根据userId查看某人帖子
public:
PostService(const PostDAO& _postDAO); //构造函数
PostService()=default; //构造函数
~PostService()=default; //析构函数
//发表贴子发表后Post所存贴子内容丢失返回贴子id/-1未知错误
int HandlePublishPost(std::unique_ptr<std::string> _content,int _userId);
bool HandleDeletePost(int _postId); //删除贴子
std::vector<Post> HandleCheckMyPosts(int _userId); //查看用户自己的贴子
};