This commit is contained in:
苏尹岚
2021-04-01 16:09:45 +08:00
parent 6235597ba6
commit f9ff953e0a
5 changed files with 42 additions and 10 deletions

View File

@@ -8,6 +8,8 @@ import (
"sync"
"time"
"git.rosy.net.cn/jx-callback/business/jxstore/vendor"
"git.rosy.net.cn/jx-callback/business/jxstore/event"
"git.rosy.net.cn/baseapi/platformapi/txcloudapi"
@@ -1921,7 +1923,7 @@ func TempJob() (err error) {
return err
}
func ShareUnionLink(ctx *jxcontext.Context, linkType int) (err error) {
func ShareUnionLink(ctx *jxcontext.Context, vendorID, linkType int) (err error) {
vendor.GetHandler(vendorID).ShareUnionLink(ctx, linkType)
return err
}

View File

@@ -1 +1,17 @@
package jds
import (
"git.rosy.net.cn/jx-callback/business/jxstore/vendor"
"git.rosy.net.cn/jx-callback/business/model"
)
type UnionHandler struct {
}
var (
UnionInterfaceHandler vendor.UnionInterface
)
func init() {
vendor.HandlerMap[model.VendorIDJDShop] = UnionInterfaceHandler
}

View File

@@ -3,6 +3,7 @@ package mt
import (
"git.rosy.net.cn/jx-callback/business/jxstore/vendor"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/model"
)
type UnionHandler struct {
@@ -10,11 +11,13 @@ type UnionHandler struct {
var (
UnionInterfaceHandler vendor.UnionInterface
UnionHandlerObj = &UnionHandler{}
)
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType int) (err error) {
UnionInterfaceHandler = UnionHandlerObj
return err
func init() {
vendor.HandlerMap[model.VendorIDMTWM] = UnionInterfaceHandler
}
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType int) (link string, err error) {
return link, err
}

View File

@@ -4,11 +4,23 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
)
var (
HandlerMap map[int]UnionInterface
)
const (
LinkTypeWeiXinMini = 1 //微信小程序
LinkTypeH5 = 2 //H5
)
type UnionInterface interface {
ShareUnionLink(ctx *jxcontext.Context, linkType int) (err error)
func init() {
HandlerMap = make(map[int]UnionInterface)
}
type UnionInterface interface {
ShareUnionLink(ctx *jxcontext.Context, linkType int) (link string, err error)
}
func GetHandler(vendorID int) UnionInterface {
return HandlerMap[vendorID]
}

View File

@@ -49,7 +49,6 @@ const (
VendorIDAutonavi = 321 // 高德导航
VendorIDQiNiuCloud = 323 // 七牛云
VendorIDShowAPI = 325 // 万维易源
)
type VendorInfo struct {