model

package
v0.0.0-...-00b26e8 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(user *User) (err error)

func DeleteUser

func DeleteUser(id int) (err error)

func IsUserExist

func IsUserExist(mobile string) (exist bool, err error)

func Setup

func Setup()

func UpdateUserById

func UpdateUserById(user *User) (err error)

Types

type Banner struct {
	gorm.Model
	Index   uint   `json:"index"`
	Title   string `json:"title"`
	Picture string `json:"picture"`
	Url     string `json:"url"`
}

func GetAllBanner

func GetAllBanner() (banners []*Banner, err error)

type CreditHistoriesPage

type CreditHistoriesPage struct {
	CreditHistories []*CreditHistory `json:"list"`
	TotalNum        uint             `json:"totalNum"`
	PageId          int              `json:"pageId"`
}

type CreditHistory

type CreditHistory struct {
	gorm.Model
	UserId  uint   `json:"userId"`
	Change  int    `json:"change"`
	Credit  int    `json:"credit"`
	Message string `json:"message"`
}

func ModifyCreditHistory

func ModifyCreditHistory(userId uint, change int, message string) (*CreditHistory, error)

type GameTimes

type GameTimes struct {
	gorm.Model
	UserId  uint   `json:"userId"`
	Change  int    `json:"change"`
	Credit  int    `json:"credit"`
	Message string `json:"message"`
}

type User

type User struct {
	gorm.Model
	Mobile   string `json:"mobile"`
	Password string `json:"-"`
	Nickname string `json:"nickname"`
	Avatar   string `json:"avatar"`
	Credit   int    `json:"credit"`
	Token    string `json:"token" gorm:"-"`
}

func GetAllUser

func GetAllUser() (users []*User, err error)

func GetUserById

func GetUserById(id uint) (user *User, err error)

func GetUserByMobile

func GetUserByMobile(mobile string) (user *User, err error)

Jump to

Keyboard shortcuts

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