plan

package
v1.2.28 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: GPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "plan"

Variables

This section is empty.

Functions

This section is empty.

Types

type EsFilter

type EsFilter struct {
	*FilterOptions
	// contains filtered or unexported fields
}

type EsMapper

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

func (*EsMapper) CountWithQuery

func (m *EsMapper) CountWithQuery(ctx context.Context, query []types.Query, fopts *FilterOptions) (int64, error)

func (*EsMapper) Search

func (m *EsMapper) Search(ctx context.Context, query []types.Query, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*Plan, int64, error)

type FilterOptions

type FilterOptions struct {
	OnlyUserId      *string
	OnlyCommunityId *string
	OnlyCatId       *string
	IncludeGlobal   *bool
}

type IEsMapper

type IEsMapper interface {
	Search(ctx context.Context, query []types.Query, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*Plan, int64, error)
	CountWithQuery(ctx context.Context, query []types.Query, fopts *FilterOptions) (int64, error)
}

func NewEsMapper

func NewEsMapper(config *config.Config) IEsMapper

type IMongoMapper

type IMongoMapper interface {
	Insert(ctx context.Context, data *Plan) error
	FindOne(ctx context.Context, id string) (*Plan, error)
	Update(ctx context.Context, data *Plan) error
	Delete(ctx context.Context, id string) error
	Add(ctx context.Context, id string, add int64) error
	FindMany(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Plan, error)
	Count(ctx context.Context, filter *FilterOptions) (int64, error)
	FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Plan, int64, error)
}

func NewMongoMapper

func NewMongoMapper(config *config.Config) IMongoMapper

type MongoFilter

type MongoFilter struct {
	*FilterOptions
	// contains filtered or unexported fields
}

func (*MongoFilter) CheckOnlyCatId

func (f *MongoFilter) CheckOnlyCatId()

func (*MongoFilter) CheckOnlyCommunityId added in v1.2.20

func (f *MongoFilter) CheckOnlyCommunityId()

func (*MongoFilter) CheckOnlyUserId

func (f *MongoFilter) CheckOnlyUserId()

type MongoMapper

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

func (*MongoMapper) Add added in v1.2.8

func (m *MongoMapper) Add(ctx context.Context, id string, add int64) error

func (*MongoMapper) Count

func (m *MongoMapper) Count(ctx context.Context, filter *FilterOptions) (int64, error)

func (*MongoMapper) Delete

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

func (*MongoMapper) FindMany

func (m *MongoMapper) FindMany(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Plan, error)

func (*MongoMapper) FindManyAndCount

func (m *MongoMapper) FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Plan, int64, error)

func (*MongoMapper) FindOne

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

func (*MongoMapper) Insert

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

func (*MongoMapper) Update

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

type Plan

type Plan struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Name        string             `bson:"name,omitempty"`
	CatId       string             `bson:"catId,omitempty"`
	CommunityId string             `bson:"communityId,omitempty"`
	CoverUrl    string             `bson:"coverUrl,omitempty"`
	ImageUrls   []string           `bson:"imageUrls,omitempty"`
	Description string             `bson:"description,omitempty"`
	PlanType    content.PlanType   `bson:"planType,omitempty" json:"planType,omitempty"`
	InitiatorId string             `bson:"initiatorId,omitempty"`
	StartTime   time.Time          `bson:"startTime,omitempty" json:"startTime,omitempty"`
	EndTime     time.Time          `bson:"endTime,omitempty" json:"endTime,omitempty"`
	MaxFish     int64              `bson:"maxFish,omitempty" json:"maxFish,omitempty"`
	NowFish     int64              `bson:"nowFish,omitempty" json:"nowFish,omitempty"`
	Instruction string             `bson:"instruction,omitempty"`
	Summary     string             `bson:"summary,omitempty"`
	PlanState   content.PlanState  `bson:"planState,omitempty" json:"planState,omitempty"`

	UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
	CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"`
	// 仅ES查询时使用
	Score_ float64 `bson:"_score,omitempty" json:"_score,omitempty"`
}

Jump to

Keyboard shortcuts

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