data

package
v0.0.0-...-476383d Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 23 Imported by: 0

README

Data

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewAuthRepo

func NewAuthRepo(data *Data, logger log.Logger) biz.AuthRepo

func NewDB

func NewDB(conf *conf.Data) *gorm.DB

NewDB 初始化mysql

func NewPartnerRepo

func NewPartnerRepo(data *Data, logger log.Logger) biz.PartnerRepo

func NewRecovery

func NewRecovery(d *Data) biz.Recovery

func NewRedSync

func NewRedSync(conf *conf.Data) *redsync.Mutex

NewRedSync 基于redis的分布式锁

func NewRedis

func NewRedis(conf *conf.Data) redis.Cmdable

NewRedis redis

func NewSession

func NewSession(data *conf.Data, constant *conf.UserConstant) *redistore.RediStore

NewSession 初始化session

func NewTransaction

func NewTransaction(d *Data) biz.Transaction

func NewUserRepo

func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo

Types

type Data

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

func NewData

func NewData(db *gorm.DB, redisCmd redis.Cmdable, redSync *redsync.Mutex, logger log.Logger, conf *conf.UserConstant, sessionStore *redistore.RediStore) (*Data, func(), error)

func (*Data) DB

func (d *Data) DB(ctx context.Context) *gorm.DB

func (*Data) ExecTx

func (d *Data) ExecTx(ctx context.Context, fn func(ctx context.Context) error) error

func (*Data) GroupRecover

func (d *Data) GroupRecover(ctx context.Context, fn func(ctx context.Context) error) func() error

func (*Data) Recover

func (d *Data) Recover(ctx context.Context, fn func(ctx context.Context)) func()

type Team

type Team struct {
	Id          int32
	Name        string
	Description string
	MaxNum      int32     `gorm:"column:maxNum"`
	ExpireTime  time.Time `gorm:"column:expireTime"`
	UserId      int32     `gorm:"column:userId"`
	Status      int32
	Password    string
	CreateTime  time.Time `gorm:"column:createTime"`
	UpdateTime  time.Time `gorm:"column :updateTime"`
	IsDelete    int32     `gorm:"column:isDelete"`
}

type User

type User struct {
	Id           int32
	UserName     string `gorm:"column:username"`
	UserAccount  string `gorm:"column:userAccount"`
	AvatarUrl    string `gorm:"column:avatarUrl"`
	Gender       int32
	UserPassword string `gorm:"column:userPassword"`
	Phone        string
	Email        string
	UserStatus   int32     `gorm:"column:userStatus"`
	CreateTime   time.Time `gorm:"column:createTime"`
	UpdateTime   time.Time `gorm:"column:updateTime"`
	IsDelete     int32     `gorm:"column:isDelete"`
	Role         int32
	Tags         string
	Profile      string
}

func (User) MarshalEasyJSON

func (v User) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (User) MarshalJSON

func (v User) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*User) UnmarshalEasyJSON

func (v *User) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*User) UnmarshalJSON

func (v *User) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UserTeam

type UserTeam struct {
	Id         int32
	UserId     int32     `gorm:"column:userId"`
	TeamId     int32     `gorm:"column:teamId"`
	JoinTime   time.Time `gorm:"column:joinTime"`
	CreateTime time.Time `gorm:"column:createTime"`
	UpdateTime time.Time `gorm:"column :updateTime"`
	IsDelete   int32     `gorm:"column:isDelete"`
}

Jump to

Keyboard shortcuts

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