models

package
v0.0.0-...-195f83a Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddApp

func AddApp(name, packageName string) (id int64, err error)

func AddComment

func AddComment(topicId, source, username, content string) (id int64, err error)

func DeleteComment

func DeleteComment(topicId string, id int64) (success bool, err error)

func ValidateApp

func ValidateApp(id int64, secret string) bool

Types

type App

type App struct {
	Id          int64  `orm:"auto;pk"`
	Secret      string `orm:"size(16);index;"`
	Name        string `orm:"size(128)"`
	PackageName string `orm:"size(64)";unique`
}

func (*App) TableName

func (a *App) TableName() string

type Comment

type Comment struct {
	Id        int64     `orm:"auto;pk"`
	Topic     string    `orm:"size(32);index"`
	Source    string    `orm:"size(10)"`
	Username  string    `orm:"size(32)"`
	Content   string    `orm:"size(140)"`
	CreatedAt time.Time `orm:"auto_now_add;type(datetime);index"`
}

func GetComment

func GetComment(topicId string, id int64) (c *Comment, err error)

func GetComments

func GetComments(topicId string, pageSize int, pageNum int) (comments []*Comment, err error)

func (*Comment) TableName

func (c *Comment) TableName() string

Jump to

Keyboard shortcuts

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