aa
This commit is contained in:
@@ -108,6 +108,9 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
||||
model.VendorIDPDD: map[int]interface{}{
|
||||
1: "进行中的活动",
|
||||
},
|
||||
model.VendorIDJDShop: map[int]interface{}{
|
||||
2: "进行中",
|
||||
},
|
||||
},
|
||||
"unionOrderStatusName": model.UnionOrderStatusName,
|
||||
},
|
||||
|
||||
27
business/jxstore/partner/jds/jds.go
Normal file
27
business/jxstore/partner/jds/jds.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package jds
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdunionapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
type UnionHandler struct {
|
||||
}
|
||||
|
||||
var (
|
||||
unionHandler *UnionHandler
|
||||
)
|
||||
|
||||
func init() {
|
||||
partner.UnionHandlerMap[model.VendorIDJDShop] = unionHandler
|
||||
}
|
||||
|
||||
func getAPI() (apiobj *jdunionapi.API) {
|
||||
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdunionCookie", model.ConfigTypeCookie, ""); err == nil {
|
||||
api.JdUnionAPI.SetCookieWithStr(configs[0].Value)
|
||||
}
|
||||
return api.JdUnionAPI
|
||||
}
|
||||
@@ -1,29 +1,34 @@
|
||||
package jds
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
type UnionHandler struct {
|
||||
}
|
||||
|
||||
var (
|
||||
unionHandler *UnionHandler
|
||||
)
|
||||
|
||||
func init() {
|
||||
partner.UnionHandlerMap[model.VendorIDJDShop] = unionHandler
|
||||
}
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int, goodsID string) (link string, err error) {
|
||||
|
||||
return "jds", err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (actList []*partner.ActivityList, err error) {
|
||||
return
|
||||
if result, err2 := getAPI().ListActivitys(); err2 == nil {
|
||||
for _, v := range result {
|
||||
act := &partner.ActivityList{
|
||||
ActID: v.Activityid,
|
||||
ActName: v.Activityname,
|
||||
ActDes: v.Remark,
|
||||
Ratio: "11%",
|
||||
Img: v.Imageurl,
|
||||
}
|
||||
act.DateBegin = utils.Str2Time(v.Activitystartdate)
|
||||
act.DateEnd = utils.Str2Time(v.Activityenddate)
|
||||
actList = append(actList, act)
|
||||
}
|
||||
} else {
|
||||
err = err2
|
||||
}
|
||||
return actList, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) CreateUnionPosition(ctx *jxcontext.Context, userID string) (sID string, err error) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdunionapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/pddapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tbunionapi"
|
||||
"io/ioutil"
|
||||
@@ -47,6 +48,7 @@ var (
|
||||
MtUnionAPI *mtunionapi.API
|
||||
TbUnionAPI *tbunionapi.API
|
||||
PddAPI *pddapi.API
|
||||
JdUnionAPI *jdunionapi.API
|
||||
|
||||
JdEclpAPI *jdeclpapi.API
|
||||
JdShopAPI *jdshopapi.API
|
||||
@@ -93,6 +95,7 @@ func Init() {
|
||||
MtUnionAPI = mtunionapi.New(beego.AppConfig.DefaultString("mtUnionAppKey", ""), beego.AppConfig.DefaultString("mtUnionAppSecret", ""))
|
||||
TbUnionAPI = tbunionapi.New(beego.AppConfig.DefaultString("tbUnionAppKey", ""), beego.AppConfig.DefaultString("tbUnionAppSecret", ""))
|
||||
PddAPI = pddapi.New(beego.AppConfig.DefaultString("pddAppKey", ""), beego.AppConfig.DefaultString("pddAppSecret", ""))
|
||||
JdUnionAPI = jdunionapi.New(beego.AppConfig.DefaultString("jdUnionAppKey", ""), beego.AppConfig.DefaultString("jdUnionAppSecret", ""))
|
||||
|
||||
if !beego.AppConfig.DefaultBool("disableJdEclp", false) {
|
||||
JdEclpAPI = jdeclpapi.New(beego.AppConfig.String("jdEclpAccessToken"), beego.AppConfig.String("jdEclpAppKey"), beego.AppConfig.String("jdEclpAppSecret"))
|
||||
|
||||
Reference in New Issue
Block a user