models

package
v0.0.0-...-9d967d0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func TableName

func TableName(str string) string

返回带前缀的表名

Types

type Category

type Category struct {
	Id      int
	Name    string
	Created time.Time
	Updated time.Time
}

func (*Category) TableName

func (m *Category) TableName() string

type Comment

type Comment struct {
	Id       int
	Username string
	Content  string
	Created  time.Time
	PostId   int
	Ip       string
}

func (*Comment) TableName

func (m *Comment) TableName() string

type Config

type Config struct {
	Id    int
	Name  string
	Value string
}

func (*Config) TableName

func (m *Config) TableName() string

type Post

type Post struct {
	Id         int
	UserId     int
	Title      string
	Url        string
	Content    string
	Tags       string
	Views      int
	IsTop      int8
	Created    time.Time
	Updated    time.Time
	CategoryId int
	Status     int8
	Types      int8
	Info       string
	Image      string
}

func (*Post) TableName

func (m *Post) TableName() string

type Response

type Response struct {
	Code    int
	Message interface{}
}

type User

type User struct {
	Id         int
	Username   string
	Password   string
	Email      string
	LoginCount int
	LastTime   time.Time
	LastIp     string
	State      int8
	Created    time.Time
	Updated    time.Time
}

func (*User) TableName

func (m *User) TableName() string

Jump to

Keyboard shortcuts

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