xcommon

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCustomerAddClosed           = errors.New(`已关闭`)
	ErrCustomerRoleDisabled        = errors.New(`当前角色未开启此功能`)
	ErrCustomerAddMaxPerDay        = errors.New(`已达到今日最大数量`)
	ErrCustomerAddMaxPending       = errors.New(`待审核数量已达上限`)
	ErrCustomerAddMaxPendingPerDay = errors.New(`待审核数量已达今日上限`)
)
View Source
var (
	BackendURL = common.BackendURL
)
View Source
var CurrencySymbols = map[string]string{
	`CNY`: `¥`,
	`USD`: `$`,
	`JPY`: `¥`,
	`EUR`: `€`,
	`GBP`: `£`,
	`FRF`: `₣`,
	`KRW`: `₩`,
	`RUB`: `₽`,
	`HKD`: `HK$`,
	`AUD`: `A$`,
	`CAD`: `C$`,
	`INR`: `₹`,
}

CurrencySymbols 货币符号

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 DefaultCurrency added in v0.2.9

func DefaultCurrency() string

DefaultCurrency 默认币种

func DefaultCurrencySymbol added in v0.2.9

func DefaultCurrencySymbol() string

DefaultCurrencySymbol 默认币种符号

func FrontendAssetsURL

func FrontendAssetsURL(ctx echo.Context) string

func FrontendURL

func FrontendURL(ctx echo.Context) string

func HTMLCurrency added in v0.2.9

func HTMLCurrency(ctx echo.Context, v float64, withFlags ...bool) interface{}

HTMLCurrency HTML模板函数:币种

func HTMLCurrencySymbol added in v0.2.9

func HTMLCurrencySymbol(ctx echo.Context) template.HTML

HTMLCurrencySymbol HTML模板函数:币种符号

func SetCurrencySymbol added in v0.2.9

func SetCurrencySymbol(currency string, symbol string)

SetCurrencySymbol 登记货币符号

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"`
}

func (*ConfigCustomerAdd) Combine added in v0.2.19

func (c *ConfigCustomerAdd) Combine(source interface{}) interface{}

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