wangkaiyue преди 3 години
родител
ревизия
55e369bb58
променени са 4 файла, в които са добавени 7 реда и са изтрити 4 реда
  1. 0 1
      config/config.go
  2. 3 0
      etc/config.yaml
  3. 0 1
      etc/push.json
  4. 4 2
      handler/activity/lotteryService.go

+ 0 - 1
config/config.go

@@ -66,7 +66,6 @@ type pushConfig struct {
 	DelayedTime int    `json:"delayedTime"`
 	Subvip      string `json:"subvip"`
 	Points      string `json:"points"`
-	ActivityUrl string `json:"activityUrl"`
 }
 
 //var Config *config

+ 3 - 0
etc/config.yaml

@@ -97,3 +97,6 @@ jyactivity: # 临时活动
     reward:
       svip: 7 #赠送超级订阅限制
       limit: 500 #每日数量限制
+
+#优惠券领取及查询接口
+lotteryUrl: https://192.168.3.206:8090

+ 0 - 1
etc/push.json

@@ -29,7 +29,6 @@
       "color": "#686868"
     }
   },
-  "activityUrl": "https://192.168.3.206:8090",
   "testId": "o7Y1g0Rz_1JmNep3lnIU4lfjeooI",
   "delayedTime": 5,
   "subvip": "天超级订阅",

+ 4 - 2
handler/activity/lotteryService.go

@@ -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 {