cms

package
v0.0.0-...-a619a86 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cate_Cgid = GUID("7cae5572-02ef-11e7-902f-c07cd130ee8a")
)

Variables

View Source
var (
	Ctx = &CmsCtx{}
)

Functions

func UploadImg

func UploadImg(req *http.Request) io.UrlStatus

Types

type CateInfo

type CateInfo struct {
	Cate  CmsInfo
	Items []CmsInfo
	Total int
}

type CateNode

type CateNode struct {
	Id    gobreak.GUID
	Mc    string
	Ns    string
	Uri   string
	Nodes []*CateNode
}

type CateTree

type CateTree struct {
	Nodes []*CateNode
	// contains filtered or unexported fields
}

func NewCateTree

func NewCateTree() *CateTree

func (*CateTree) Build

func (ct *CateTree) Build(all []CmsInfo)

type CmsCfg

type CmsCfg struct {
}

type CmsCtx

type CmsCtx struct {
	// contains filtered or unexported fields
}

func (*CmsCtx) CateTree

func (c *CmsCtx) CateTree() (tree *CateTree, err error)

func (*CmsCtx) GetCate

func (c *CmsCtx) GetCate(id GUID) (m CmsInfo)

func (*CmsCtx) GetCateByUri

func (c *CmsCtx) GetCateByUri(ns, mc string) (m CmsInfo)

func (*CmsCtx) GetCateInfo

func (c *CmsCtx) GetCateInfo(id GUID, f *filter.PageFilter) (m CateInfo)

func (*CmsCtx) GetInfo

func (c *CmsCtx) GetInfo(id GUID) (m CmsInfo)

func (*CmsCtx) GetTopCateInfoByUri

func (c *CmsCtx) GetTopCateInfoByUri(ns, mc string, n int) (m []CmsInfo)

func (*CmsCtx) Orm

func (c *CmsCtx) Orm() *orm.Orm

func (*CmsCtx) SaveCate

func (c *CmsCtx) SaveCate(m *CmsInfo) error

func (*CmsCtx) SaveInfo

func (c *CmsCtx) SaveInfo(m *CmsInfo) error

func (*CmsCtx) SetOrm

func (c *CmsCtx) SetOrm(orm *orm.Orm)

type CmsFj

type CmsFj struct {
	Mc  string
	Url string
}

func UploadFile

func UploadFile(req *http.Request) (m CmsFj)

type CmsInfo

type CmsInfo struct {
	Id     GUID
	Uid    GUID   //发布者user.id
	Mc     string //名称,主标题
	Qz     int    //权重
	IsCate bool   //是否分类
	Ns     string //分类:树展示路径
	Lx     string //类型?//信息,分类,文件下载,链接,特殊模型(红头文件等)
	Ljdkfs bool   //链接打开方式,Target :_blank
	Zt     string //状态?
	Cjsj   time.Time
	Gxsj   time.Time
	Fbsj   time.Time `json:",omitempty"` //发布时间
	Nr     string    `json:",omitempty"` //内容
	Mc2    string    `json:",omitempty"` //副标题
	Ztp    string    `json:",omitempty"` //主图片,一般用于展示
	Fbdw   string    `json:",omitempty"` //发布单位(信息)
	Zy     string    `json:",omitempty"` //摘要
	Fj     []CmsFj   `json:",omitempty"` //附件列表
	Cates  []GUID    `json:",omitempty"` //分类列表(信息)
	Tags   []string  `json:",omitempty"`
	Bz     string    `json:",omitempty"` // 备注
	Ext    M         `json:",omitempty"`
	Fav    bool
}

func NewCate

func NewCate() *CmsInfo

func NewInfo

func NewInfo(uid GUID, cid GUID) *CmsInfo

func (CmsInfo) GetMc

func (p CmsInfo) GetMc() string

func (CmsInfo) GetNs

func (p CmsInfo) GetNs() string

func (CmsInfo) GetQz

func (p CmsInfo) GetQz() int

func (CmsInfo) GetUri

func (p CmsInfo) GetUri() string

Jump to

Keyboard shortcuts

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