cat

package
v1.2.16 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "cat"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cat

type Cat struct {
	ID           primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	Age          string             `bson:"age,omitempty"`
	CommunityId  string             `bson:"communityId,omitempty"`
	Color        string             `bson:"color,omitempty"`
	Details      string             `bson:"details,omitempty"`
	Name         string             `bson:"name,omitempty"`
	Sex          string             `bson:"sex,omitempty"`
	Status       int64              `bson:"status,omitempty"`
	Area         string             `bson:"area,omitempty"`
	IsSnipped    bool               `bson:"isSnipped,omitempty"`
	IsSterilized bool               `bson:"isSterilized,omitempty"`
	Avatars      []string           `bson:"avatars,omitempty"`
	UpdateAt     time.Time          `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
	CreateAt     time.Time          `bson:"createAt,omitempty" json:"createAt,omitempty"`
}

type EsMapper

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

func (*EsMapper) Search

func (m *EsMapper) Search(ctx context.Context, communityId, keyword string, skip, count int) ([]*Cat, int64, error)

type IEsMapper

type IEsMapper interface {
	Search(ctx context.Context, communityId, keyword string, skip, count int) ([]*Cat, int64, error)
}

func NewEsMapper

func NewEsMapper(config *config.Config) IEsMapper

type IMongoMapper

type IMongoMapper interface {
	Insert(ctx context.Context, data *Cat) error
	FindOne(ctx context.Context, id string) (*Cat, error)
	Update(ctx context.Context, data *Cat) error
	Delete(ctx context.Context, id string) error
	FindManyByCommunityId(ctx context.Context, communityId string, skip int64, count int64) ([]*Cat, int64, error)
}

func NewMongoMapper

func NewMongoMapper(config *config.Config) IMongoMapper

type MongoMapper

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

func (*MongoMapper) Delete

func (m *MongoMapper) Delete(ctx context.Context, id string) error

func (*MongoMapper) FindManyByCommunityId

func (m *MongoMapper) FindManyByCommunityId(ctx context.Context, communityId string, skip int64, count int64) ([]*Cat, int64, error)

func (*MongoMapper) FindOne

func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Cat, error)

func (*MongoMapper) Insert

func (m *MongoMapper) Insert(ctx context.Context, data *Cat) error

func (*MongoMapper) Update

func (m *MongoMapper) Update(ctx context.Context, data *Cat) error

Jump to

Keyboard shortcuts

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