user

package
v0.0.0-...-074ff86 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Enable  = 1 // 启用
	Disable = 2 // 禁用
)

Variables

This section is empty.

Functions

func Add

func Add(username, password string, status int, description string) error

func CheckAuth

func CheckAuth(id int, requestId int) error

检查用户权限

func Remove

func Remove(id int) error

func SelfUpdata

func SelfUpdata(id int, username, password string) error

func Updata

func Updata(id int, username, password string, status int, description string) error

Types

type Model

type Model struct {
	models.Model
	Username      string      `json:"username"`
	Password      string      `json:"-"`
	LastLoginIp   string      `json:"last_login_ip"`
	LastLoginTime *utils.Time `json:"last_login_time"`
	Status        int         `json:"status"`
	Description   string      `json:"description"`
}

func All

func All() ([]*Model, error)

func GetById

func GetById(id int) (model *Model, err error)

func GetByUserName

func GetByUserName(username string) (model *Model, err error)

func GetLists

func GetLists(ids []int) ([]*Model, error)

func (Model) AuthIds

func (m Model) AuthIds() []int

func (*Model) IsDisabled

func (m *Model) IsDisabled() bool

func (*Model) LoginUpdate

func (m *Model) LoginUpdate(ip string)

func (Model) MenuIds

func (m Model) MenuIds() []int

func (Model) RequestIds

func (m Model) RequestIds() []int

func (Model) UserGroupIds

func (m Model) UserGroupIds() []int

Jump to

Keyboard shortcuts

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