models

package
v0.0.0-...-4730068 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGroup

func AddGroup(data map[string]interface{})

func AddUser

func AddUser(data map[string]interface{})

func AddUserToFriend

func AddUserToFriend(uid, fid int) bool

func AddUserToGroup

func AddUserToGroup(uid, gid int) bool

func CheckAdmin

func CheckAdmin(uid int) bool

func CheckAuth

func CheckAuth(username, password string) (int, bool)

func ClearToken

func ClearToken()

func CloseDB

func CloseDB()

func ExistGroupByName

func ExistGroupByName(name string) int

func ExistUserByName

func ExistUserByName(name string) int

func GetFrendidbyUid

func GetFrendidbyUid(uid int) (fids []int)

func GetGroupidbyUid

func GetGroupidbyUid(uid int) (gids []int)

func GetUserBytoken

func GetUserBytoken(s string) (int, bool)

func OfflineUser

func OfflineUser(uid int)

func OnlineUser

func OnlineUser(userid int, token string) bool

Types

type Group

type Group struct {
	Id       int    `json:"group_id" gorm:"index"`
	Nickname string `json:"nickname"`
	Gimage   string `json:"gimage"`
	Usinge   string `json:"usinge"`
	Status   int    `json:"status"`
}

func GetGroup

func GetGroup(id int) (group Group)

type Model

type Model struct {
	ID         int `gorm:"primary_key" json:"id"`
	CreatedOn  int `json:"created_on"`
	ModifiedOn int `json:"modified_on"`
}

type User

type User struct {
	Id       int    `json:"user_id" gorm:"index"`
	Username string `json:"user"`
	Password string `json:"pass"`
	Urool    int    `json:"urool"`
	Nickname string `json:"nickname"`
	Uimage   string `json:"uimage"`
	Usinge   string `json:"usinge"`
	Status   int    `json:"status"`
}

func GetUser

func GetUser(id int) (user User)

type UserFriend

type UserFriend struct {
	Userid  int
	Frendid int
	Status  int `json:"state"`
}

type UserGroup

type UserGroup struct {
	Userid  int
	Groupid int
	Status  int `json:"status"`
}

type UserToken

type UserToken struct {
	Userid int `gorm:"index"`
	Utoken string
	Status int `json:"status"`
}

Jump to

Keyboard shortcuts

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