models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2014 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsUserLogin = func(ctx *context.Context) {
	user := ctx.Input.Session("user")
	if user == nil && ctx.Request.RequestURI != "/login" {
		ctx.Redirect(302, "/")
	}
}

验证用户是否登陆

Functions

func GetAll

func GetAll() *[]Tenant

func GetChildOrgs

func GetChildOrgs(parentId string) *[]Org

获取指定单位的直属下级单位

func GetMyQun

func GetMyQun(userId string) *[]Qun

获取用户所参与的群

func GetOrgUsersById

func GetOrgUsersById(orgId string) *[]User

获取单位下的所有人员

func GetOrgsByParentId

func GetOrgsByParentId(parentId string) *[]Org

获取指定单位的所有下级单位

func GetRootOrg

func GetRootOrg(tenantId string) *[]Org

获取一级单位

Types

type Org

type Org struct {
	Id        string `orm:"column(id);pk"`
	Name      string
	ShortName string
	ParentId  string
	Location  string
	TenantId  string
	Sort      int
}

type Qun

type Qun struct {
	Id          string `orm:"column(id);pk"`
	CreatorId   string
	Name        string
	Description string
	MaxMember   string
	Avatar      string
	Created     time.Time
	Updated     time.Time
}

type QunUser

type QunUser struct {
	Id     string `orm:"column(id);pk"`
	QunId  string
	UserId string
	Sort   int

	Created time.Time
	Updated time.Time
	// contains filtered or unexported fields
}

type Tenant

type Tenant struct {
	Id         string `orm:"column(id);pk"`
	Code       string
	Name       string
	Status     int
	CustomerId string
	Created    time.Time
	Updated    time.Time
}

type User

type User struct {
	Id          string `orm:"column(id);pk"`
	Name        string
	Nickname    string
	Avatar      string
	NamePy      string
	NameQuanpin string
	Status      int
	Rand        int
	Password    string
	TenantId    string
	Level       int
	Email       string
	Mobile      string
	Area        string
	Created     time.Time
	Updated     time.Time
}

func GetUserByNameTenantId

func GetUserByNameTenantId(userName, tenantId string) *User

获取

Jump to

Keyboard shortcuts

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