models

package
v0.0.0-...-80ac67a Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2014 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	Id                             int     `orm:"pk" json:"trackId"`
	Name                           string  `json:"trackName"`
	Version                        string  `orm:"null"`
	Price                          int     `orm:"null"`
	Url                            string  `orm:"null" json:"artworkUrl60"`
	Artwork1Url                    string  `orm:"null" json:"artworkUrl100"`
	Artwork2Url                    string  `orm:"null" json:"artworkUrl512"`
	Artwork3Url                    string  `orm:"null"`
	ArtistId                       int     `orm:"null"`
	ArtistName                     string  `orm:"null"`
	AverageRating                  float32 `orm:"null" json:"averageUserRating"`
	RatingCount                    int     `orm:"null" json:"userRatingCount"`
	AverageRatingForCurrentVersion float32 `orm:"null" json:"averageUserRatingForCurrentVersion"`
	RatingCountForCurrentVersion   int     `orm:"null" json:"userRatingCountForCurrentVersion"`
	JsonText                       string  `orm:"null"`
	ReviewCount                    int     `orm:"default(0)"`
}

type GameManager

type GameManager struct {
	ModelManager
}

func (*GameManager) All

func (this *GameManager) All() []*Game

func (*GameManager) Count

func (this *GameManager) Count() int64

func (*GameManager) Create

func (this *GameManager) Create(game *Game) *Game

func (*GameManager) Find

func (this *GameManager) Find(pagination *Pagination) []*Game

func (*GameManager) Get

func (this *GameManager) Get(id int) *Game

func (*GameManager) TableName

func (this *GameManager) TableName() string

func (*GameManager) Update

func (this *GameManager) Update(game *Game) *Game

type GameReview

type GameReview struct {
	Id         int
	GameId     int
	ReviewText string
}

type GameReviewManager

type GameReviewManager struct {
	ModelManager
}

func (*GameReviewManager) All

func (this *GameReviewManager) All() []*GameReview

func (*GameReviewManager) Count

func (this *GameReviewManager) Count() int64

func (*GameReviewManager) Create

func (this *GameReviewManager) Create(gameReview *GameReview) *GameReview

func (*GameReviewManager) Find

func (this *GameReviewManager) Find(pagination *Pagination) []*GameReview

func (*GameReviewManager) Get

func (this *GameReviewManager) Get(id int) *GameReview

func (*GameReviewManager) TableName

func (this *GameReviewManager) TableName() string

func (*GameReviewManager) Update

func (this *GameReviewManager) Update(gameReview *GameReview) *GameReview

type ModelManager

type ModelManager struct {
	// contains filtered or unexported fields
}

func (*ModelManager) GetOrm

func (this *ModelManager) GetOrm() orm.Ormer

func (*ModelManager) QueryTable

func (this *ModelManager) QueryTable(tableName string) orm.QuerySeter

type Pagination

type Pagination struct {
	StartCount int
	EndCount   int
	TotalCount int64
	Page       int
	MaxPage    int
	Pages      []int
	Length     int
	Range      int
}

func NewPagination

func NewPagination(page int, length int, totalCount int64) *Pagination

func NewPaginationByController

func NewPaginationByController(c *beego.Controller, length int, totalCount int64) *Pagination

type User

type User struct {
	Id   int
	Name string
	Type int
}

func (*User) TableName

func (this *User) TableName() string

type UserManager

type UserManager struct {
	ModelManager
}

func (*UserManager) All

func (this *UserManager) All() []*User

func (*UserManager) Count

func (this *UserManager) Count(t int64) int64

func (*UserManager) Create

func (this *UserManager) Create(user *User) *User

func (*UserManager) Find

func (this *UserManager) Find(t int64, pagination *Pagination) []*User

func (*UserManager) Get

func (this *UserManager) Get(id int) *User

func (*UserManager) Update

func (this *UserManager) Update(user *User) *User

Jump to

Keyboard shortcuts

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