xcommon

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCustomerAddClosed           = errors.New(`已关闭`)
	ErrCustomerAddMaxPerDay        = errors.New(`已达到今日最大数量`)
	ErrCustomerAddMaxPending       = errors.New(`待审核数量已达上限`)
	ErrCustomerAddMaxPendingPerDay = errors.New(`待审核数量已达今日上限`)
)
View Source
var (
	BackendURL = common.BackendURL
)

Functions

func BackendAssetsURL

func BackendAssetsURL(ctx echo.Context) string

func CheckGlobalCustomerAdd

func CheckGlobalCustomerAdd(ctx echo.Context, customerID interface{}, typ string, counter CustomerAddedCounter) error

func CheckRoleCustomerAdd

func CheckRoleCustomerAdd(ctx echo.Context, permission *xrole.RolePermission, behaviorName string, customerID interface{}, counter CustomerAddedCounter) error

func FrontendAssetsURL

func FrontendAssetsURL(ctx echo.Context) string

func FrontendURL

func FrontendURL(ctx echo.Context) string

func SiteName

func SiteName() string

func SiteSlogan

func SiteSlogan() string

func SiteURL

func SiteURL(ctx echo.Context) string

Types

type ConfigCustomerAdd

type ConfigCustomerAdd struct {
	MaxPerDay        int64 `json:"maxPerDay"`
	MaxPending       int64 `json:"maxPending"`
	MaxPendingPerDay int64 `json:"maxPendingPerDay"`
}

type CustomerAddedCounter

type CustomerAddedCounter interface {
	CustomerTodayCount(uid interface{}) (int64, error)
	CustomerPendingCount(uid interface{}) (int64, error)
	CustomerPendingTodayCount(uid interface{}) (int64, error)
}

Jump to

Keyboard shortcuts

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