userAuth

package
v0.0.0-...-f45b2b9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CollectionName = "UserAuth"

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoMapper

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

func (*MongoMapper) Delete

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

func (*MongoMapper) FindOne

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

func (*MongoMapper) FindOneByAuthKey

func (m *MongoMapper) FindOneByAuthKey(ctx context.Context, AuthKey string) (*UserAuth, error)

func (*MongoMapper) Insert

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

func (*MongoMapper) Update

func (m *MongoMapper) Update(ctx context.Context, data *UserAuth) (*mongo.UpdateResult, error)

type UserAuth

type UserAuth struct {
	ID       primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	UserId   string             `bson:"userId"`
	AuthKey  string             `bson:"authKey"`
	AuthType int32              `bson:"authType"`
	UpdateAt time.Time          `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
	CreateAt time.Time          `bson:"createAt,omitempty" json:"createAt,omitempty"`
}

type UserAuthMongoMapper

type UserAuthMongoMapper interface {
	Insert(ctx context.Context, data *UserAuth) error
	FindOne(ctx context.Context, id string) (*UserAuth, error)
	FindOneByAuthKey(ctx context.Context, AuthKey string) (*UserAuth, error) // 根据AuthKey查找
	Update(ctx context.Context, data *UserAuth) (*mongo.UpdateResult, error)
	Delete(ctx context.Context, id string) (int64, error)
}

func NewMongoModel

func NewMongoModel(config *config.Config) UserAuthMongoMapper

Jump to

Keyboard shortcuts

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