refactor: Refactor UserFavorites model to UserFavorite for clarity and consistency
- Rename `UserFavorites` struct to `UserFavorite` - Update the `TableName` method to reflect the new struct name
This commit is contained in:
parent
3e13046706
commit
b6c037cb22
@ -1,16 +1,13 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import "time"
|
type UserFavorite struct {
|
||||||
|
|
||||||
type UserFavorites struct {
|
|
||||||
BaseModel[UserFavoriteID]
|
BaseModel[UserFavoriteID]
|
||||||
UserID string `json:"user_id"`
|
UserID string `json:"user_id"`
|
||||||
PostID string `json:"post_id"`
|
PostID string `json:"post_id"`
|
||||||
UserSourceID UserSourceID `json:"user_source_id"`
|
UserSourceID UserSourceID `json:"user_source_id"`
|
||||||
UserSource UserSource `json:"-" gorm:"foreignKey:ID;references:UserSourceID"`
|
UserSource UserSource `json:"-" gorm:"foreignKey:ID;references:UserSourceID"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (UserFavorites) TableName() string {
|
func (UserFavorite) TableName() string {
|
||||||
return "UserFavorites"
|
return "UserFavorites"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user