示例#1
0
func NewItemLog(e event.Event) EventLogger {
	return &itemLog{
		ID:      item.Identifier(e.SubID),
		EventID: e.ID,
		Num:     e.Num,
	}
}
示例#2
0
func (e *Event) BuildItem() (item.Item, error) {
	if !e.IsItem() {
		return item.Item{}, errors.New("build error missmatch event " + string(e.ID))
	}
	return item.ResolveItem(item.Identifier(e.SubID)), nil
}