models

package
v0.0.0-...-5f43797 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2015 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package models provides ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCategory

func AddCategory(name string) error

func AddReply

func AddReply(tid, nickname, content string) error

func AddTopic

func AddTopic(title, category, tag, content, attachment string) error

func DecreaseCategory

func DecreaseCategory(tid int64) error

func DeleteCategory

func DeleteCategory(id string) error

func DeleteReplies

func DeleteReplies(tid string) error

func DeleteReply

func DeleteReply(rid string) error

func DeleteTopic

func DeleteTopic(tid string) error

func DeleteTopics

func DeleteTopics(cid string) error

func IncreaseCategory

func IncreaseCategory(tid int64) error

func ModifyTopic

func ModifyTopic(tid, title, category, tags, content, attachment string) error

func RegisterDB

func RegisterDB()

func UpdateTopicInfo

func UpdateTopicInfo(id string) error

Types

type Category

type Category struct {
	Id              int64
	Title           string
	Created         time.Time `orm:"index"`
	Views           int64     `orm:"index"`
	TopicTime       time.Time `orm:"imdex"`
	TopicCount      int64
	TopicLastUserId int64
}

func GetAllCategories

func GetAllCategories() ([]*Category, error)

type Comment

type Comment struct {
	Id      int64
	Tid     int64
	Name    string
	Content string    `orm:"size(1000)"`
	Created time.Time `orm:"index"`
}

func GetAllReplies

func GetAllReplies(tid string) (replies []*Comment, err error)

type Topic

type Topic struct {
	Id              int64
	Uid             int64
	Title           string
	Category        string
	Tag             string
	Content         string `orm:"size(5000)"`
	Attachment      string
	Created         time.Time `orm:"index"`
	Updated         time.Time `orm:"index"`
	Views           int64
	Author          string
	ReplyTime       time.Time `orm:"index"`
	ReplyCount      int64
	ReplyLastUserId int64
}

func GetAllTopics

func GetAllTopics(cate, tag string, isDesc bool) ([]*Topic, error)

func GetTopic

func GetTopic(tid string) (*Topic, error)

Jump to

Keyboard shortcuts

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