Documentation ¶
Index ¶
- Constants
- Variables
- func AddCategoryType(value, label string)
- func AddClickFlowTarget(name string, target ClickFlowTarget)
- func AddNavigateType(value, label string)
- func CollectionCategoryIDs() func(...uint) []uint
- func CollectionNavigateIDs() func(...uint) []uint
- func FillChildren(list *[]*NavigateExt, children map[uint][]*NavigateExt)
- func FireNavigateUpdate(m *dbschema.OfficialCommonNavigate) error
- func GenActiveDetector(categoryKey string, categoryID uint) func(ctx echo.Context) bool
- func GetAddNavigateTypes() []*echo.KV
- func OnNavigateUpdate(f func(*dbschema.OfficialCommonNavigate) error)
- func TagCond(tag string) db.Compound
- type Area
- func (f *Area) Add() (pk interface{}, err error)
- func (f *Area) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *Area) Exists(name string) (bool, error)
- func (f *Area) ExistsOther(name string, id uint) (bool, error)
- func (f *Area) Parent(pid uint) (*dbschema.OfficialCommonArea, error)
- func (f *Area) Parents(pid uint) ([]*dbschema.OfficialCommonArea, error)
- func (f *Area) PositionIds(id uint) ([]uint, error)
- func (f *Area) Positions(id uint) ([]*dbschema.OfficialCommonArea, error)
- type AreaGroup
- func (f *AreaGroup) Add() (pk interface{}, err error)
- func (f *AreaGroup) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *AreaGroup) Exists(countryAbbr string, abbr string) (bool, error)
- func (f *AreaGroup) ExistsOther(countryAbbr string, abbr string, id uint) (bool, error)
- func (f *AreaGroup) GetWithExt(cond *db.Compounds) (*AreaGroupExt, error)
- func (f *AreaGroup) ListPage(cond *db.Compounds, sorts ...interface{}) ([]*dbschema.OfficialCommonAreaGroup, error)
- func (f *AreaGroup) ListPageWithExt(cond *db.Compounds, sorts ...interface{}) ([]*AreaGroupExt, error)
- type AreaGroupExt
- type Category
- func (f *Category) Add() (pk interface{}, err error)
- func (f *Category) Delete(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *Category) Edit(mw func(db.Result) db.Result, args ...interface{}) (err error)
- func (f *Category) Exists(name string) error
- func (f *Category) ExistsOther(name string, id uint) error
- func (f *Category) FillTo(tg []ICategory) error
- func (f *Category) ListAllParent(typ string, excludeId uint, maxLevels ...uint) []*dbschema.OfficialCommonCategory
- func (f *Category) ListAllParentBy(typ string, excludeId uint, maxLevel uint, extraConds ...db.Compound) []*dbschema.OfficialCommonCategory
- func (f *Category) ListChildren(parentID uint) ([]*dbschema.OfficialCommonCategory, error)
- func (f *Category) ListIndent(categoryList []*dbschema.OfficialCommonCategory) []*dbschema.OfficialCommonCategory
- func (f *Category) MaxLevel() uint
- func (f *Category) Parents(parentID uint) ([]dbschema.OfficialCommonCategory, error)
- func (f *Category) PositionIds(id uint) ([]uint, error)
- func (f *Category) Positions(id uint) ([]dbschema.OfficialCommonCategory, error)
- func (f *Category) UpdateAllChildren(row *dbschema.OfficialCommonCategory) error
- func (f *Category) UpdateAllParents(oldData *dbschema.OfficialCommonCategory) (err error)
- type ClickFlow
- func (f *ClickFlow) Add() (pk interface{}, err error)
- func (f *ClickFlow) DelByTarget(targetType string, targetID uint64) error
- func (f *ClickFlow) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *ClickFlow) Exists(targetType string, targetID uint64, ownerID uint64, ownerType string) (bool, error)
- func (f *ClickFlow) Find(targetType string, targetID uint64, ownerID uint64, ownerType string) error
- type ClickFlowTarget
- type ClickFlowTargetFunc
- type Friendlink
- func (f *Friendlink) Add() (pk interface{}, err error)
- func (f *Friendlink) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *Friendlink) Exists(customerID uint64, url string, host string) (bool, error)
- func (f *Friendlink) ExistsOther(customerID uint64, url string, host string, id uint) (bool, error)
- func (f *Friendlink) IncrReturnCount(id uint) error
- func (f *Friendlink) ListPage(cond *db.Compounds, orderby ...interface{}) ([]*FriendlinkExt, error)
- func (f *Friendlink) ListShowAndRecord(limit int, categoryIds ...uint) ([]*dbschema.OfficialCommonFriendlink, error)
- func (f *Friendlink) RecordReturn() error
- func (f *Friendlink) VerifyFail(id uint) error
- type FriendlinkExt
- type Group
- type GroupAndType
- type ICategory
- type Navigate
- func (f *Navigate) Add() (pk interface{}, err error)
- func (f *Navigate) Delete(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *Navigate) Edit(mw func(db.Result) db.Result, args ...interface{}) (err error)
- func (f *Navigate) Exists(title string, typ string) error
- func (f *Navigate) ExistsOther(title string, typ string, id uint) error
- func (f *Navigate) ListAllParent(typ string, excludeId uint, maxLevels ...uint) []*dbschema.OfficialCommonNavigate
- func (f *Navigate) ListIndent(categoryList []*dbschema.OfficialCommonNavigate) []*dbschema.OfficialCommonNavigate
- func (f *Navigate) MaxLevel() uint
- func (f *Navigate) ParentIds(parentID uint) []uint
- func (f *Navigate) UpdateAllChildren(row *dbschema.OfficialCommonNavigate) error
- func (f *Navigate) UpdateAllParents(oldData *dbschema.OfficialCommonNavigate) (err error)
- type NavigateExt
- func (f *NavigateExt) ClearChildren() *NavigateExt
- func (f *NavigateExt) FetchChildren(forces ...bool) []*NavigateExt
- func (f *NavigateExt) HasChildren() bool
- func (f *NavigateExt) IsActive() bool
- func (f *NavigateExt) IsInside() bool
- func (f *NavigateExt) IsValidURL() bool
- func (f *NavigateExt) SetActiveDetector(fn func(echo.Context) bool) *NavigateExt
- func (f *NavigateExt) SetExtra(extra echo.H) *NavigateExt
- func (f *NavigateExt) SetExtraKV(k string, v interface{}) *NavigateExt
- func (f *NavigateExt) URL() string
- type RoutePage
- type RouteRewrite
- type SourceTableEntry
- type Tags
- func (f *Tags) Add() (pk interface{}, err error)
- func (f *Tags) Clean() (err error)
- func (f *Tags) DecrNum(group string, name []string, n ...int) error
- func (f *Tags) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *Tags) IncrNum(group, name string, n ...int) error
- func (f *Tags) ListByGroup(group string, limit int) []*dbschema.OfficialCommonTags
- func (f *Tags) UpdateTags(createMode bool, group string, oldTags []string, postTags []string, ...) ([]string, error)
Constants ¶
View Source
const ChineseSpace = ` `
ChineseSpace 中文全角空白字符
Variables ¶
View Source
var ( // CategoryMaxLevel 分类最大层数(层从0开始) CategoryMaxLevel uint = 3 //3代表最大允许4层 // CategoryTypes 分类的类别 CategoryTypes = echo.NewKVData() )
View Source
var ClickFlowTargets = map[string]ClickFlowTarget{}
View Source
var (
Contype = echo.NewKVData()
)
View Source
var (
FriendlinkMaxUnsuccessfuls int64 = 5 // 每个用户提交友情链接的最大数量(不包含已经通过的)
)
View Source
var ( //GroupTypes 组类型 GroupTypes = echo.NewKVData(). Add(`customer`, `客户组`). Add(`openapp`, `开放平台应用`). Add(`api`, `外部API`) )
View Source
var ( uint = 3 //3代表最大允许4层 )NavigateMaxLevel
View Source
var ( echo.NewKVData() )NavigateTypes =
View Source
var RoutePageTypes = echo.NewKVData()
View Source
var SourceTables = map[string]*SourceTableEntry{}
SourceTables 来源表集合 used: comment
Functions ¶
func AddClickFlowTarget ¶
func AddClickFlowTarget(name string, target ClickFlowTarget)
func CollectionCategoryIDs ¶
func CollectionNavigateIDs ¶
func FillChildren ¶
func FillChildren(list *[]*NavigateExt, children map[uint][]*NavigateExt)
func FireNavigateUpdate ¶
func FireNavigateUpdate(m *dbschema.OfficialCommonNavigate) error
func GenActiveDetector ¶
func OnNavigateUpdate ¶
func OnNavigateUpdate(f func(*dbschema.OfficialCommonNavigate) error)
Types ¶
type Area ¶
type Area struct {
*dbschema.OfficialCommonArea
}
type AreaGroup ¶
type AreaGroup struct {
*dbschema.OfficialCommonAreaGroup
}
func NewAreaGroup ¶
func (*AreaGroup) ExistsOther ¶
func (*AreaGroup) GetWithExt ¶
func (f *AreaGroup) GetWithExt(cond *db.Compounds) (*AreaGroupExt, error)
func (*AreaGroup) ListPageWithExt ¶
func (f *AreaGroup) ListPageWithExt(cond *db.Compounds, sorts ...interface{}) ([]*AreaGroupExt, error)
type AreaGroupExt ¶
type AreaGroupExt struct { *dbschema.OfficialCommonAreaGroup Areas []*dbschema.OfficialCommonArea `db:"-,relation=id:area_ids|notEmpty|split"` }
type Category ¶
type Category struct { *dbschema.OfficialCommonCategory // contains filtered or unexported fields }
func NewCategory ¶
func (*Category) ListAllParent ¶
func (*Category) ListAllParentBy ¶
func (*Category) ListChildren ¶
func (f *Category) ListChildren(parentID uint) ([]*dbschema.OfficialCommonCategory, error)
ListChildren 查询子分类
func (*Category) ListIndent ¶
func (f *Category) ListIndent(categoryList []*dbschema.OfficialCommonCategory) []*dbschema.OfficialCommonCategory
func (*Category) Parents ¶
func (f *Category) Parents(parentID uint) ([]dbschema.OfficialCommonCategory, error)
func (*Category) Positions ¶
func (f *Category) Positions(id uint) ([]dbschema.OfficialCommonCategory, error)
func (*Category) UpdateAllChildren ¶
func (f *Category) UpdateAllChildren(row *dbschema.OfficialCommonCategory) error
UpdateAllChildren 更新所有子孙分类level值
func (*Category) UpdateAllParents ¶
func (f *Category) UpdateAllParents(oldData *dbschema.OfficialCommonCategory) (err error)
UpdateAllParents 更新所有父级分类(目前仅仅用于更新父级has_child值)
type ClickFlow ¶
type ClickFlow struct {
*dbschema.OfficialCommonClickFlow
}
func NewClickFlow ¶
func (*ClickFlow) DelByTarget ¶
type ClickFlowTarget ¶
type ClickFlowTargetFunc ¶
type Friendlink ¶
type Friendlink struct {
*dbschema.OfficialCommonFriendlink
}
func NewFriendlink ¶
func NewFriendlink(ctx echo.Context) *Friendlink
func (*Friendlink) Add ¶
func (f *Friendlink) Add() (pk interface{}, err error)
func (*Friendlink) ExistsOther ¶
func (*Friendlink) IncrReturnCount ¶
func (f *Friendlink) IncrReturnCount(id uint) error
func (*Friendlink) ListPage ¶
func (f *Friendlink) ListPage(cond *db.Compounds, orderby ...interface{}) ([]*FriendlinkExt, error)
func (*Friendlink) ListShowAndRecord ¶
func (f *Friendlink) ListShowAndRecord(limit int, categoryIds ...uint) ([]*dbschema.OfficialCommonFriendlink, error)
ListShowAndRecord 前台列表显示,并记录回调
func (*Friendlink) RecordReturn ¶
func (f *Friendlink) RecordReturn() error
func (*Friendlink) VerifyFail ¶
func (f *Friendlink) VerifyFail(id uint) error
type FriendlinkExt ¶
type FriendlinkExt struct { *dbschema.OfficialCommonFriendlink Category *dbschema.OfficialCommonCategory `db:"-,relation=id:category_id|gtZero"` }
type Group ¶
type Group struct {
*dbschema.OfficialCommonGroup
}
type GroupAndType ¶
type GroupAndType struct { *dbschema.OfficialCommonGroup Type *echo.KV }
type Navigate ¶
type Navigate struct { // contains filtered or unexported fields }
func NewNavigate ¶
func (*Navigate) ExistsOther ¶
func (*Navigate) ListAllParent ¶
func (*Navigate) ListIndent ¶
func (f *Navigate) ListIndent(categoryList []*dbschema.OfficialCommonNavigate) []*dbschema.OfficialCommonNavigate
func (*Navigate) UpdateAllChildren ¶
func (f *Navigate) UpdateAllChildren(row *dbschema.OfficialCommonNavigate) error
UpdateAllChildren 更新所有子孙分类level值
func (*Navigate) UpdateAllParents ¶
func (f *Navigate) UpdateAllParents(oldData *dbschema.OfficialCommonNavigate) (err error)
UpdateAllParents 更新所有父级分类(目前仅仅用于更新父级has_child值)
type NavigateExt ¶
type NavigateExt struct { // contains filtered or unexported fields }
func NewNavigateExt ¶
func NewNavigateExt(nav *dbschema.OfficialCommonNavigate) *NavigateExt
func (*NavigateExt) ClearChildren ¶
func (f *NavigateExt) ClearChildren() *NavigateExt
func (*NavigateExt) FetchChildren ¶
func (f *NavigateExt) FetchChildren(forces ...bool) []*NavigateExt
func (*NavigateExt) HasChildren ¶
func (f *NavigateExt) HasChildren() bool
func (*NavigateExt) IsActive ¶
func (f *NavigateExt) IsActive() bool
func (*NavigateExt) IsInside ¶
func (f *NavigateExt) IsInside() bool
func (*NavigateExt) IsValidURL ¶
func (f *NavigateExt) IsValidURL() bool
func (*NavigateExt) SetActiveDetector ¶
func (f *NavigateExt) SetActiveDetector(fn func(echo.Context) bool) *NavigateExt
func (*NavigateExt) SetExtra ¶
func (f *NavigateExt) SetExtra(extra echo.H) *NavigateExt
func (*NavigateExt) SetExtraKV ¶
func (f *NavigateExt) SetExtraKV(k string, v interface{}) *NavigateExt
func (*NavigateExt) URL ¶
func (f *NavigateExt) URL() string
type RoutePage ¶
type RoutePage struct {
*dbschema.OfficialCommonRoutePage
}
func NewRoutePage ¶
type RouteRewrite ¶ added in v0.2.0
type RouteRewrite struct {
*dbschema.OfficialCommonRouteRewrite
}
func NewRouteRewrite ¶ added in v0.2.0
func NewRouteRewrite(ctx echo.Context) *RouteRewrite
func (*RouteRewrite) Add ¶ added in v0.2.0
func (f *RouteRewrite) Add() (pk interface{}, err error)
type SourceTableEntry ¶
type SourceTableEntry struct { // Name 名称 Name string // QueryKVAndDetailURL 查询id和名称以及详情页网址 // H: echo.H{ // `detailURL`: `%v`, //}, QueryKVAndDetailURL func(ctx echo.Context, sourceIDs []string) echo.KVList // QueryBought 查询是否购买过 QueryBought func(ctx echo.Context, sourceID string, customerID []uint64) (map[uint64]bool, error) }
SourceTableEntry 来源表项
type Tags ¶
type Tags struct {
*dbschema.OfficialCommonTags
}
func (*Tags) ListByGroup ¶
func (f *Tags) ListByGroup(group string, limit int) []*dbschema.OfficialCommonTags
Source Files ¶
Click to show internal directories.
Click to hide internal directories.