Documentation ¶
Index ¶
- Constants
- func MakeBsonFilter(options *FilterOptions) bson.M
- type FilterOptions
- type ISliderMongoMapper
- type MongoFilter
- type MongoMapper
- func (m *MongoMapper) CleanSlider(ctx context.Context, userId string) error
- func (m *MongoMapper) Count(ctx context.Context, fopts *FilterOptions) (int64, error)
- func (m *MongoMapper) DeleteOne(ctx context.Context, id string) error
- func (m *MongoMapper) GetSliders(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Slider, int64, error)
- func (m *MongoMapper) GetSlidersAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Slider, int64, error)
- func (m *MongoMapper) InsertOne(ctx context.Context, data *Slider) error
- func (m *MongoMapper) ReadSlider(ctx context.Context, id string) error
- func (m *MongoMapper) ReadSliders(ctx context.Context, fopts *FilterOptions) error
- func (m *MongoMapper) UpdateOne(ctx context.Context, data *Slider) error
- type Slider
Constants ¶
View Source
const (
CollectionName = "slider"
)
Variables ¶
This section is empty.
Functions ¶
func MakeBsonFilter ¶
func MakeBsonFilter(options *FilterOptions) bson.M
Types ¶
type FilterOptions ¶
type ISliderMongoMapper ¶
type ISliderMongoMapper interface { GetSliders(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Slider, int64, error) CleanSlider(ctx context.Context, userId string) error Count(ctx context.Context, fopts *FilterOptions) (int64, error) InsertOne(ctx context.Context, data *Slider) error GetSlidersAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Slider, int64, error) UpdateOne(ctx context.Context, data *Slider) error DeleteOne(ctx context.Context, id string) error }
func NewSliderModel ¶
func NewSliderModel(config *config.Config) ISliderMongoMapper
type MongoFilter ¶
type MongoFilter struct { *FilterOptions // contains filtered or unexported fields }
func (*MongoFilter) CheckOnlyIsPublic ¶
func (f *MongoFilter) CheckOnlyIsPublic()
func (*MongoFilter) CheckOnlyType ¶
func (f *MongoFilter) CheckOnlyType()
type MongoMapper ¶
type MongoMapper struct {
// contains filtered or unexported fields
}
func (*MongoMapper) CleanSlider ¶
func (m *MongoMapper) CleanSlider(ctx context.Context, userId string) error
CleanSlider 清除未读消息
func (*MongoMapper) Count ¶
func (m *MongoMapper) Count(ctx context.Context, fopts *FilterOptions) (int64, error)
func (*MongoMapper) DeleteOne ¶
func (m *MongoMapper) DeleteOne(ctx context.Context, id string) error
func (*MongoMapper) GetSliders ¶
func (m *MongoMapper) GetSliders(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Slider, int64, error)
func (*MongoMapper) GetSlidersAndCount ¶
func (m *MongoMapper) GetSlidersAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Slider, int64, error)
func (*MongoMapper) InsertOne ¶
func (m *MongoMapper) InsertOne(ctx context.Context, data *Slider) error
func (*MongoMapper) ReadSlider ¶
func (m *MongoMapper) ReadSlider(ctx context.Context, id string) error
func (*MongoMapper) ReadSliders ¶
func (m *MongoMapper) ReadSliders(ctx context.Context, fopts *FilterOptions) error
type Slider ¶
type Slider struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` ImageUrl string `bson:"imageUrl,omitempty" json:"imageUrl,omitempty"` LinkUrl string `bson:"linkUrl,omitempty" json:"linkUrl,omitempty"` Type int64 `bson:"type,omitempty" json:"type,omitempty"` IsPublic int64 `bson:"isPublic,omitempty" json:"isPublic,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
Click to show internal directories.
Click to hide internal directories.