aa
This commit is contained in:
@@ -1966,7 +1966,7 @@ func GetUnionActList(ctx *jxcontext.Context, vendorID, actType int) (actList []*
|
||||
return actList, err
|
||||
}
|
||||
|
||||
func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType int) (link string, err error) {
|
||||
func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resourceType int) (link string, err error) {
|
||||
var (
|
||||
job = &model.Job{}
|
||||
db = dao.GetDB()
|
||||
@@ -2012,7 +2012,7 @@ func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType int) (lin
|
||||
}
|
||||
//2、分享链接
|
||||
if handler != nil {
|
||||
if link, err = handler.ShareUnionLink(ctx, linkType, job.UnionActID, sid, userID); err == nil {
|
||||
if link, err = handler.ShareUnionLink(ctx, linkType, job.UnionActID, sid, userID, resourceType); err == nil {
|
||||
if vendorID == model.VendorIDMTWM || vendorID == model.VendorIDTB {
|
||||
if linkType == partner.LinkTypeWeiXinMini {
|
||||
if resBinary, _, err := jxutils.DownloadFileByURL(link + "?imageView2/1/w/150/h/150/q/75"); err == nil {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string) (link string, err error) {
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error) {
|
||||
if linkType == partner.LinkTypeWeiXinMini {
|
||||
if qrCode, err := api.MtUnionAPI.MiniCode(unionActID, sID); err == nil {
|
||||
if qrCode != "" {
|
||||
|
||||
@@ -45,7 +45,7 @@ func init() {
|
||||
}
|
||||
|
||||
type UnionInterface interface {
|
||||
ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string) (link string, err error)
|
||||
ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error)
|
||||
GetUnionActList(ctx *jxcontext.Context, actType int) (result []*ActivityList, err error)
|
||||
CreateUnionPosition(ctx *jxcontext.Context, userID string) (sID string, err error)
|
||||
//GetUnionCouponList(ctx *jxcontext.Context)
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
package pdd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"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/globals/api"
|
||||
)
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string) (link string, err error) {
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error) {
|
||||
if result, err := api.PddAPI.ResourceURLGen(sID, resourceType); err == nil {
|
||||
switch linkType {
|
||||
case partner.LinkTypeWeiXinMini:
|
||||
return "", err
|
||||
case partner.LinTypeH5:
|
||||
return result.SingleURLList.URL, err
|
||||
case partner.LinTypeWx:
|
||||
return result.WeAppInfo.PagePath, err
|
||||
default:
|
||||
return link, fmt.Errorf("暂不支持此链接类型!")
|
||||
}
|
||||
}
|
||||
return link, err
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string) (link string, err error) {
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error) {
|
||||
if result, err2 := api.TbUnionAPI.ActivityInfoGet(userID, utils.Int2Str(unionActID), utils.Str2Int64(sID)); err2 == nil {
|
||||
switch linkType {
|
||||
case partner.LinkTypeWeiXinMini:
|
||||
|
||||
@@ -571,13 +571,14 @@ func (c *JobController) GetUnionActList() {
|
||||
// @Param token header string true "认证token"
|
||||
// @Param jobID formData int false "任务ID"
|
||||
// @Param shareType formData int true "分享类型,1为当前用户分享给别人,2为当前用户自己领取"
|
||||
// @Param resourceType formData int false "资源类型"
|
||||
// @Param linkType formData int true "链接类型,1 h5链接 2 deeplink(唤起)链接 3 中间页唤起链接 4 微信小程序唤起路径, 5为小程序二维码"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /ShareUnionLink [post]
|
||||
func (c *JobController) ShareUnionLink() {
|
||||
c.callShareUnionLink(func(params *tJobShareUnionLinkParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.ShareUnionLink(params.Ctx, params.JobID, params.ShareType, params.LinkType)
|
||||
retVal, err = cms.ShareUnionLink(params.Ctx, params.JobID, params.ShareType, params.LinkType, params.ResourceType)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user