|
@@ -4,6 +4,8 @@ import (
|
|
|
"app.yhyue.com/moapp/message/config"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
+ "github.com/gogf/gf/v2/os/gcfg"
|
|
|
+ "github.com/gogf/gf/v2/os/gctx"
|
|
|
"io/ioutil"
|
|
|
"log"
|
|
|
"net/http"
|
|
@@ -14,7 +16,7 @@ import (
|
|
|
//ActivityLottery 获取活动下的奖券 receivingLocation 奖券形式0落地页 1付款页 999全部 3 我的奖券 productCode 活动code
|
|
|
func ActivityLottery(userId, appId, receivingLocation, productCode string) (map[string]interface{}, error) {
|
|
|
//url := config.PushConfig.ActivityUrl + "/activityLottery?userId=" + userId + "&appId=" + appId + "&activityId=" + activityId + "&receivingLocation=" + receivingLocation + "&productCode=" + productCode
|
|
|
- url := config.PushConfig.ActivityUrl + "/activityLottery?userId=" + userId + "&appId=" + appId + "&receivingLocation=" + receivingLocation + "&productCode=" + productCode
|
|
|
+ url := gcfg.Instance().MustGet(gctx.New(), "lotteryUrl").String() + "/activityLottery?userId=" + userId + "&appId=" + appId + "&receivingLocation=" + receivingLocation + "&productCode=" + productCode
|
|
|
|
|
|
log.Println(url)
|
|
|
request, err := http.NewRequest("GET", url, nil)
|
|
@@ -37,7 +39,7 @@ func ActivityLottery(userId, appId, receivingLocation, productCode string) (map[
|
|
|
//LotteryReceive 奖卷领取 LotteryIdArr 奖券id 支持多个逗号拼接
|
|
|
func LotteryReceive(lotteryRep config.LotteryReceiveReq) (int, string) {
|
|
|
userNameStr := url2.PathEscape(lotteryRep.UserName)
|
|
|
- url := config.PushConfig.ActivityUrl + "/lotteryReceive?userName=" + userNameStr + "&userId=" + lotteryRep.UserId + "&appId=" + lotteryRep.AppId + "&lotteryIdArr=" + lotteryRep.LotteryIdArr
|
|
|
+ url := gcfg.Instance().MustGet(gctx.New(), "lotteryUrl").String() + "/lotteryReceive?userName=" + userNameStr + "&userId=" + lotteryRep.UserId + "&appId=" + lotteryRep.AppId + "&lotteryIdArr=" + lotteryRep.LotteryIdArr
|
|
|
log.Println(url)
|
|
|
request, err := http.NewRequest("POST", url, nil)
|
|
|
if err != nil {
|