donate

package
v1.2.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "donate"

Variables

This section is empty.

Functions

This section is empty.

Types

type Donate struct {
	ID       primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	UpdateAt time.Time          `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
	CreateAt time.Time          `bson:"createAt,omitempty" json:"createAt,omitempty"`
	UserId   string             `bson:"userId,omitempty" json:"userId,omitempty"`
	PlanId   string             `bson:"planId,omitempty" json:"planId,omitempty"`
	FishNum  int64              `bson:"fishNum,omitempty" json:"fishNum,omitempty"`
}

type IMongoMapper

type IMongoMapper interface {
	Insert(ctx context.Context, data *Donate) error
	FindOne(ctx context.Context, id string) (*Donate, error)
	Update(ctx context.Context, data *Donate) error
	Delete(ctx context.Context, id string) error
	FindManyAndCountByUserId(ctx context.Context, id string, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Donate, int64, error)
	FindManyByUserId(ctx context.Context, id string, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Donate, error)
	CountByUserId(ctx context.Context, id string) (int64, error)
	FindManyAndCountByPlanId(ctx context.Context, id string, popts *pagination.PaginationOptions) ([]*Donate, int64, error)
	FindManyByPlanId(ctx context.Context, id string, popts *pagination.PaginationOptions) ([]*Donate, error)
	CountByPlanId(ctx context.Context, id string) (int64, error)
	FindOneById(ctx context.Context, planId string, userId string) (*Donate, error)
}

func NewMongoMapper

func NewMongoMapper(config *config.Config) IMongoMapper

type MongoMapper

type MongoMapper struct {
	// contains filtered or unexported fields
}

func (*MongoMapper) CountByPlanId added in v1.2.21

func (m *MongoMapper) CountByPlanId(ctx context.Context, id string) (int64, error)

func (*MongoMapper) CountByUserId added in v1.2.21

func (m *MongoMapper) CountByUserId(ctx context.Context, id string) (int64, error)

func (*MongoMapper) Delete

func (m *MongoMapper) Delete(ctx context.Context, id string) error

func (*MongoMapper) FindManyAndCountByPlanId added in v1.2.21

func (m *MongoMapper) FindManyAndCountByPlanId(ctx context.Context, id string, popts *pagination.PaginationOptions) ([]*Donate, int64, error)

func (*MongoMapper) FindManyAndCountByUserId added in v1.2.21

func (m *MongoMapper) FindManyAndCountByUserId(ctx context.Context, id string, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Donate, int64, error)

func (*MongoMapper) FindManyByPlanId added in v1.2.21

func (m *MongoMapper) FindManyByPlanId(ctx context.Context, id string, popts *pagination.PaginationOptions) ([]*Donate, error)

func (*MongoMapper) FindManyByUserId added in v1.2.21

func (m *MongoMapper) FindManyByUserId(ctx context.Context, id string, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Donate, error)

func (*MongoMapper) FindOne

func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Donate, error)

func (*MongoMapper) FindOneById added in v1.2.21

func (m *MongoMapper) FindOneById(ctx context.Context, planId string, userId string) (*Donate, error)

func (*MongoMapper) Insert

func (m *MongoMapper) Insert(ctx context.Context, data *Donate) error

func (*MongoMapper) Update

func (m *MongoMapper) Update(ctx context.Context, data *Donate) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL