models

package
v0.0.0-...-190e5d9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

********************************************* ** @Des: 用户 ** @Author: 云飞扬 ** @Date: ** @Last Modified by: 云飞扬 ** @Last Modified time: **********************************************

********************************************* ** @Des: 模型初始化 ** @Author: 云飞扬 ** @Date: ** @Last Modified by: 云飞扬 ** @Last Modified time: **********************************************

Index

Constants

View Source
const TableNameAdmin string = "pp_uc_admin"

用户表名

Variables

This section is empty.

Functions

func Init

func Init()

初始化

Types

type Admin

type Admin struct {
	//id
	Id int
	//登陆名
	LoginName string
	//真实名称
	RealName string
	//密码
	Password string
	//所属角色id串
	RoleIds string
	//电话
	Phone string
	//邮箱
	Email string
	//盐值
	Salt string
	//最后登陆时间
	LastLogin int64
	//最后登陆ip
	LastIp string
	//状态
	Status int
	//创建人id
	CreateId int
	//修改人id
	UpdateId int
	//创建时间
	CreateTime int64
	//更新时间
	UpdateTime int64
}

用户

func GetAdminByLoginName

func GetAdminByLoginName(loginName string) (*Admin, error)

根据登陆名称获取用户信息

func (*Admin) TableName

func (this *Admin) TableName() string

获取表名,注册模型的时候会自动调用

func (*Admin) Update

func (this *Admin) Update(fields ...string) error

更新

Jump to

Keyboard shortcuts

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