Versions in this module Expand all Collapse all v1 v1.0.22 Feb 11, 2024 Changes in this version + const CollectionName + var PrefixUserCacheKey = "cache:user:" + type Auth struct + AppId string + Type int32 + UnionId string + type IUserMongoMapper interface + AppendAuth func(ctx context.Context, id string, auth *Auth) error + Delete func(ctx context.Context, id string) (int64, error) + FindOne func(ctx context.Context, id string) (*User, error) + FindOneByAuth func(ctx context.Context, auth *Auth) (*User, error) + Insert func(ctx context.Context, data *User) (string, error) + Update func(ctx context.Context, data *User) (*mongo.UpdateResult, error) + UpdateById func(ctx context.Context, auth *Auth, id string) (*mongo.UpdateResult, error) + func NewMongoMapper(config *config.Config) IUserMongoMapper + type MongoMapper struct + func (m *MongoMapper) AppendAuth(ctx context.Context, id string, auth *Auth) error + func (m *MongoMapper) Delete(ctx context.Context, id string) (int64, error) + func (m *MongoMapper) FindOne(ctx context.Context, id string) (*User, error) + func (m *MongoMapper) FindOneByAuth(ctx context.Context, auth *Auth) (*User, error) + func (m *MongoMapper) Insert(ctx context.Context, data *User) (string, error) + func (m *MongoMapper) Update(ctx context.Context, data *User) (*mongo.UpdateResult, error) + func (m *MongoMapper) UpdateById(ctx context.Context, auth *Auth, id string) (*mongo.UpdateResult, error) + type User struct + Auths []*Auth + CreateAt time.Time + ID primitive.ObjectID + PassWord string + Role int32 + UpdateAt time.Time