Documentation ¶
Index ¶
- Constants
- type EsFilter
- type EsMapper
- type FilterOptions
- type IEsMapper
- type IMongoMapper
- type MongoFilter
- type MongoMapper
- func (m *MongoMapper) Add(ctx context.Context, id string, add int64) error
- func (m *MongoMapper) Count(ctx context.Context, filter *FilterOptions) (int64, error)
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindMany(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Plan, error)
- func (m *MongoMapper) FindManyAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Plan, int64, error)
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Plan, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *Plan) error
- func (m *MongoMapper) Update(ctx context.Context, data *Plan) error
- type Plan
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 (*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 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 ¶
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) Count ¶
func (m *MongoMapper) Count(ctx context.Context, filter *FilterOptions) (int64, 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)
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"` }
Click to show internal directories.
Click to hide internal directories.