model

package
v0.0.0-...-1bfcc7b Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 6 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 BlogPosts

type BlogPosts struct {
	ID             int64     `json:"ID" gorm:"primary_key"` // ID
	CreatedBy      string    `json:"created_by"`            // 创建人
	CreatedOn      time.Time `json:"created_on"`            // 创建时间
	DeletedOn      time.Time `json:"deleted_on"`            // 删除时间
	IsDel          int8      `json:"is_del"`                // 是否删除, 0 未删除, 1 已删除
	PostAuthorId   int64     `json:"post_author_id"`        // 文章作者 ID
	PostAuthorName string    `json:"post_author_name"`      // 文章作者名字
	PostContent    string    `json:"post_content"`          // 文章内容
	PostDesc       string    `json:"post_desc"`             // 文章描述
	PostStatus     int8      `json:"post_status"`           // 文章状态 0: draft, 1: published, 2: private
	PostTitle      string    `json:"post_title"`            // 文章标题
	UpdatedBy      string    `json:"updated_by"`            // 更新人
	UpdatedOn      time.Time `json:"updated_on"`            // 更新时间
}

type BlogPostsTag

type BlogPostsTag struct {
	CreatedBy string    `json:"created_by"` // 创建人
	CreatedOn time.Time `json:"created_on"` // 创建时间
	DeletedOn time.Time `json:"deleted_on"` // 删除时间
	ID        int64     `json:"ID"`         // ID
	IsDel     int8      `json:"is_del"`     // 是否删除, 0 未删除, 1 已删除
	PostId    int64     `json:"post_id"`    // 文章 ID
	TagId     int64     `json:"tag_id"`     // 标签 ID
	UpdatedBy string    `json:"updated_by"` // 更新人
	UpdatedOn time.Time `json:"updated_on"` // 更新时间
}

type BlogTag

type BlogTag struct {
	CreatedBy string    `json:"created_by"` // 创建人
	CreatedOn time.Time `json:"created_on"` // 创建时间
	DeletedOn time.Time `json:"deleted_on"` // 删除时间
	ID        int64     `json:"ID"`         // ID
	IsDel     int8      `json:"is_del"`     // 是否删除, 0 未删除, 1 已删除
	TagName   string    `json:"tag_name"`   // 标签名称
	TagStatus int8      `json:"tag_status"` // 标签状态 0: 禁用, 1: 启用
	UpdatedBy string    `json:"updated_by"` // 更新人
	UpdatedOn time.Time `json:"updated_on"` // 更新时间
}

func (*BlogTag) Count

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

func (*BlogTag) Create

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

func (*BlogTag) Delete

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

func (*BlogTag) First

func (t *BlogTag) First(db *gorm.DB) error

func (*BlogTag) List

func (t *BlogTag) List(db *gorm.DB, offset int, limit int) ([]*BlogTag, error)

func (*BlogTag) TableName

func (t *BlogTag) TableName() string

func (*BlogTag) Update

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

type Model

type Model struct{}

Jump to

Keyboard shortcuts

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