model

package
v0.0.0-...-7745932 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = sqlx.ErrNotFound

Functions

This section is empty.

Types

type Station

type Station struct {
	Id        string       `db:"id"`        // 岗位标识
	Name      string       `db:"name"`      // 岗位名称
	TenantId  string       `db:"tenant_id"` // 岗位归属租户
	Sort      int64        `db:"sort"`      // 显示排序
	CreatedAt time.Time    `db:"created_at"`
	UpdatedAt sql.NullTime `db:"updated_at"`
	DeletedAt sql.NullTime `db:"deleted_at"`
	Deleted   int64        `db:"deleted"` // 是否删除  1-否 2-是
	Revision  int64        `db:"revision"`
}

type StationModel

type StationModel interface {
	Trans(ctx context.Context, fn func(context context.Context, session sqlx.Session) error) error
	RowBuilder() squirrel.SelectBuilder
	CountBuilder(field string) squirrel.SelectBuilder
	SumBuilder(field string) squirrel.SelectBuilder
	DeleteSoft(ctx context.Context, session sqlx.Session, data *Station) error
	FindOneByQuery(ctx context.Context, rowBuilder squirrel.SelectBuilder) (*Station, error)
	FindSum(ctx context.Context, sumBuilder squirrel.SelectBuilder) (float64, error)
	FindCount(ctx context.Context, countBuilder squirrel.SelectBuilder) (int64, error)
	FindAll(ctx context.Context, rowBuilder squirrel.SelectBuilder, orderBy string) ([]*Station, error)
	FindPageListByPage(ctx context.Context, rowBuilder squirrel.SelectBuilder, page, pageSize int64, orderBy string) ([]*Station, error)
	FindPageListByIdDESC(ctx context.Context, rowBuilder squirrel.SelectBuilder, preMinId, pageSize int64) ([]*Station, error)
	FindPageListByIdASC(ctx context.Context, rowBuilder squirrel.SelectBuilder, preMaxId, pageSize int64) ([]*Station, error)
	// contains filtered or unexported methods
}

StationModel is an interface to be customized, add more methods here, and implement the added methods in customStationModel.

func NewStationModel

func NewStationModel(conn sqlx.SqlConn, c cache.CacheConf) StationModel

NewStationModel returns a model for the database table.

type Tenant

type Tenant struct {
	Id        string       `db:"id"`        // 租户标识
	ParentId  string       `db:"parent_id"` // 父级标识
	Name      string       `db:"name"`      // 租户名称
	Contact   string       `db:"contact"`   // 联系人
	Mobile    string       `db:"mobile"`    // 联系电话
	Sort      int64        `db:"sort"`
	Status    int64        `db:"status"`     // 租户状态 1--启用 2--禁用
	StartTime time.Time    `db:"start_time"` // 租期开始时间
	EndTime   sql.NullTime `db:"end_time"`   // 租期结束时间
	CreatedAt time.Time    `db:"created_at"` // 创建时间
	UpdatedAt sql.NullTime `db:"updated_at"` // 更新时间
	DeletedAt sql.NullTime `db:"deleted_at"` // 删除时间
	Deleted   int64        `db:"deleted"`    // 是否删除 1-否 2-是
	Account   string       `db:"account"`    // 企业账号
	Revision  int64        `db:"revision"`   // 乐观锁版本
}

type TenantModel

type TenantModel interface {
	Trans(ctx context.Context, fn func(context context.Context, session sqlx.Session) error) error
	RowBuilder() squirrel.SelectBuilder
	CountBuilder(field string) squirrel.SelectBuilder
	SumBuilder(field string) squirrel.SelectBuilder
	DeleteSoft(ctx context.Context, session sqlx.Session, data *Tenant) error
	FindOneByQuery(ctx context.Context, rowBuilder squirrel.SelectBuilder) (*Tenant, error)
	FindSum(ctx context.Context, sumBuilder squirrel.SelectBuilder) (float64, error)
	FindCount(ctx context.Context, countBuilder squirrel.SelectBuilder) (int64, error)
	FindAll(ctx context.Context, rowBuilder squirrel.SelectBuilder, orderBy string) ([]*Tenant, error)
	FindPageListByPage(ctx context.Context, rowBuilder squirrel.SelectBuilder, page, pageSize int64, orderBy string) ([]*Tenant, error)
	FindPageListByIdDESC(ctx context.Context, rowBuilder squirrel.SelectBuilder, preMinId, pageSize int64) ([]*Tenant, error)
	FindPageListByIdASC(ctx context.Context, rowBuilder squirrel.SelectBuilder, preMaxId, pageSize int64) ([]*Tenant, error)
	// contains filtered or unexported methods
}

TenantModel is an interface to be customized, add more methods here, and implement the added methods in customTenantModel.

func NewTenantModel

func NewTenantModel(conn sqlx.SqlConn, c cache.CacheConf) TenantModel

NewTenantModel returns a model for the database table.

type User

type User struct {
	Id          string       `db:"id"`           // 用户标识
	Account     string       `db:"account"`      // 用户账号
	Password    string       `db:"password"`     // 密码
	Nickname    string       `db:"nickname"`     // 昵称
	SideMode    string       `db:"side_mode"`    // 布局方式
	BaseColor   string       `db:"base_color"`   // 后台页面色调
	ActiveColor string       `db:"active_color"` // 当前激活颜色设定
	Mobile      string       `db:"mobile"`       // 联系电话
	Email       string       `db:"email"`        // 邮箱
	Avatar      string       `db:"avatar"`       // 头像
	Status      int64        `db:"status"`       // 状态 1--正常 2--禁用
	Deleted     int64        `db:"deleted"`      // 是否删除 1--否  2--是
	CreatedAt   time.Time    `db:"created_at"`   // 创建时间
	UpdatedAt   sql.NullTime `db:"updated_at"`   // 修改时间
	DeletedAt   sql.NullTime `db:"deleted_at"`   // 删除时间
	Revision    int64        `db:"revision"`     // 乐观锁修订版本号
	IdCard      string       `db:"id_card"`      // 身份证号
}

type UserModel

type UserModel interface {
	Trans(ctx context.Context, fn func(context context.Context, session sqlx.Session) error) error
	RowBuilder() squirrel.SelectBuilder
	CountBuilder(field string) squirrel.SelectBuilder
	SumBuilder(field string) squirrel.SelectBuilder
	DeleteSoft(ctx context.Context, session sqlx.Session, data *User) error
	FindOneByQuery(ctx context.Context, rowBuilder squirrel.SelectBuilder) (*User, error)
	FindSum(ctx context.Context, sumBuilder squirrel.SelectBuilder) (float64, error)
	FindCount(ctx context.Context, countBuilder squirrel.SelectBuilder) (int64, error)
	FindAll(ctx context.Context, rowBuilder squirrel.SelectBuilder, orderBy string) ([]*User, error)
	FindPageListByPage(ctx context.Context, rowBuilder squirrel.SelectBuilder, page, pageSize int64, orderBy string) ([]*User, error)
	FindPageListByIdDESC(ctx context.Context, rowBuilder squirrel.SelectBuilder, preMinId, pageSize int64) ([]*User, error)
	FindPageListByIdASC(ctx context.Context, rowBuilder squirrel.SelectBuilder, preMaxId, pageSize int64) ([]*User, error)
	// contains filtered or unexported methods
}

UserModel is an interface to be customized, add more methods here, and implement the added methods in customUserModel.

func NewUserModel

func NewUserModel(conn sqlx.SqlConn, c cache.CacheConf) UserModel

NewUserModel returns a model for the database table.

Jump to

Keyboard shortcuts

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