dao

package
v0.0.0-...-e9922d5 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IWebsiteConfigDao

type IWebsiteConfigDao interface {
	FindByTyp(ctx context.Context, typ string) (*WebsiteConfig, error)
	Increase(ctx context.Context, field string) error
	GetByTypes(ctx context.Context, types ...string) ([]*WebsiteConfig, error)
	Decrease(ctx context.Context, field string) error
	UpdateByConditionAndUpdates(ctx context.Context, cond bson.D, updates bson.D) error
	UpdatePropsByTyp(ctx context.Context, typ string, cfg any, now time.Time) error
	AddTPSVConfig(ctx context.Context, tpsv domain.TPSV) error
	DeleteTPSVConfigByKey(ctx context.Context, key string) error
	UpdatePostIndexProps(ctx context.Context, updates bson.D) error
	PushCarouselConfig(ctx context.Context, carouselElem domain.CarouselElem) error
	FindByFilter(ctx context.Context, filter bson.D) (*WebsiteConfig, error)
}

type WebsiteConfig

type WebsiteConfig struct {
	mongox.Model `bson:",inline"`
	Props        any    `bson:"props"`
	Typ          string `bson:"typ"`
}

WebsiteConfig defines for the MongoDB Collection "website_config"

type WebsiteConfigDao

type WebsiteConfigDao struct {
	// contains filtered or unexported fields
}

func NewWebsiteConfigDao

func NewWebsiteConfigDao(db *mongo.Database) *WebsiteConfigDao

func (*WebsiteConfigDao) AddTPSVConfig

func (d *WebsiteConfigDao) AddTPSVConfig(ctx context.Context, tpsv domain.TPSV) error

func (*WebsiteConfigDao) Decrease

func (d *WebsiteConfigDao) Decrease(ctx context.Context, field string) error

func (*WebsiteConfigDao) DeleteTPSVConfigByKey

func (d *WebsiteConfigDao) DeleteTPSVConfigByKey(ctx context.Context, key string) error

func (*WebsiteConfigDao) FindByFilter

func (d *WebsiteConfigDao) FindByFilter(ctx context.Context, filter bson.D) (*WebsiteConfig, error)

func (*WebsiteConfigDao) FindByTyp

func (d *WebsiteConfigDao) FindByTyp(ctx context.Context, typ string) (*WebsiteConfig, error)

func (*WebsiteConfigDao) GetByTypes

func (d *WebsiteConfigDao) GetByTypes(ctx context.Context, types ...string) ([]*WebsiteConfig, error)

func (*WebsiteConfigDao) Increase

func (d *WebsiteConfigDao) Increase(ctx context.Context, field string) error

func (*WebsiteConfigDao) PushCarouselConfig

func (d *WebsiteConfigDao) PushCarouselConfig(ctx context.Context, carouselElem domain.CarouselElem) error

func (*WebsiteConfigDao) UpdateByConditionAndUpdates

func (d *WebsiteConfigDao) UpdateByConditionAndUpdates(ctx context.Context, cond bson.D, updates bson.D) error

func (*WebsiteConfigDao) UpdatePostIndexProps

func (d *WebsiteConfigDao) UpdatePostIndexProps(ctx context.Context, updates bson.D) error

func (*WebsiteConfigDao) UpdatePropsByTyp

func (d *WebsiteConfigDao) UpdatePropsByTyp(ctx context.Context, typ string, cfg any, now time.Time) error

Jump to

Keyboard shortcuts

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