model

package
v0.0.0-...-1bd8ba5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(m CURD) (e error)

func Delete

func Delete(m CURD) (e error)

func Get

func Get(m CURD) (e error)

func GetAll

func GetAll(ms interface{}) (e error)

func Migrate

func Migrate(x *xorm.Engine) error

migrate data schema

func Update

func Update(m CURD) (e error)

Types

type CURD

type CURD interface {
	Update() error
	GetID() string
}

iferface CURD By xorm bool bug modelStruct has a self update method CURD object is a pointer

type NewRouter

type NewRouter struct {
	Title     string `json:"title"`
	Theme     string `json:"theme"`
	Icon      string `json:"icon"`
	Order     int    `json:"order"`
	Path      string `json:"path"`
	Exact     bool   `json:"exact"`
	Component string `json:"component"`
}

type Router

type Router struct {
	ID        string `json:"id" xorm:"pk"`
	Title     string `json:"title" xorm:"varchar(64)"`
	Icon      string `json:"icon" xorm:"varchar(64)"`
	Order     int    `json:"order" xorm:"int"`
	Path      string `json:"path" xorm:"varchar(64)"`
	Exact     bool   `json:"exact" xorm:"TINYINT(1)"`
	Component string `json:"component" xorm:"varchar(64)"`
}

func (*Router) GetID

func (r *Router) GetID() string

func (*Router) Update

func (r *Router) Update() (e error)

interface start

type User

type User struct {
	ID                string    `xorm:"pk" json:"id"`
	UserName          string    `xorm:"varchar(64) unique notnull" json:"username"`
	ShowName          string    `xorm:"varchar(64)" json:"name"` // 显示名称
	PassWord          string    `xorm:"varchar(32) notnull" json:"password"`
	Phone             string    `xorm:"varchar(32) " json:"phone"` // 电话号码
	IsAdmin           bool      `xorm:"TINYINT(1)" json:"isadmin"`
	RoleGroupID       string    `xorm:"notnull" json:"role_group_id"` // 权限组ID
	Domain            string    `xorm:"varchar(255)" json:"domain"`
	NeedChagePassword bool      `xorm:"TINYINT(1)" json:"changepassword"` // 需要修改密码才可登录
	Type              string    `xorm:"varchar(18)" json:"type"`          // 保留字段
	Email             string    `xorm:"varchar(255)" json:"email"`
	Avatar            string    `xorm:"varchar(255)" json:"avatar"`
	OrgID             string    `xorm:"varchar(255) notnull" json:"org_id"` // 归属组织机构ID
	Comments          string    `xorm:"varchar(255)" json:"comments"`       // 备注
	UpdateTime        time.Time `xorm:"updated" json:"-"`
	CreateTime        time.Time `xorm:"created" json:"-"`
	DeletedTime       time.Time `xorm:"deleted" json:"-"` // 软删除
}

func (*User) Auth

func (u *User) Auth(name string, passwd string) bool

function Auth basic authentication name and passwd

func (*User) Encryption

func (u *User) Encryption(pwd string)

Encryption functon

func (*User) FindByNameTypes

func (u *User) FindByNameTypes(input string) (nameType string, err error)

function FindByNameTypes find user use name,showname,phone and so on, return type of field name as json tags.

func (*User) GetID

func (u *User) GetID() string

func (*User) Update

func (u *User) Update() (e error)

CURD interface start

type UserStory

type UserStory struct {
	ID         string   `json:"id"`
	Priority   string   `json:"priority"`
	Risk       string   `json:"risk"`
	Points     int      `json:"points"`
	Dependency []string `json:"dependency"`
	Story      string   `json:"story"`
}

func (*UserStory) GetID

func (s *UserStory) GetID() string

func (*UserStory) Update

func (s *UserStory) Update() (e error)

interface start

Jump to

Keyboard shortcuts

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