models

package
v0.0.0-...-39cf1df Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2015 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 GetUserQunNums

func GetUserQunNums(userId string) int

获取用户关注的群的数量

func Register

func Register(userName, password string) bool

注册用户

func ValidUserName

func ValidUserName(userName string) bool

校验用户名是否可用

Types

type Page

type Page struct {
	Begin        int
	End          int
	PageSize     int
	PageCount    int
	TotalRecords int
	PageNo       int
}

type Qun

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

func GetUserQuns

func GetUserQuns(userId string) []Qun

获取用户所属的群

type User

type User struct {
	Id         string `orm:"column(id);pk"`
	Name       string
	NickName   string
	Signature  string
	Avatar     string
	Status     int
	Password   string
	Sex        int
	Level      int
	Location   string
	Mobile     string
	Email      string
	Occupation string
	Url        string
	Created    time.Time
	Updated    time.Time
}

func GetUserByName

func GetUserByName(name string) *User

*根据用户名获取用户* * @name 用户登陆名

type UserInfo

type UserInfo struct {
	Id          string
	Name        string
	NickName    string
	Signature   string
	Avatar      string
	Status      int
	Password    string
	Sex         int
	Level       int
	Location    string
	Mobile      string
	Email       string
	Occupation  string
	Url         string
	Remark_name string
}

func GetUserFriend

func GetUserFriend(userId string) []UserInfo

获取用户关注好友

Jump to

Keyboard shortcuts

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