From faa2bf7a9ef63fc2d2e84cbab41e6aa6f4892dd9 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Thu, 31 Oct 2024 23:05:38 +0200 Subject: [PATCH] Add implementation for db.UserIdentifiable for Category --- db/category.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/db/category.go b/db/category.go index 9b73696..2b97e92 100644 --- a/db/category.go +++ b/db/category.go @@ -16,6 +16,21 @@ type Category struct { User *User } +// Implements db.UserIdentifiable:1 +func (c Category) GetID() uint { + return c.ID +} + +// Implements db.UserIdentifiable:2 +func (c Category) GetUserID() uint { + return c.UserID +} + +// Implements db.UserIdentifiable:3 +func (c *Category) SetUserID(id uint) { + c.UserID = id +} + var ( ERROR_CATEGORY_PARENT_NOT_FOUND = errors.New("Can't find Category with ParentID for user") ERROR_CATEGORY_NAME_NOT_UNIQUE = errors.New("Name for Category have to be unique for user")