Documentation ¶
Index ¶
- Constants
- Variables
- func AddCategoryType(value, label string)
- func AddClickFlowTarget(name string, target ClickFlowTarget)
- func AddCollectionTarget(name string, title string, targetDo CollectionTargetDo, ...)
- func AddNavigateType(value, label string)
- func AddTagGroup(group string, title 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 MakeOperator(isCancel ...bool) string
- func OnNavigateUpdate(f func(*dbschema.OfficialCommonNavigate) error)
- func SortCategoryByParent(list []*dbschema.OfficialCommonCategory) []*dbschema.OfficialCommonCategory
- 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) DelByTargetOwner(targetType string, targetID uint64, ownerID uint64, ownerType string) 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
- func (f *ClickFlow) ListByAdminTargets(targetType string, targetIDs []uint64, adminUID uint) (map[uint64]*dbschema.OfficialCommonClickFlow, error)
- func (f *ClickFlow) ListByCustomerTargets(targetType string, targetIDs []uint64, customerID uint64) (map[uint64]*dbschema.OfficialCommonClickFlow, error)
- func (f *ClickFlow) ListByTargets(targetType string, targetIDs []uint64, customerID uint64, adminUID uint) (map[uint64]*dbschema.OfficialCommonClickFlow, error)
- func (f *ClickFlow) NewestTimeByCustomerID(targetType string, targetID uint64, ownerID uint64, ownerType string) (uint, error)
- type ClickFlowTarget
- type ClickFlowTargetFunc
- type ClickFlowTargetInfo
- type Collection
- func (f *Collection) Add() (pk interface{}, err error)
- func (f *Collection) DelByTarget(targetType string, targetID uint64) error
- func (f *Collection) DelByTargetOwner(targetType string, targetID uint64, customerID uint64) error
- func (f *Collection) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *Collection) Exists(targetType string, targetID uint64, customerID uint64) (bool, error)
- func (f *Collection) Find(targetType string, targetID uint64, customerID uint64) error
- func (f *Collection) ListByTargets(targetType string, targetIDs []uint64, customerID uint64) (map[uint64]*dbschema.OfficialCommonCollection, error)
- func (f *Collection) ListPage(targetType string, customerID uint64, title string, sorts ...interface{}) ([]*CollectionResponse, error)
- func (f *Collection) ListPageByOffset(targetType string, customerID uint64, title string, sorts ...interface{}) ([]*CollectionResponse, error)
- func (f *Collection) NewestTimeByCustomerID(targetType string, targetID uint64, customerID uint64) (uint, error)
- type CollectionResponse
- type CollectionTarget
- func (c CollectionTarget) Do(ctx echo.Context, id interface{}) (after func(isCancel ...bool) error, infoGetter func() CollectionTargetInfo, ...)
- func (c CollectionTarget) HasDo() bool
- func (c CollectionTarget) HasList() bool
- func (c CollectionTarget) List(ctx echo.Context, rows []*CollectionResponse, targetIDs []uint64) ([]*CollectionResponse, error)
- type CollectionTargetDo
- type CollectionTargetDoFunc
- type CollectionTargetInfo
- type CollectionTargetList
- type CollectionTargetListFunc
- 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) Init() *NavigateExt
- 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(group string, oldTags []string, postTags []string, disallowCreateTags ...bool) ([]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 CollectionTargets = map[string]CollectionTarget{}
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
View Source
var ( // TagGroups 标签组 TagGroups = echo.NewKVData() )
Functions ¶
func AddClickFlowTarget ¶
func AddClickFlowTarget(name string, target ClickFlowTarget)
func AddCollectionTarget ¶
func AddCollectionTarget(name string, title string, targetDo CollectionTargetDo, targetList CollectionTargetList)
func AddTagGroup ¶
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 MakeOperator ¶
func OnNavigateUpdate ¶
func OnNavigateUpdate(f func(*dbschema.OfficialCommonNavigate) error)
func SortCategoryByParent ¶
func SortCategoryByParent(list []*dbschema.OfficialCommonCategory) []*dbschema.OfficialCommonCategory
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 ¶
func (*ClickFlow) DelByTargetOwner ¶
func (*ClickFlow) ListByAdminTargets ¶
func (*ClickFlow) ListByCustomerTargets ¶
func (*ClickFlow) ListByTargets ¶
type ClickFlowTarget ¶
type ClickFlowTargetFunc ¶
type ClickFlowTargetFunc func(ctx echo.Context, id interface{}) (after func(typ string, isCancel ...bool) error, infoGetter func() ClickFlowTargetInfo, err error)
func (ClickFlowTargetFunc) Do ¶
func (c ClickFlowTargetFunc) Do(ctx echo.Context, id interface{}) (after func(typ string, isCancel ...bool) error, infoGetter func() ClickFlowTargetInfo, err error)
type ClickFlowTargetInfo ¶
type Collection ¶
type Collection struct {
*dbschema.OfficialCommonCollection
}
func NewCollection ¶
func NewCollection(ctx echo.Context) *Collection
func (*Collection) Add ¶
func (f *Collection) Add() (pk interface{}, err error)
func (*Collection) DelByTarget ¶
func (f *Collection) DelByTarget(targetType string, targetID uint64) error
func (*Collection) DelByTargetOwner ¶
func (f *Collection) DelByTargetOwner(targetType string, targetID uint64, customerID uint64) error
func (*Collection) Find ¶
func (f *Collection) Find(targetType string, targetID uint64, customerID uint64) error
func (*Collection) ListByTargets ¶
func (f *Collection) ListByTargets(targetType string, targetIDs []uint64, customerID uint64) (map[uint64]*dbschema.OfficialCommonCollection, error)
func (*Collection) ListPage ¶
func (f *Collection) ListPage(targetType string, customerID uint64, title string, sorts ...interface{}) ([]*CollectionResponse, error)
func (*Collection) ListPageByOffset ¶
func (f *Collection) ListPageByOffset(targetType string, customerID uint64, title string, sorts ...interface{}) ([]*CollectionResponse, error)
func (*Collection) NewestTimeByCustomerID ¶
type CollectionResponse ¶
type CollectionResponse struct { *dbschema.OfficialCommonCollection Title string `db:"-" json:"title" xml:"title"` URL string `db:"-" json:"url" xml:"url"` Extra echo.H `db:"-" json:"extra,omitempty" xml:"extra,omitempty"` }
func (*CollectionResponse) Set ¶
func (c *CollectionResponse) Set(key interface{}, value ...interface{})
type CollectionTarget ¶
type CollectionTarget struct { Title string // contains filtered or unexported fields }
func (CollectionTarget) Do ¶
func (c CollectionTarget) Do(ctx echo.Context, id interface{}) (after func(isCancel ...bool) error, infoGetter func() CollectionTargetInfo, err error)
func (CollectionTarget) HasDo ¶
func (c CollectionTarget) HasDo() bool
func (CollectionTarget) HasList ¶
func (c CollectionTarget) HasList() bool
func (CollectionTarget) List ¶
func (c CollectionTarget) List(ctx echo.Context, rows []*CollectionResponse, targetIDs []uint64) ([]*CollectionResponse, error)
type CollectionTargetDo ¶
type CollectionTargetDoFunc ¶
type CollectionTargetDoFunc func(ctx echo.Context, id interface{}) (after func(isCancel ...bool) error, infoGetter func() CollectionTargetInfo, err error)
func (CollectionTargetDoFunc) Do ¶
func (c CollectionTargetDoFunc) Do(ctx echo.Context, id interface{}) (after func(isCancel ...bool) error, infoGetter func() CollectionTargetInfo, err error)
type CollectionTargetInfo ¶
type CollectionTargetList ¶
type CollectionTargetList interface {
List(ctx echo.Context, rows []*CollectionResponse, targetIDs []uint64) ([]*CollectionResponse, error)
}
type CollectionTargetListFunc ¶
type CollectionTargetListFunc func(ctx echo.Context, rows []*CollectionResponse, targetIDs []uint64) ([]*CollectionResponse, error)
func (CollectionTargetListFunc) List ¶
func (c CollectionTargetListFunc) List(ctx echo.Context, rows []*CollectionResponse, targetIDs []uint64) ([]*CollectionResponse, error)
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) Init ¶
func (f *NavigateExt) Init() *NavigateExt
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 ¶
type RouteRewrite struct {
*dbschema.OfficialCommonRouteRewrite
}
func NewRouteRewrite ¶
func NewRouteRewrite(ctx echo.Context) *RouteRewrite
func (*RouteRewrite) Add ¶
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 ¶
- area.go
- area_group.go
- area_group_ext.go
- category.go
- category_ext.go
- click_flow.go
- click_flow_ext.go
- collection.go
- collection_ext.go
- enum.go
- friendlink.go
- friendlink_ext.go
- group.go
- group_ext.go
- navigate.go
- navigate_ext.go
- navigate_type.go
- route_page.go
- route_rewrite.go
- source_tables.go
- tags.go
- tags_ext.go
Click to show internal directories.
Click to hide internal directories.