Documentation ¶
Index ¶
- Constants
- func MakeBsonFilter(options *FilterOptions) bson.M
- type EsMapper
- type FilterOptions
- type IEsMapper
- type IOrderMongoMapper
- type MongoFilter
- type MongoMapper
- func (m *MongoMapper) Count(ctx context.Context, filter *FilterOptions) (int64, error)
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindMany(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Order, error)
- func (m *MongoMapper) FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Order, int64, error)
- func (m *MongoMapper) FindOne(ctx context.Context, fopts *FilterOptions) (*Order, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *Order) error
- func (m *MongoMapper) Update(ctx context.Context, data *Order) error
- type Order
Constants ¶
View Source
const CollectionName = "order"
Variables ¶
This section is empty.
Functions ¶
func MakeBsonFilter ¶
func MakeBsonFilter(options *FilterOptions) bson.M
Types ¶
type EsMapper ¶
type EsMapper struct {
// contains filtered or unexported fields
}
func (*EsMapper) CountWithQuery ¶
func (*EsMapper) Search ¶
func (m *EsMapper) Search(ctx context.Context, query []types.Query, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*Order, int64, error)
type FilterOptions ¶
type IEsMapper ¶
type IEsMapper interface { Search(ctx context.Context, query []types.Query, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*Order, int64, error) CountWithQuery(ctx context.Context, query []types.Query, fopts *FilterOptions) (int64, error) }
func NewEsMapper ¶
type IOrderMongoMapper ¶
type IOrderMongoMapper interface { Insert(ctx context.Context, data *Order) error FindOne(ctx context.Context, fopts *FilterOptions) (*Order, error) Update(ctx context.Context, data *Order) error Delete(ctx context.Context, id string) error FindMany(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Order, error) Count(ctx context.Context, fopts *FilterOptions) (int64, error) FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Order, int64, error) }
func NewMongoMapper ¶
func NewMongoMapper(config *config.Config) IOrderMongoMapper
type MongoFilter ¶
type MongoFilter struct { *FilterOptions // contains filtered or unexported fields }
func (*MongoFilter) CheckOnlyOrderId ¶
func (f *MongoFilter) CheckOnlyOrderId()
func (*MongoFilter) CheckOnlyOrderIds ¶
func (f *MongoFilter) CheckOnlyOrderIds()
func (*MongoFilter) CheckOnlyProductId ¶
func (f *MongoFilter) CheckOnlyProductId()
func (*MongoFilter) CheckOnlyStatus ¶
func (f *MongoFilter) CheckOnlyStatus()
func (*MongoFilter) CheckOnlyUserId ¶
func (f *MongoFilter) CheckOnlyUserId()
type MongoMapper ¶
type MongoMapper struct {
// contains filtered or unexported fields
}
func (*MongoMapper) Count ¶
func (m *MongoMapper) Count(ctx context.Context, filter *FilterOptions) (int64, error)
func (*MongoMapper) FindMany ¶
func (m *MongoMapper) FindMany(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Order, error)
func (*MongoMapper) FindManyAndCount ¶
func (m *MongoMapper) FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Order, int64, error)
func (*MongoMapper) FindOne ¶
func (m *MongoMapper) FindOne(ctx context.Context, fopts *FilterOptions) (*Order, error)
type Order ¶
type Order struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` UserId string `json:"userId,omitempty" bson:"userId,omitempty"` ProductId string `bson:"productId,omitempty" json:"productId,omitempty"` Status int64 `json:"status,omitempty" bson:"status,omitempty"` SumPrice int64 `json:"sumPrice,omitempty" bson:"sumPrice,omitempty"` ProductName string `json:"productName,omitempty" bson:"productName,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` Score_ float64 `bson:"_score,omitempty" json:"_score,omitempty"` }
Click to show internal directories.
Click to hide internal directories.