models

package
v0.0.0-...-41229de Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

// # 数据库建表遵循 全小写原则 // 结构体遵循 首字母大写 的 驼峰命名法 // xorm 映射规则 --> NameZh:name_zh

// TableName 表名重命名,有这个方法,自动匹配数据库表 star_info
// 不用调用,xorm 会自动识别
func (StarInfo) TableName() string {
	return "star_info"
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoJob

func DoJob(cmd, handler string)

interface run job

Types

type JdcronTasks

type JdcronTasks struct {
	Id         int       `xorm:"not null pk autoincr INT(11)"`
	TaskId     int       `xorm:"not null default 0 INT(11)"`
	Spec       string    `xorm:"VARCHAR(255)"`
	Command    string    `xorm:"VARCHAR(255)"`
	Status     int       `xorm:"not null default 0 TINYINT(1)"`
	CreateTime time.Time `xorm:"not null DATETIME"`
	Name       string    `xorm:"VARCHAR(255)"`
	Handler    string    `xorm:"not null default '' VARCHAR(255)"`
}

func (JdcronTasks) Add

func (j JdcronTasks) Add(name, spec, cmd, handler string)

func (JdcronTasks) GetAll

func (j JdcronTasks) GetAll() []JdcronTasks

func (JdcronTasks) GetBy

func (j JdcronTasks) GetBy(id int) *JdcronTasks

func (*JdcronTasks) Insert

func (j *JdcronTasks) Insert(task *JdcronTasks)

func (*JdcronTasks) Run

func (j *JdcronTasks) Run()

------ job cron interface function

func (JdcronTasks) UpdateTID

func (j JdcronTasks) UpdateTID(id int, tid string, status int)

func (JdcronTasks) UpdateTaskStatus

func (j JdcronTasks) UpdateTaskStatus(taskId int, status int)

type User

type User struct {
	Age       int
	Email     string
	Id        int
	Pwd       string
	Username  string
	SysStatus int
}

func CreateUser

func CreateUser() User

CreateUser User操作类

func (User) Delete

func (User) Delete(id int) error

Delete 删

func (User) GetAll

func (User) GetAll() []User

GetAll 查all

func (User) GetById

func (User) GetById(id int) *User

GetUserInfo 查

func (User) GetByPage

func (User) GetByPage(limit, offset int) *pageModel.PageInfo

GetByPage 分页 limit 每页数量 offset 页码

func (User) GetSequence

func (User) GetSequence() string

GetSequence get 序列号

func (User) Insert

func (User) Insert(data *User) error

InsertUser 增

func (User) TableName

func (User) TableName() string

TableName 表名

func (User) Update

func (User) Update(data *User, columns []string) error

UpdateUser 改 columns 判断强制更新

Jump to

Keyboard shortcuts

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