Documentation ¶
Index ¶
- Constants
- func MakeBsonFilter(options *FilterOptions) bson.M
- type Coupon
- type EsMapper
- type FilterOptions
- type ICouponMongoMapper
- type IEsMapper
- 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, ...) ([]*Coupon, error)
- func (m *MongoMapper) FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Coupon, int64, error)
- func (m *MongoMapper) FindOne(ctx context.Context, fopts *FilterOptions) (*Coupon, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *Coupon) error
- func (m *MongoMapper) Update(ctx context.Context, data *Coupon) error
Constants ¶
View Source
const CollectionName = "coupon"
Variables ¶
This section is empty.
Functions ¶
func MakeBsonFilter ¶
func MakeBsonFilter(options *FilterOptions) bson.M
Types ¶
type Coupon ¶
type Coupon struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` UserId string `json:"userId,omitempty" bson:"userId,omitempty"` Name string `bson:"name,omitempty" json:"name,omitempty"` Status int64 `json:"status,omitempty" bson:"status,omitempty"` Description string `bson:"description,omitempty" json:"description,omitempty"` ExpireTime int64 `json:"expireTime,omitempty" bson:"expireTime,omitempty"` Type *int64 `json:"type,omitempty" bson:"type,omitempty"` LowSumPrice *int64 `json:"lowSumPrice,omitempty" bson:"lowSumPrice,omitempty"` ProductType *int64 `json:"productType,omitempty" bson:"productType,omitempty"` Discount *int64 `json:"discount,omitempty" bson:"discount,omitempty"` DiscountPrice *int64 `json:"discountPrice,omitempty" bson:"discountPrice,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` Score_ float64 `bson:"_score,omitempty" json:"_score,omitempty"` }
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) ([]*Coupon, int64, error)
type FilterOptions ¶
type ICouponMongoMapper ¶
type ICouponMongoMapper interface { Insert(ctx context.Context, data *Coupon) error FindOne(ctx context.Context, fopts *FilterOptions) (*Coupon, error) Update(ctx context.Context, data *Coupon) error Delete(ctx context.Context, id string) error FindMany(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Coupon, error) Count(ctx context.Context, fopts *FilterOptions) (int64, error) FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Coupon, int64, error) }
func NewMongoMapper ¶
func NewMongoMapper(config *config.Config) ICouponMongoMapper
type IEsMapper ¶
type IEsMapper interface { Search(ctx context.Context, query []types.Query, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*Coupon, int64, error) CountWithQuery(ctx context.Context, query []types.Query, fopts *FilterOptions) (int64, error) }
func NewEsMapper ¶
type MongoFilter ¶
type MongoFilter struct { *FilterOptions // contains filtered or unexported fields }
func (*MongoFilter) CheckOnlyCouponId ¶
func (f *MongoFilter) CheckOnlyCouponId()
func (*MongoFilter) CheckOnlyCouponIds ¶
func (f *MongoFilter) CheckOnlyCouponIds()
func (*MongoFilter) CheckOnlyStatus ¶
func (f *MongoFilter) CheckOnlyStatus()
func (*MongoFilter) CheckOnlyTyee ¶
func (f *MongoFilter) CheckOnlyTyee()
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) ([]*Coupon, error)
func (*MongoMapper) FindManyAndCount ¶
func (m *MongoMapper) FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Coupon, int64, error)
func (*MongoMapper) FindOne ¶
func (m *MongoMapper) FindOne(ctx context.Context, fopts *FilterOptions) (*Coupon, error)
Click to show internal directories.
Click to hide internal directories.