Older/WebApplication/model/Tag.h
amass b6e0681489
All checks were successful
Deploy / PullDocker (push) Successful in 4s
Deploy / Build (push) Successful in 2m8s
Deploy Docker Images / Docusaurus build and Server deploy (push) Successful in 13s
add code.
2024-11-02 00:30:14 +08:00

26 lines
497 B
C++

#ifndef __TAG_H__
#define __TAG_H__
#include <Wt/Dbo/Types.h>
class Post;
using Posts= Wt::Dbo::collection<Wt::Dbo::ptr<Post>> ;
class Tag {
public:
Tag() = default;
Tag(const std::string &aName) : name(aName) {
}
template <class Action>
void persist(Action &a) {
Wt::Dbo::field(a, name, "name");
Wt::Dbo::hasMany(a, posts, Wt::Dbo::ManyToMany, "post_tag");
}
std::string name;
Posts posts;
};
DBO_EXTERN_TEMPLATES(Tag)
#endif // __TAG_H__