From db53f2a4862a1ff25a9462d5376c3160539c666a Mon Sep 17 00:00:00 2001 From: qowevisa Date: Thu, 31 Oct 2024 10:09:38 +0200 Subject: [PATCH] Add implicit implementation of db.UserIdentifiable for Card --- db/card.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/db/card.go b/db/card.go index e4490fb..1287ab5 100644 --- a/db/card.go +++ b/db/card.go @@ -17,6 +17,21 @@ type Card struct { 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 ( 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")