posts

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostCategoryStateEnabled  = 1 // 已启用
	PostCategoryStateDisabled = 0 // 已禁用
)
View Source
const (
	PostCategoryField_Id    dbs.FieldName = "id"    // ID
	PostCategoryField_Name  dbs.FieldName = "name"  // 分类名称
	PostCategoryField_IsOn  dbs.FieldName = "isOn"  // 是否启用
	PostCategoryField_Code  dbs.FieldName = "code"  // 代号
	PostCategoryField_Order dbs.FieldName = "order" // 排序
	PostCategoryField_State dbs.FieldName = "state" // 分类状态
)
View Source
const (
	PostStateEnabled  = 1 // 已启用
	PostStateDisabled = 0 // 已禁用
)
View Source
const (
	PostField_Id          dbs.FieldName = "id"          // ID
	PostField_CategoryId  dbs.FieldName = "categoryId"  // 文章分类
	PostField_Type        dbs.FieldName = "type"        // 类型:normal, url
	PostField_Url         dbs.FieldName = "url"         // URL
	PostField_Subject     dbs.FieldName = "subject"     // 标题
	PostField_Body        dbs.FieldName = "body"        // 内容
	PostField_CreatedAt   dbs.FieldName = "createdAt"   // 创建时间
	PostField_IsPublished dbs.FieldName = "isPublished" // 是否已发布
	PostField_PublishedAt dbs.FieldName = "publishedAt" // 发布时间
	PostField_ProductCode dbs.FieldName = "productCode" // 产品代号
	PostField_State       dbs.FieldName = "state"       // 状态
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	Id          uint32 `field:"id"`          // ID
	CategoryId  uint32 `field:"categoryId"`  // 文章分类
	Type        string `field:"type"`        // 类型:normal, url
	Url         string `field:"url"`         // URL
	Subject     string `field:"subject"`     // 标题
	Body        string `field:"body"`        // 内容
	CreatedAt   uint64 `field:"createdAt"`   // 创建时间
	IsPublished bool   `field:"isPublished"` // 是否已发布
	PublishedAt uint64 `field:"publishedAt"` // 发布时间
	ProductCode string `field:"productCode"` // 产品代号
	State       uint8  `field:"state"`       // 状态
}

Post 文章管理

type PostCategory

type PostCategory struct {
	Id    uint32 `field:"id"`    // ID
	Name  string `field:"name"`  // 分类名称
	IsOn  bool   `field:"isOn"`  // 是否启用
	Code  string `field:"code"`  // 代号
	Order uint32 `field:"order"` // 排序
	State uint8  `field:"state"` // 分类状态
}

PostCategory 文章分类

type PostCategoryDAO

type PostCategoryDAO dbs.DAO
var SharedPostCategoryDAO *PostCategoryDAO

func NewPostCategoryDAO

func NewPostCategoryDAO() *PostCategoryDAO

func (*PostCategoryDAO) DisablePostCategory

func (this *PostCategoryDAO) DisablePostCategory(tx *dbs.Tx, categoryId int64) error

DisablePostCategory 禁用条目

func (*PostCategoryDAO) EnablePostCategory

func (this *PostCategoryDAO) EnablePostCategory(tx *dbs.Tx, categoryId int64) error

EnablePostCategory 启用条目

func (*PostCategoryDAO) FindEnabledPostCategory

func (this *PostCategoryDAO) FindEnabledPostCategory(tx *dbs.Tx, categoryId int64) (*PostCategory, error)

FindEnabledPostCategory 查找启用中的条目

func (*PostCategoryDAO) FindPostCategoryName

func (this *PostCategoryDAO) FindPostCategoryName(tx *dbs.Tx, categoryId int64) (string, error)

FindPostCategoryName 根据主键查找名称

type PostCategoryOperator

type PostCategoryOperator struct {
	Id    any // ID
	Name  any // 分类名称
	IsOn  any // 是否启用
	Code  any // 代号
	Order any // 排序
	State any // 分类状态
}

func NewPostCategoryOperator

func NewPostCategoryOperator() *PostCategoryOperator

type PostDAO

type PostDAO dbs.DAO
var SharedPostDAO *PostDAO

func NewPostDAO

func NewPostDAO() *PostDAO

func (*PostDAO) DisablePost

func (this *PostDAO) DisablePost(tx *dbs.Tx, postId int64) error

DisablePost 禁用条目

func (*PostDAO) EnablePost

func (this *PostDAO) EnablePost(tx *dbs.Tx, postId int64) error

EnablePost 启用条目

func (*PostDAO) FindEnabledPost

func (this *PostDAO) FindEnabledPost(tx *dbs.Tx, postId int64) (*Post, error)

FindEnabledPost 查找启用中的条目

type PostOperator

type PostOperator struct {
	Id          any // ID
	CategoryId  any // 文章分类
	Type        any // 类型:normal, url
	Url         any // URL
	Subject     any // 标题
	Body        any // 内容
	CreatedAt   any // 创建时间
	IsPublished any // 是否已发布
	PublishedAt any // 发布时间
	ProductCode any // 产品代号
	State       any // 状态
}

func NewPostOperator

func NewPostOperator() *PostOperator

Jump to

Keyboard shortcuts

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