donate

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: GPL-2.0 Imports: 8 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
	ListDonateByPlan(ctx context.Context, planId string) ([]*Donate, error)
	ListDonateByUser(ctx context.Context, userId string) ([]*Donate, error)
}

func NewMongoMapper

func NewMongoMapper(config *config.Config) IMongoMapper

type MongoMapper

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

func (*MongoMapper) Delete

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

func (*MongoMapper) FindOne

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

func (*MongoMapper) Insert

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

func (*MongoMapper) ListDonateByPlan

func (m *MongoMapper) ListDonateByPlan(ctx context.Context, planId string) ([]*Donate, error)

func (*MongoMapper) ListDonateByUser

func (m *MongoMapper) ListDonateByUser(ctx context.Context, userId string) ([]*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