dao

package
v0.0.0-...-d6a5514 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITagDao

type ITagDao interface {
	GetTags(ctx context.Context) ([]*Tags, error)
	GetByRoute(ctx context.Context, route string) (*Tags, error)
	QuerySkipAndSetLimit(ctx context.Context, cond bson.D, findOptions *options.FindOptions) ([]*Tags, int64, error)
	Create(ctx context.Context, tag *Tags) (string, error)
	ModifyEnabled(ctx context.Context, id primitive.ObjectID, enabled bool) error
	GetById(ctx context.Context, id primitive.ObjectID) (*Tags, error)
	DeleteById(ctx context.Context, id primitive.ObjectID) error
	RecoverTag(ctx context.Context, tag *Tags) error
	GetEnabled(ctx context.Context) ([]*Tags, error)
}

type TagDao

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

func NewTagDao

func NewTagDao(db *mongo.Database) *TagDao

func (*TagDao) Create

func (d *TagDao) Create(ctx context.Context, tag *Tags) (string, error)

func (*TagDao) DeleteById

func (d *TagDao) DeleteById(ctx context.Context, id primitive.ObjectID) error

func (*TagDao) GetById

func (d *TagDao) GetById(ctx context.Context, id primitive.ObjectID) (*Tags, error)

func (*TagDao) GetByRoute

func (d *TagDao) GetByRoute(ctx context.Context, route string) (*Tags, error)

func (*TagDao) GetEnabled

func (d *TagDao) GetEnabled(ctx context.Context) ([]*Tags, error)

func (*TagDao) GetTags

func (d *TagDao) GetTags(ctx context.Context) ([]*Tags, error)

func (*TagDao) ModifyEnabled

func (d *TagDao) ModifyEnabled(ctx context.Context, id primitive.ObjectID, enabled bool) error

func (*TagDao) QuerySkipAndSetLimit

func (d *TagDao) QuerySkipAndSetLimit(ctx context.Context, cond bson.D, findOptions *options.FindOptions) ([]*Tags, int64, error)

func (*TagDao) RecoverTag

func (d *TagDao) RecoverTag(ctx context.Context, tag *Tags) error

type Tags

type Tags struct {
	Id         primitive.ObjectID `bson:"_id,omitempty"`
	Name       string             `bson:"name"`
	Route      string             `bson:"route"`
	Enabled    bool               `bson:"enabled"`
	CreateTime int64              `bson:"create_time"`
	UpdateTime int64              `bson:"update_time"`
}

Jump to

Keyboard shortcuts

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