allow to skip item by created

This commit is contained in:
Aleksandr Trushkin
2024-02-04 22:13:39 +03:00
parent 15d4cdb047
commit 3c68c0b2fd
7 changed files with 51 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt"
"strings"
"sync"
"time"
"git.loyso.art/frx/eway/internal/entity"
@ -98,6 +99,7 @@ func makeDomainGoodItem(builder *flatbuffers.Builder, in entity.GoodsItem) flatb
GoodItemAddCart(builder, int64(in.Cart))
GoodItemAddStock(builder, int16(in.Stock))
GoodItemAddParameters(builder, parameters)
GoodItemAddCreatedAt(builder, in.CreatedAt.Unix())
return GoodItemEnd(builder)
}
@ -134,6 +136,11 @@ func ParseGoodsItem(data []byte) (item entity.GoodsItem, err error) {
}
}
createdAt := itemFBS.CreatedAt()
if createdAt > 0 {
item.CreatedAt = time.Unix(createdAt, 0)
}
return item, nil
}