slider

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CollectionName = "slider"
)

Variables

This section is empty.

Functions

func MakeBsonFilter

func MakeBsonFilter(options *FilterOptions) bson.M

Types

type FilterOptions

type FilterOptions struct {
	OnlyType     *int64
	OnlyIsPublic *int64
}

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

func (*MongoMapper) UpdateOne

func (m *MongoMapper) UpdateOne(ctx context.Context, data *Slider) 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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL