package module

import (
	"fmt"
)

type ItemDao interface {
	//GetItemFeatures(items []*Item, context *context.RecommendContext) []*Item
}

func NewItemDao(name string) ItemDao {
	dao, ok := itemDaoAdapters[name]
	if !ok {
		panic(fmt.Sprintf("ItemDao:name:%s not found", name))
	}
	return dao
}

const ()

var itemDaoAdapters = make(map[string]ItemDao)

func RegisterItemDao(name string, i ItemDao) {
	if i == nil {
		panic("UserDao:UserDao is nil, name:" + name)
	}
	itemDaoAdapters[name] = i
}
