models

package
v0.0.0-...-6ff19a5 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCategory

func AddCategory(name string) error

func AddTopic

func AddTopic(title, content string) error

func DelCategory

func DelCategory(id string) error

func DelTopic

func DelTopic(id string) error

func ModifyTopic

func ModifyTopic(id, title, content string) error

func RegisterDB

func RegisterDB()

Types

type Category

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

func GetAllCategories

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

type Topic

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

func GetAllTopics

func GetAllTopics(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