tools

package
v0.0.0-...-b705d59 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//service
	TenantsService   = "go.micro.srv.tenant"
	LogisticsService = "go.micro.srv.logistics"
	GoodsService     = "go.micro.srv.goods"
	MemberService    = "go.micro.srv.member"
	UiControlService = "go.micro.srv.ui-control"
	PaymentService   = "go.micro.srv.payment"
	OrderService     = "go.micro.srv.order"

	//method
	TenantCreate       = "Tenant.Create"
	TenantUpdate       = "Tenant.Update"
	TenantDelete       = "Tenant.Delete"
	TenantRead         = "Tenant.Read"
	TenantSearch       = "Tenant.Search"
	TenantReadById     = "Tenant.ReadById"
	TenantReadByDomain = "Tenant.ReadByDomain"
	Oauth2Token        = "Oauth2.Token"
	Oauth2Introspect   = "Oauth2.Introspect"
	RoleCreate         = "Role.Create"
	RoleUpdate         = "Role.Update"
	RoleDelete         = "Role.Delete"
	RoleRead           = "Role.Read"
	RoleSearch         = "Role.Search"
	UserCreate         = "User.Create"
	UserUpdate         = "User.Update"
	UserDelete         = "User.Delete"
	UserRead           = "User.Read"
	UserSearch         = "User.Search"
	ConfigCreate       = "Config.Create"
	ConfigUpdate       = "Config.Update"
	ConfigDelete       = "Config.Delete"
	ConfigRead         = "Config.Read"
	ConfigSearch       = "Config.Search"
	//courier
	CourierCreate = "Courier.Create"
	CourierUpdate = "Courier.Update"
	CourierDelete = "Courier.Delete"
	CourierSearch = "Courier.Search"
	CourierRead   = "Courier.Read"
	//courier install
	CourierInstallInstall   = "CourierInstall.Install"
	CourierInstallUpdate    = "CourierInstall.Update"
	CourierInstallUninstall = "CourierInstall.Uninstall"
	CourierInstallSearch    = "CourierInstall.Search"
	CourierInstallRead      = "CourierInstall.Read"
	//courier template
	CourierTempalteCreate = "CourierTemplate.Create"
	CourierTemplateUpdate = "CourierTemplate.Update"
	CourierTemplateDelete = "CourierTemplate.Delete"
	CourierTemplateSearch = "CourierTemplate.Search"
	CourierTemplateRead   = "CourierTemplate.Read"
	//payment
	PaymentCreate = "Payment.Create"
	PaymentUpdate = "Payment.Update"
	PaymentDelete = "Payment.Delete"
	PaymentSearch = "Payment.Search"
	PaymentRead   = "Payment.Read"
	//payment install
	PaymentInstallInstall   = "PaymentInstall.Install"
	PaymentInstallUpdate    = "PaymentInstall.Update"
	PaymentInstallUninstall = "PaymentInstall.Uninstall"
	PaymentInstallSearch    = "PaymentInstall.Search"
	PaymentInstallRead      = "PaymentInstall.Read"
	//payment order
	PaymentOrderCreate        = "PaymentOrder.Create"
	PaymentOrderUpdate        = "PaymentOrder.Update"
	PaymentOrderCallback      = "PaymentOrder.Callback"
	PaymentOrderRead          = "PaymentOrder.Read"
	PaymentOrderReadByOrderId = "PaymentOrder.ReadByOrderId"
	//finance
	FinanceCreate                 = "Finance.Create"
	FinanceChangeOverage          = "Finance.ChangeOverage"
	FinanceFreezeOverage          = "Finance.FreezeOverage"
	FinanceDeductionFreezeOverage = "Finance.DeductionFreezeOverage"
	FinanceChangeGold             = "Finance.ChangeGold"
	FinanceFreezeGold             = "Finance.FreezeGold"
	FinanceDeductionFreezeGold    = "Finance.DeductionFreezeGold"
	FinanceRead                   = "Finance.Read"
	FinanceSearch                 = "Finance.Search"
	FinanceSearchLog              = "Finance.SearchLog"

	CourierLinkCreateBatch  = "CourierLink.CreateBatch"
	CourierLinkGeneratePack = "CourierLink.GeneratePack"
	CourierPackRuleCreate   = "CourierPackRule.Create"
	CourierPackRuleUpdate   = "CourierPackRule.Update"
	CourierPackRuleDelete   = "CourierPackRule.Delete"
	CourierPackRuleSearch   = "CourierPackRule.Search"
	CourierPackRuleRead     = "CourierPackRule.Read"
	BrandCreate             = "Brand.Create"
	BrandUpdate             = "Brand.Update"
	BrandDelete             = "Brand.Delete"
	BrandSearch             = "Brand.Search"
	BrandRead               = "Brand.Read"
	CategoryCreate          = "Category.Create"
	CategoryUpdate          = "Category.Update"
	CategoryDelete          = "Category.Delete"
	CategorySearch          = "Category.Search"
	CategoryRead            = "Category.Read"
	ClassCreate             = "Class.Create"
	ClassUpdate             = "Class.Update"
	ClassDelete             = "Class.Delete"
	ClassSearch             = "Class.Search"
	ClassRead               = "Class.Read"
	GoodsInfoCreate         = "GoodsInfo.Create"
	GoodsInfoUpdate         = "GoodsInfo.Update"
	GoodsInfoDelete         = "GoodsInfo.Delete"
	GoodsInfoSearch         = "GoodsInfo.Search"
	GoodsInfoRead           = "GoodsInfo.Read"
	//goods
	GoodsCreate         = "Goods.Create"
	GoodsUpdate         = "Goods.Update"
	GoodsUpdateOther    = "Goods.UpdateOther"
	GoodsCheckInventory = "Goods.CheckInventory"
	GoodsDelete         = "Goods.Delete"
	GoodsSearch         = "Goods.Search"
	GoodsSearchList     = "Goods.SearchList"
	GoodsList           = "Goods.List"
	GoodsRead           = "Goods.Read"
	GoodsBatchUse       = "Goods.BatchUse"
	GoodsSearchKeyword  = "Goods.SearchKeyword"
	GoodsSearchApp      = "Goods.SearchApp"
	GoodsReadApp        = "Goods.ReadApp"
	//collection
	CollectionCreate = "Collection.Create"
	CollectionCheck  = "Collection.Check"
	CollectionDelete = "Collection.Delete"
	CollectionSearch = "Collection.Search"
	//shopping cart
	ShoppingCartCreate         = "ShoppingCart.Create"
	ShoppingCartUpdate         = "ShoppingCart.Update"
	ShoppingCartCheck          = "ShoppingCart.Check"
	ShoppingCartCheckWarehouse = "ShoppingCart.CheckWarehouse"
	ShoppingCartDelete         = "ShoppingCart.Delete"
	ShoppingCartDeleteSeleted  = "ShoppingCart.DeleteSelected"
	ShoppingCartList           = "ShoppingCart.List"
	//show category
	ShowCategoryCreate          = "ShowCategory.Create"
	ShowCategoryUpdate          = "ShowCategory.Update"
	ShowCategoryDelete          = "ShowCategory.Delete"
	ShowCategorySearch          = "ShowCategory.Search"
	ShowCategoryRead            = "ShowCategory.Read"
	ShowCategorySearchParentApp = "ShowCategory.SearchParentApp"
	ShowCategoryChildrenIds     = "ShowCategory.ChildrenIds"
	ShippingWarehouseCreate     = "ShippingWarehouse.Create"
	ShippingWarehouseUpdate     = "ShippingWarehouse.Update"
	ShippingWarehouseDelete     = "ShippingWarehouse.Delete"
	ShippingWarehouseSearch     = "ShippingWarehouse.Search"
	ShippingWarehouseRead       = "ShippingWarehouse.Read"
	//member level
	MemberLevelCreate = "MemberLevel.Create"
	MemberLevelUpdate = "MemberLevel.Update"
	MemberLevelPatch  = "MemberLevel.Patch"
	MemberLevelDelete = "MemberLevel.Delete"
	MemberLevelSearch = "MemberLevel.Search"
	MemberLevelRead   = "MemberLevel.Read"
	//member
	MemberCreate       = "Member.Create"
	MemberUpdate       = "Member.Update"
	MemberDelete       = "Member.Delete"
	MemberSearch       = "Member.Search"
	MemberRead         = "Member.Read"
	MemberReadByOpenId = "Member.ReadByOpenId"
	MemberRegistry     = "Member.Registry"
	//sender
	SenderCreate = "Sender.Create"
	SenderUpdate = "Sender.Update"
	SenderDelete = "Sender.Delete"
	SenderSearch = "Sender.Search"
	SenderRead   = "Sender.Read"
	//consignee
	ConsigneeCreate      = "Consignee.Create"
	ConsigneeUpdate      = "Consignee.Update"
	ConsigneeDelete      = "Consignee.Delete"
	ConsigneeSearch      = "Consignee.Search"
	ConsigneeRead        = "Consignee.Read"
	ConsigneeReadDefault = "Consignee.ReadDefault"
	//功能圈
	//ui control
	FunctionCircleCreate = "FunctionCircle.Create"
	FunctionCircleUpdate = "FunctionCircle.Update"
	FunctionCircleDelete = "FunctionCircle.Delete"
	FunctionCircleSearch = "FunctionCircle.Search"
	FunctionCircleRead   = "FunctionCircle.Read"
	//订单
	OrderAppCreate        = "OrderApp.Create"
	OrderAppUpdateStatus  = "OrderApp.UpdateStatus"
	OrderAppDelete        = "OrderApp.Delete"
	OrderAppSearch        = "OrderApp.Search"
	OrderAppRead          = "OrderApp.Read"
	OrderAppReadStatus    = "OrderApp.ReadStatus"
	OrderAppUpdateSuccess = "OrderApp.UpdateSuccess"
	//订单包裹
	OrderUnitPackRead   = "OrderUnitPack.Read"
	OrderUnitPackUpdate = "OrderUnitPack.Update"
	//后台订单
	OrderCreate     = "Order.Create"
	OrderUpdate     = "Order.Update"
	OrderDelete     = "Order.Delete"
	OrderSearch     = "Order.Search"
	OrderRead       = "Order.Read"
	OrderUpdatePack = "Order.UpdatePack"
	OrderBatchShip  = "Order.BatchShip"
	OrderCountGroup = "Order.CountGroup"
	//活动
	ActivityCreate     = "Activity.Create"
	ActivityUpdate     = "Activity.Update"
	ActivityDelete     = "Activity.Delete"
	ActivityRead       = "Activity.Read"
	ActivityReadApp    = "Activity.ReadApp"
	ActivitySearch     = "Activity.Search"
	ActivityEnableLink = "Activity.EnableLink"
	ActivityGoodsLink  = "Activity.GoodsLink"
)

Variables

View Source
var (
	Client   client.Client
	Json     = client.WithContentType("application/json")
	Protobuf = client.WithContentType("application/protobuf")
)
View Source
var PaymentMethod = map[string]func(key, secret, appId, image, orderId string, body *royalpay.Body, params1 ...string) (*royalpay.Result, error){
	"RoyalPayWechat": RoyalPayWechat,
	"RoyalPayAlipay": RoyalPayAliapay,
	"WechatVoucher":  Voucher,
	"Overage":        Overage,
	"SandPayAliapay": SandPayAliapay,
	"SandPayWechat":  SandPayWechat,
	"WechatOfficial": WechatOfficial,
}

Functions

func Call

func Call(c context.Context, service, method string, req interface{}, rsp interface{}, reqOpts ...client.RequestOption) error

调取服务

func ExchangeCurrency

func ExchangeCurrency(uri, from, to, key string)

实时汇率查询换算

func Get

func Get(apiURL string, params url.Values) (rs []byte, err error)

get 网络请求

func InitConf

func InitConf()

func Overage

func Overage(key, secret, appId, image, orderId string, body *royalpay.Body, params1 ...string) (result *royalpay.Result, e error)

func Round

func Round(f float64, n int) float64

func RoyalPayAliapay

func RoyalPayAliapay(key, secret, appId, image, orderId string, body *royalpay.Body, params1 ...string) (result *royalpay.Result, e error)

func RoyalPayWechat

func RoyalPayWechat(key, secret, appId, image, orderId string, body *royalpay.Body, params1 ...string) (result *royalpay.Result, e error)

func SandPayAliapay

func SandPayAliapay(key, secret, appId, image, orderId string, body *royalpay.Body, params1 ...string) (result *royalpay.Result, e error)

func SandPayWechat

func SandPayWechat(key, secret, appId, image, orderId string, body *royalpay.Body, params1 ...string) (result *royalpay.Result, e error)

func Voucher

func Voucher(key, secret, appId, image, orderId string, body *royalpay.Body, params1 ...string) (result *royalpay.Result, e error)

func WechatOfficial

func WechatOfficial(key, secret, appId, image, orderId string, body *royalpay.Body, params1 ...string) (result *royalpay.Result, e error)

Types

type AppConfig

type AppConfig struct {
	Wx                Wx   `yaml:"wx"`
	GetSelfSkipVerify bool `yaml:"getSelfSkipVerify"`
}

type AppConfigs

type AppConfigs struct {
	// contains filtered or unexported fields
}
var (
	Conf    map[string]interface{}
	AppConf *AppConfigs
)

func (*AppConfigs) GetAppConfig

func (e *AppConfigs) GetAppConfig(tenantId string) AppConfig

func (*AppConfigs) SetAppConfig

func (e *AppConfigs) SetAppConfig(tenantId string, appConfig AppConfig)

type Currency

type Currency struct {
	CurrencyF     string      `json:"currencyF"`
	CurrencyFName string      `json:"currencyF_Name"`
	CurrencyT     string      `json:"currencyT"`
	CurrencyTName string      `json:"currencyT_Name"`
	CurrencyFD    json.Number `json:"currencyFD"`
	Exchange      json.Number `json:"exchange"`
	Result        float64     `json:"result,string"`
	UpdateTime    time.Time   `json:"updateTime"`
}

type ExchangeCurrencyReturn

type ExchangeCurrencyReturn struct {
	ErrorCode int        `json:"error_code"`
	Reason    string     `json:"reason"`
	Result    []Currency `json:"result"`
}

type Wx

type Wx struct {
	AppId     string `yaml:"appId"`
	AppSecret string `yaml:"appSecret"`
	MchId     string `yaml:"mchId"`
	ApiKey    string `yaml:"apiKey"`
	LoginHost string `yaml:"loginHost"`
}

Jump to

Keyboard shortcuts

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