Documentation ¶
Index ¶
- Constants
- type Donate
- type IMongoMapper
- type MongoMapper
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Donate, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *Donate) error
- func (m *MongoMapper) ListDonateByPlan(ctx context.Context, planId string) ([]*Donate, error)
- func (m *MongoMapper) ListDonateByUser(ctx context.Context, userId string) ([]*Donate, error)
- func (m *MongoMapper) Update(ctx context.Context, data *Donate) error
Constants ¶
View Source
const CollectionName = "donate"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Donate ¶
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) ListDonateByPlan ¶
func (*MongoMapper) ListDonateByUser ¶
Click to show internal directories.
Click to hide internal directories.