models

package
v0.0.0-...-7ac2355 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BookDao *bookDao
View Source
var CategoryDao *categoryDao
View Source
var MainDao *mainDao
View Source
var PhraseDao *phraseDao
View Source
var ProjectDao *projectDao
View Source
var UserDao *userDao

Functions

func NewBookDao

func NewBookDao() *bookDao

func NewCategoryDao

func NewCategoryDao() *categoryDao

func NewMainDao

func NewMainDao() *mainDao

func NewPhraseDao

func NewPhraseDao() *phraseDao

func NewProjectDao

func NewProjectDao() *projectDao

func NewUserDao

func NewUserDao() *userDao

Types

type BookModel

type BookModel struct {
	ID        uint      `gorm:"primaryKey;column:id" json:"id"`
	UserId    uint      `gorm:"column:user_id;not null" json:"user_id"`
	CoverUrl  string    `gorm:"column:cover_url;not null" json:"cover_url"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	Sort      int       `gorm:"column:sort;not null" json:"sort"`
	IsDel     int       `gorm:"column:is_del;not null" json:"is_del"`
	CreatedAt ModelTime `gorm:"column:created_at" json:"created_at"`
}

func (BookModel) TableName

func (um BookModel) TableName() string

type CategoryModel

type CategoryModel struct {
	ID        uint      `gorm:"primaryKey;column:id" json:"id"`
	UserId    uint      `gorm:"column:user_id;not null" json:"user_id"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	CType     int       `gorm:"column:type;not null" json:"type"`
	Sort      int       `gorm:"column:sort;not null" json:"sort"`
	IconUrl   string    `gorm:"column:icon_url;not null" json:"icon_url"`
	IsDel     int       `gorm:"column:is_del;not null" json:"is_del"`
	CreatedAt ModelTime `gorm:"column:created_at" json:"created_at"`
}

func (CategoryModel) TableName

func (um CategoryModel) TableName() string

type MainModel

type MainModel struct {
	ID         uint      `gorm:"primaryKey;column:id" json:"id"`
	UserId     uint      `gorm:"column:user_id;not null" json:"user_id"`
	BookId     uint      `gorm:"column:book_id;not null" json:"book_id"`
	CategoryId uint      `gorm:"column:category_id;not null" json:"category_id"`
	MType      int       `gorm:"column:type;not null" json:"type"`
	Money      float64   `gorm:"column:money;not null" json:"money"`
	Name       string    `gorm:"column:name;not null" json:"name"`
	Desc       string    `gorm:"column:desc;not null" json:"desc"`
	Date       ModelTime `gorm:"column:date" json:"date"`
	IsDel      int       `gorm:"column:is_del;not null" json:"is_del"`
	CreatedAt  ModelTime `gorm:"column:created_at" json:"created_at"`
}

func (MainModel) TableName

func (um MainModel) TableName() string

type MainStaModel

type MainStaModel struct {
	NickName  string    `gorm:"column:nick_name;not null" json:"nick_name"`
	AvatarUrl string    `gorm:"column:avatar_url;not null" json:"avatar_url"`
	Pay       float64   `gorm:"column:pay;not null" json:"pay"`
	Time      ModelTime `gorm:"column:time" json:"time"`
}

func (MainStaModel) TableName

func (um MainStaModel) TableName() string

type ModelTime

type ModelTime time.Time

func (ModelTime) MarshalJSON

func (t ModelTime) MarshalJSON() ([]byte, error)

func (*ModelTime) Scan

func (t *ModelTime) Scan(v interface{}) error

func (ModelTime) String

func (t ModelTime) String() string

func (*ModelTime) UnmarshalJSON

func (t *ModelTime) UnmarshalJSON(data []byte) (err error)

func (ModelTime) Value

func (t ModelTime) Value() (driver.Value, error)

type PhraseModel

type PhraseModel struct {
	ID        uint      `gorm:"primaryKey;column:id" json:"id"`
	Phrase    string    `gorm:"column:phrase;unique;not null" json:"phrase"`
	CreatedAt ModelTime `gorm:"column:created_at" json:"created_at"`
}

func (PhraseModel) TableName

func (um PhraseModel) TableName() string

type ProjectModel

type ProjectModel struct {
	ID        uint      `gorm:"primaryKey;column:id" json:"id"`
	Git       string    `gorm:"column:git;not null" json:"git"`
	Image     string    `gorm:"column:image;not null" json:"image"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	Content   string    `gorm:"column:content;not null" json:"content"`
	Sort      int       `gorm:"column:sort;not null" json:"sort"`
	Views     int       `gorm:"column:views;not null" json:"views"`
	CreatedAt ModelTime `gorm:"column:created_at" json:"created_at"`
}

func (ProjectModel) TableName

func (um ProjectModel) TableName() string

type UserModel

type UserModel struct {
	ID        uint      `gorm:"primaryKey;column:id" json:"id"`
	OpenId    string    `gorm:"column:openid;unique;not null" json:"openid"`
	Token     string    `gorm:"column:token;not null" json:"token"`
	NickName  string    `gorm:"column:nick_name;not null" json:"nick_name"`
	AvatarUrl string    `gorm:"column:avatar_url;not null" json:"avatar_url"`
	Sex       int       `gorm:"column:sex;not null" json:"sex"`
	Job       string    `gorm:"column:job;not null" json:"job"`
	CreatedAt ModelTime `gorm:"column:created_at" json:"created_at"`
	UpdatedAt ModelTime `gorm:"column:updated_at" json:"updated_at"`
}

func (UserModel) TableName

func (um UserModel) TableName() string

Jump to

Keyboard shortcuts

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