Documentation ¶
Index ¶
- Constants
- func MakeBsonFilter(options *FilterOptions) bson.M
- type FilterOptions
- type INotificationMongoMapper
- type MongoFilter
- type MongoMapper
- func (m *MongoMapper) Count(ctx context.Context, fopts *FilterOptions) (int64, error)
- func (m *MongoMapper) DeleteNotifications(ctx context.Context, fopts *FilterOptions) error
- func (m *MongoMapper) GetNotifications(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Notification, error)
- func (m *MongoMapper) GetNotificationsAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, ...) ([]*Notification, int64, error)
- func (m *MongoMapper) InsertOne(ctx context.Context, data *Notification) error
- func (m *MongoMapper) UpdateNotifications(ctx context.Context, fopts *FilterOptions) error
- type Notification
Constants ¶
View Source
const (
CollectionName = "notification"
)
Variables ¶
This section is empty.
Functions ¶
func MakeBsonFilter ¶
func MakeBsonFilter(options *FilterOptions) bson.M
Types ¶
type FilterOptions ¶
type INotificationMongoMapper ¶
type INotificationMongoMapper interface { GetNotifications(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Notification, error) Count(ctx context.Context, fopts *FilterOptions) (int64, error) UpdateNotifications(ctx context.Context, fopts *FilterOptions) error DeleteNotifications(ctx context.Context, fopts *FilterOptions) error InsertOne(ctx context.Context, data *Notification) error GetNotificationsAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Notification, int64, error) }
func NewNotificationModel ¶
func NewNotificationModel(config *config.Config) INotificationMongoMapper
type MongoFilter ¶
type MongoFilter struct { *FilterOptions // contains filtered or unexported fields }
func (*MongoFilter) CheckOnlyIsRead ¶
func (f *MongoFilter) CheckOnlyIsRead()
func (*MongoFilter) CheckOnlyType ¶
func (f *MongoFilter) CheckOnlyType()
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, fopts *FilterOptions) (int64, error)
func (*MongoMapper) DeleteNotifications ¶
func (m *MongoMapper) DeleteNotifications(ctx context.Context, fopts *FilterOptions) error
func (*MongoMapper) GetNotifications ¶
func (m *MongoMapper) GetNotifications(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Notification, error)
func (*MongoMapper) GetNotificationsAndCount ¶
func (m *MongoMapper) GetNotificationsAndCount(ctx context.Context, fopts *FilterOptions, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Notification, int64, error)
func (*MongoMapper) InsertOne ¶ added in v1.0.6
func (m *MongoMapper) InsertOne(ctx context.Context, data *Notification) error
func (*MongoMapper) UpdateNotifications ¶
func (m *MongoMapper) UpdateNotifications(ctx context.Context, fopts *FilterOptions) error
type Notification ¶
type Notification struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` TargetUserId string `bson:"targetUserId,omitempty" json:"targetUserId,omitempty"` SourceUserId string `bson:"sourceUserId,omitempty" json:"sourceUserId,omitempty"` SourceContentId string `bson:"sourceContentId,omitempty" json:"sourceContentId,omitempty"` Type int64 `bson:"type,omitempty" json:"type,omitempty"` TargetType int64 `bson:"targetType,omitempty" json:"targetType,omitempty"` Text string `bson:"text,omitempty" json:"text,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` Status int64 `bson:"status,omitempty" json:"status,omitempty"` }
Click to show internal directories.
Click to hide internal directories.