Add implicit implementation of db.UserIdentifiable for Card

This commit is contained in:
qowevisa 2024-10-31 10:09:38 +02:00
parent 506586a187
commit db53f2a486

View File

@ -17,6 +17,21 @@ type Card struct {
User *User User *User
} }
// Implements db.UserIdentifiable:1
func (c Card) GetID() uint {
return c.ID
}
// Implements db.UserIdentifiable:2
func (c Card) GetUserID() uint {
return c.UserID
}
// Implements db.UserIdentifiable:3
func (c *Card) SetUserID(id uint) {
c.UserID = id
}
var ( var (
ERROR_CARD_NAME_EMPTY = errors.New("Card's name can't be empty") ERROR_CARD_NAME_EMPTY = errors.New("Card's name can't be empty")
ERROR_CARD_NAME_NOT_UNIQUE = errors.New("Card's name have to be unique for user") ERROR_CARD_NAME_NOT_UNIQUE = errors.New("Card's name have to be unique for user")