data

package
v0.0.0-...-9109ffc Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Data

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewData, NewUserRepo)

ProviderSet is data providers.

Functions

func NewMysql

func NewMysql(c *conf.Data_Mysql) (db *gorm.DB, err error)

func NewRedis

func NewRedis(ctx context.Context, data *conf.Data_Redis) (client *redis.Client, err error)

func NewUserRepo

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

NewuserRepo .

func RecordNotFound

func RecordNotFound(db *gorm.DB) (ret bool)

RecordNotFound First、Last、Take 这些预期会返回结果的方法查询记录时,才会返回 ErrRecordNotFound

Types

type Data

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

Data .

func NewData

func NewData(c *conf.Data, logger log.Logger) (*Data, func(), error)

NewData .

type User

type User struct {
	Id         int64          `gorm:"column:id;primaryKey;type:bigint;index;comment:数据id"`
	UserName   string         `gorm:"column:username;type:varchar(32);uniqueIndex;comment:用户名"`
	Password   string         `gorm:"column:password;type:varchar(32);comment:密码,纯md5,未加盐"`
	Email      string         `gorm:"column:email;type:varchar(64);index;comment:密码,纯md5,未加盐"`
	Avatar     string         `gorm:"column:avatar;type:text;comment:头像地址"`
	Status     biz.UserStatus `gorm:"column:status;type:tinyint;default:1"`
	CreateTime int32          `gorm:"column:create_time;type:int;not null"`
	DeleteTime int32          `gorm:"column:delete_time;type:int;default:0;comment:删除时间"`
}

Jump to

Keyboard shortcuts

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