Implemented first pass of character and inventory services

This commit is contained in:
Brandon Watson
2023-08-14 19:22:40 -05:00
parent a9eed6f284
commit 6799b59f9c
9 changed files with 232 additions and 57 deletions

View File

@ -26,7 +26,7 @@ func (s *itemsrvc) GetItem(ctx context.Context, p *item.GetItemPayload) (res *it
itemToGet := s.items[*p.ID]
if itemToGet == nil {
s.logger.Printf("itemToGet with id %d not found", p.ID)
s.logger.Printf("item with id %d not found", &p.ID)
return nil, errors.New("item not found")
}
res = s.items[*p.ID]
@ -59,7 +59,7 @@ func (s *itemsrvc) UpdateItem(ctx context.Context, p *item.Item) (res *item.Item
s.logger.Print("itemToGet.updateItem")
itemToUpdate := s.items[*p.ID]
if itemToUpdate == nil {
s.logger.Printf("itemToGet with id %d not found", p.ID)
s.logger.Printf("item with id %d not found", &p.ID)
return nil, errors.New("item not found")
}
s.items[*p.ID] = p
@ -73,7 +73,7 @@ func (s *itemsrvc) DeleteItem(ctx context.Context, p *item.DeleteItemPayload) (e
s.logger.Print("item.deleteItem")
itemToDelete := s.items[*p.ID]
if itemToDelete == nil {
s.logger.Printf("itemToGet with id %d not found", p.ID)
s.logger.Printf("item with id %d not found", &p.ID)
return errors.New("item not found")
}