model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBEngine

func NewDBEngine(databseSetting *setting.DatabaseSettings) (*gorm.DB, error)

Types

type Article

type Article struct {
	*Model
	Title          string `json:"title"`
	Description    string `json:"description"`
	Content        string `json:"content"`
	ConverImageURL string `json:"conver_image_url"`
	State          uint8  `json:"state"`
}

func (Article) TableName

func (a Article) TableName() string

type ArticleSwagger

type ArticleSwagger struct {
	List  []*Article
	Pager *app.Pager
}

type ArticleTag

type ArticleTag struct {
	*Model
	TagID     uint64 `json:"tag_id"`
	ArticleID uint64 `json:"article_id"`
}

func (*ArticleTag) TableName

func (at *ArticleTag) TableName() string

type Model

type Model struct {
	ID         uint32 `gorm:"primary_key" json:"id"`
	CreatedBy  string `json:"created_by"`
	ModifiedBy string `json:"modified_by"`
	CreateOn   uint32 `json:"created_on"`
	ModifiedOn uint32 `json:"modified_on"`
	DeleteOn   uint32 `json:"deleted_on"`
	IsDel      uint8  `json:"is_delete"`
}

type Tag

type Tag struct {
	*Model
	Name  string `json:"name"`
	State uint8  `json:"state"`
}

func (Tag) Count

func (t Tag) Count(db *gorm.DB) (int, error)

func (Tag) Create

func (t Tag) Create(db *gorm.DB) error

func (Tag) Delete

func (t Tag) Delete(db *gorm.DB) error

func (Tag) List

func (t Tag) List(db *gorm.DB, pageOffset, pageSize int) ([]*Tag, error)

func (*Tag) TableName

func (t *Tag) TableName() string

func (Tag) Update

func (t Tag) Update(db *gorm.DB, values interface{}) error

type TagSwagger

type TagSwagger struct {
	List  []*Tag
	Pager *app.Pager
}

Jump to

Keyboard shortcuts

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