model

package
v0.0.0-...-ad78615 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBEngine

func NewDBEngine(databaseSetting *setting.DatabaseSettingS) (*gorm.DB, error)

Types

type Article

type Article struct {
	*Model
	Title         string `json:"title"`
	Desc          string `json:"desc"`
	Content       string `json:"content"`
	CoverImageUrl string `json:"cover_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     uint32 `json:"tag_id"`
	ArticleID uint32 `json:"article_id"`
}

func (ArticleTag) TableName

func (a ArticleTag) TableName() string

type Auth

type Auth struct {
	*Model
	AppKey    string `json:"app_key"`
	AppSecret string `json:"app_secret"`
}

func (Auth) Get

func (a Auth) Get(db *gorm.DB) (Auth, error)

func (Auth) TableName

func (a Auth) TableName() string

type Model

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

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 int, 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