Documentation ¶
Index ¶
- Constants
- type Donate
- type IMongoMapper
- type MongoMapper
- func (m *MongoMapper) CountByPlanId(ctx context.Context, id string) (int64, error)
- func (m *MongoMapper) CountByUserId(ctx context.Context, id string) (int64, error)
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindManyAndCountByPlanId(ctx context.Context, id string, popts *pagination.PaginationOptions) ([]*Donate, int64, error)
- func (m *MongoMapper) FindManyAndCountByUserId(ctx context.Context, id string, popts *pagination.PaginationOptions, ...) ([]*Donate, int64, error)
- func (m *MongoMapper) FindManyByPlanId(ctx context.Context, id string, popts *pagination.PaginationOptions) ([]*Donate, error)
- func (m *MongoMapper) FindManyByUserId(ctx context.Context, id string, popts *pagination.PaginationOptions, ...) ([]*Donate, error)
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Donate, error)
- func (m *MongoMapper) FindOneById(ctx context.Context, planId string, userId string) (*Donate, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *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 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 (*MongoMapper) CountByUserId ¶ added in v1.2.21
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) FindOneById ¶ added in v1.2.21
Click to show internal directories.
Click to hide internal directories.