2024-11-07 10:09:13 +00:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import "leafdev.top/Ecosystem/recommender/internal/schema"
|
|
|
|
|
|
|
|
type Post struct {
|
|
|
|
Model
|
|
|
|
|
2024-11-07 18:25:15 +00:00
|
|
|
Title string `json:"title"`
|
|
|
|
Content string `json:"content"`
|
|
|
|
TargetId string `json:"target_id"`
|
|
|
|
ApplicationId schema.EntityId `json:"application_id"`
|
|
|
|
Application *Application `json:"application"`
|
|
|
|
Category *Category `json:"category"`
|
|
|
|
CategoryId *schema.EntityId `json:"category_id"`
|
|
|
|
Processed bool `json:"processed"`
|
2024-11-09 19:49:53 +00:00
|
|
|
Vectorized bool `json:"vectorized"`
|
2024-11-07 10:09:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (u *Post) TableName() string {
|
|
|
|
return "posts"
|
|
|
|
}
|
|
|
|
|
|
|
|
type PostTag struct {
|
|
|
|
Id schema.EntityId `gorm:"primarykey" json:"id"`
|
|
|
|
PostId *schema.EntityId `gorm:"primarykey" json:"post_id"`
|
|
|
|
Post *Post
|
|
|
|
TagId *schema.EntityId `gorm:"primarykey" json:"tag_id"`
|
|
|
|
Tag *Tag
|
|
|
|
}
|
|
|
|
|
|
|
|
func (u *PostTag) TableName() string {
|
|
|
|
return "post_tags"
|
|
|
|
}
|