|
|
@@ -209,11 +209,30 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
return addProductIntegral(config.getIntegralProduct(),user.getUserId(),user.getIntegral());
|
|
|
case 2:
|
|
|
return addVideoIntegral(config.getIntegralFirstVideo(),config.getIntegralFinishVideo(),user.getUserId(),user.getIntegral());
|
|
|
+ case 3:
|
|
|
+ return addGameIntegral(param.getIntegral(),user.getUserId(),user.getIntegral());
|
|
|
}
|
|
|
}
|
|
|
return R.error("用户信息不存在");
|
|
|
}
|
|
|
|
|
|
+ public R addGameIntegral(Long integral,Long userId,Long userIntegral) {
|
|
|
+ FsUser userMap=new FsUser();
|
|
|
+ userMap.setUserId(userId);
|
|
|
+ userMap.setIntegral(userIntegral+integral);
|
|
|
+ fsUserMapper.updateFsUser(userMap);
|
|
|
+ FsUserIntegralLogs integralLogs = new FsUserIntegralLogs();
|
|
|
+ integralLogs.setIntegral(integral);
|
|
|
+ integralLogs.setUserId(userId);
|
|
|
+ integralLogs.setBalance(userMap.getIntegral());
|
|
|
+ integralLogs.setLogType(FsUserIntegralLogTypeEnum.TYPE_29.getValue());
|
|
|
+ integralLogs.setCreateTime(new Date());
|
|
|
+ if (fsUserIntegralLogsMapper.insertFsUserIntegralLogs(integralLogs)>0){
|
|
|
+ return R.ok("玩游戏获得"+integral+"积分");
|
|
|
+ }
|
|
|
+ return R.error("获取积分失败");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 更新积分通用
|
|
|
* @param param
|