models

package
v0.0.0-...-a23e254 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CONNECTION = "default"

CONNECTION 默认链接库

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	Id    int
	Role  string
	Title string
}

Role 表结构

type User

type User struct {
	Id       int
	Name     string `orm:"size(100)"`
	Password string
	Token    string `orm:"size(64)"`
	Avatar   string
}

User 表结构

type UserModal

type UserModal struct {
	User
	Roles   []Role
	IsError bool
	Error   string
	Ip      string
	Db      orm.Ormer
}

UserModal 用户表模型

func (*UserModal) GetOne

func (th *UserModal) GetOne(column string) *UserModal

GetOne 获取一条用户信息

func (*UserModal) GetRoles

func (th *UserModal) GetRoles()

GetRoles 获取用户权限

func (*UserModal) Login

func (th *UserModal) Login() *UserModal

Login 用户登录 @username @password

Jump to

Keyboard shortcuts

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