|
@@ -14,8 +14,10 @@ import (
|
|
|
)
|
|
|
|
|
|
//ActivityLottery 获取活动下的奖券 receivingLocation 奖券形式0落地页 1付款页 999全部 3 我的奖券 productCode 活动code
|
|
|
-func ActivityLottery(userId, appId, receivingLocation, productCode string) (map[string]interface{}, error) {
|
|
|
+func ActivityLottery(userId, receivingLocation string) (map[string]interface{}, error) {
|
|
|
//url := config.PushConfig.ActivityUrl + "/activityLottery?userId=" + userId + "&appId=" + appId + "&activityId=" + activityId + "&receivingLocation=" + receivingLocation + "&productCode=" + productCode
|
|
|
+ appId := gcfg.Instance().MustGet(gctx.New(), "appid").String()
|
|
|
+ productCode := gcfg.Instance().MustGet(gctx.New(), "productCode.subscriptionMonth").String()
|
|
|
url := gcfg.Instance().MustGet(gctx.New(), "lotteryUrl").String() + "/activityLottery?userId=" + userId + "&appId=" + appId + "&receivingLocation=" + receivingLocation + "&productCode=" + productCode
|
|
|
|
|
|
log.Println(url)
|
|
@@ -36,10 +38,28 @@ func ActivityLottery(userId, appId, receivingLocation, productCode string) (map[
|
|
|
return info, err
|
|
|
}
|
|
|
|
|
|
+//ActivityUser
|
|
|
+/*func ActivityUser(userId string, model int64) []*activityclient.LotteryJson {
|
|
|
+ appId := gcfg.Instance().MustGet(gctx.New(), "appid").String()
|
|
|
+ //参数结构体
|
|
|
+ activeReq := activityclient.Request{
|
|
|
+ ReceivingLocation: 0,
|
|
|
+ Model: model,
|
|
|
+ UserId: userId,
|
|
|
+ AppId: appId,
|
|
|
+ }
|
|
|
+ //调用卡卷中台rpc 查询此用户下的卡卷信息
|
|
|
+ rpc.UserHarvest = &rpc.UserLottery{}
|
|
|
+ resp := rpc.UserHarvest.HarvestFunc(activeReq)
|
|
|
+ return resp.Data
|
|
|
+}*/
|
|
|
+
|
|
|
//LotteryReceive 奖卷领取 LotteryIdArr 奖券id 支持多个逗号拼接
|
|
|
func LotteryReceive(lotteryRep config.LotteryReceiveReq) (int, string) {
|
|
|
+ appId := gcfg.Instance().MustGet(gctx.New(), "appid").String()
|
|
|
+
|
|
|
userNameStr := url2.PathEscape(lotteryRep.UserName)
|
|
|
- url := gcfg.Instance().MustGet(gctx.New(), "lotteryUrl").String() + "/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=" + appId + "&lotteryIdArr=" + lotteryRep.LotteryIdArr
|
|
|
log.Println(url)
|
|
|
request, err := http.NewRequest("POST", url, nil)
|
|
|
if err != nil {
|