From 3b3a8b13d62d0e9fbaa3cb18c445c772b49d02a7 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Mon, 18 Nov 2024 09:51:46 +0200 Subject: [PATCH] Add implementation for db.UserIdentifiable for Item --- db/item.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/db/item.go b/db/item.go index f212000..cc5a4dd 100644 --- a/db/item.go +++ b/db/item.go @@ -22,6 +22,23 @@ type Item struct { // TypeID uint Type *Type + UserID uint + User *User +} + +// Implements db.UserIdentifiable:1 +func (i Item) GetID() uint { + return i.ID +} + +// Implements db.UserIdentifiable:2 +func (i Item) GetUserID() uint { + return i.UserID +} + +// Implements db.UserIdentifiable:3 +func (i *Item) SetUserID(id uint) { + i.UserID = id } func GetItem(id uint, preloadPrices bool) (*Item, error) {