allow to skip item by created
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user