Skip to content

Commit

Permalink
add 旅行后 领取每日首次分享耐力10 (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
adminkk authored Mar 16, 2024
1 parent d312c43 commit ecedc46
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,27 @@ public void receiveReward(IUser iUser){
}
}

public void shareReward(IUser iUser){
logger.info("「领取每日首次分享获取耐力」:"+iUser.getMobile());
String url = "https://h5.moutai519.com.cn/game/xmTravel/shareReward";
HttpRequest request = HttpUtil.createRequest(Method.POST, url);

request.header("MT-Device-ID", iUser.getDeviceId())
.header("MT-APP-Version", getMTVersion())
.header("User-Agent", "iOS;16.3;Apple;?unrecognized?")
.header("MT-Lat", iUser.getLat())
.header("MT-Lng", iUser.getLng())
.cookie("MT-Token-Wap=" + iUser.getCookie() + ";MT-Device-ID-Wap=" + iUser.getDeviceId() + ";");

HttpResponse execute = request.execute();
JSONObject body = JSONObject.parseObject(execute.body());

if(body.getInteger("code") != 2000){
String message = "领取每日首次分享获取耐力失败";
throw new ServiceException(message);
}
}

//获取申购耐力值
@Override
public String getEnergyAward(IUser iUser) {
Expand Down Expand Up @@ -314,6 +335,8 @@ public String travelReward(IUser iUser) {
Double travelRewardXmy = getXmTravelReward(iUser);
// 获取小茅运
receiveReward(iUser);
//首次分享获取耐力
shareReward(iUser);
//本次旅行奖励领取后, 当月实际剩余旅行奖励
if (travelRewardXmy > currentPeriodCanConvertXmyNum) {
String message = "当月无可领取奖励";
Expand Down

0 comments on commit ecedc46

Please sign in to comment.