Documentation
¶
Index ¶
- Constants
- type IMongoMapper
- type Interface
- type MongoMapper
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindAndCountByUserId(ctx context.Context, userId string, p *basic.PaginationOptions) ([]*Interface, int64, error)
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Interface, error)
- func (m *MongoMapper) FindOneByBaseInfIdAndUserId(ctx context.Context, baseInfId string, userId string) (*Interface, error)
- func (m *MongoMapper) Insert(ctx context.Context, i *Interface) (string, error)
- func (m *MongoMapper) Update(ctx context.Context, i *Interface) error
Constants ¶
View Source
const (
CollectionName = "full"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMongoMapper ¶
type IMongoMapper interface { Insert(ctx context.Context, i *Interface) error Update(ctx context.Context, i *Interface) error FindAndCountByUserId(ctx context.Context, userId string, p *basic.PaginationOptions) ([]*Interface, int64, error) FindOne(ctx context.Context, id string) (*Interface, error) FindOneByBaseInfIdAndUserId(ctx context.Context, baseInfId string, userId string) (*Interface, error) Delete(ctx context.Context, id string) error }
type Interface ¶
type Interface struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` BaseInterfaceId string `bson:"base_interface_id" json:"baseInterfaceId"` UserId string `bson:"user_id" json:"userId"` ChargeType int64 `bson:"charge_type" json:"chargeType"` Price int64 `bson:"price" json:"price"` Status int64 `bson:"status" json:"status"` CreateTime time.Time `bson:"create_time" json:"createTime"` UpdateTime time.Time `bson:"update_time" json:"updateTime"` DeleteTime time.Time `bson:"delete_time,omitempty" json:"deleteTime,omitempty"` }
type MongoMapper ¶
type MongoMapper struct {
// contains filtered or unexported fields
}
func NewMongoMapper ¶
func NewMongoMapper(config *config.Config) *MongoMapper
func (*MongoMapper) FindAndCountByUserId ¶
func (m *MongoMapper) FindAndCountByUserId(ctx context.Context, userId string, p *basic.PaginationOptions) ([]*Interface, int64, error)
func (*MongoMapper) FindOneByBaseInfIdAndUserId ¶
Click to show internal directories.
Click to hide internal directories.