models

package
v0.0.0-...-8e1814b Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Users

type Users struct {
	Id             int64     `xorm:"pk comment('编号Id') BIGINT(20)"`
	UserName       string    `xorm:"comment('用户名称') VARCHAR(200)"`
	RealyName      string    `xorm:"comment('真实姓名') VARCHAR(200)"`
	Password       string    `xorm:"not null comment('密码') VARCHAR(100)"`
	AuthKey        string    `xorm:"comment('authkey') VARCHAR(45)"`
	Email          string    `xorm:"comment('email') VARCHAR(100)"`
	IsDel          int       `xorm:"default 0 comment('是否删除:1、true 0、false') TINYINT(1)"`
	Note           string    `xorm:"comment('加入时间') TEXT"`
	ParentId       int64     `xorm:"not null BIGINT(20)"`
	CreateTime     time.Time `xorm:"not null DATETIME"`
	LastUpdateTime time.Time `xorm:"comment('最后更新时间') DATETIME"`
}

Users ORM 用户表使用了 KingShared 的分表方案

func (*Users) Add

func (e *Users) Add(k *Users) (int64, error)

Add 添加

func (*Users) BatchDelete

func (e *Users) BatchDelete(IDArray []int64) (int64, error)

BatchDelete 批量删除多条记录

func (*Users) Delete

func (e *Users) Delete(id int64) (int64, error)

Delete 删除一条记录

func (*Users) GetAll

func (e *Users) GetAll(whereCond builder.Cond, orderBy string, pageSize, currentPageIndex int) ([]Users, int64, error)

GetAll 获取

func (*Users) GetChildIDArray

func (e *Users) GetChildIDArray(id int64) ([]int64, error)

GetChildIDArray 获取创建的用户ID列表

func (*Users) GetOne

func (e *Users) GetOne(id int64) (Users, error)

GetOne 获取一条记录

func (*Users) QueryOne

func (e *Users) QueryOne(whereCond builder.Cond, orderBy string) (Users, error)

QueryOne 获取一条记录 u := &models.Users{} u.QueryOne(Eq{"id": 1}, "id desc")

func (*Users) RawSQL

func (e *Users) RawSQL(sql ...interface{}) (sql.Result, error)

RawSQL 执行sql

func (*Users) TableName

func (e *Users) TableName() string

TableName 表的名称

func (*Users) Update

func (e *Users) Update(k Users) (int64, error)

Update 修改

Jump to

Keyboard shortcuts

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