recommender/internal/entity/User.go

34 lines
760 B
Go
Raw Normal View History

2024-11-06 10:47:56 +00:00
package entity
2024-11-07 10:09:13 +00:00
import "leafdev.top/Ecosystem/recommender/internal/schema"
2024-11-06 10:47:56 +00:00
type User struct {
2024-11-07 10:09:13 +00:00
Id schema.EntityId `gorm:"primarykey" json:"id"`
Title string `json:"name"`
2024-11-06 10:47:56 +00:00
}
func (u *User) TableName() string {
2024-11-07 10:09:13 +00:00
return "users"
}
type UserLike struct {
UserId schema.UserId `gorm:"primarykey" json:"user_id"`
PostId schema.EntityId `gorm:"primarykey" json:"post_id"`
Type schema.UserLikeType `json:"type"`
}
func (u *UserLike) TableName() string {
return "user_likes"
}
type UserTagScore struct {
UserId schema.UserId `gorm:"primarykey" json:"user_id"`
TagId schema.EntityId `gorm:"primarykey" json:"tag_id"`
Tag *Tag
Score int `json:"score"`
}
func (u *UserTagScore) TableName() string {
return "user_tag_scores"
2024-11-06 10:47:56 +00:00
}