提现必须观看广告激励
This commit is contained in:
parent
c9b9bb1a58
commit
6ab171aa28
|
|
@ -97,6 +97,7 @@ public class UniAdCallbackRecordServiceImpl extends ServiceImpl<UniAdCallbackRec
|
|||
return respData;
|
||||
}
|
||||
|
||||
|
||||
UserEntity userEntity = userDao.selectById(callBackDTO.getUser_id());
|
||||
if (userEntity == null) {
|
||||
callbackRecord.setErrMsg("用户不存在");
|
||||
|
|
@ -106,16 +107,22 @@ public class UniAdCallbackRecordServiceImpl extends ServiceImpl<UniAdCallbackRec
|
|||
return respData;
|
||||
}
|
||||
|
||||
CommonInfo info = commonInfoDao.findOne(921);
|
||||
if (info == null || StrUtil.isBlank(info.getValue())){
|
||||
callbackRecord.setErrMsg("CommonInfo时长时间未配置");
|
||||
log.warn(getBaseErrInfo(callbackRecord));
|
||||
save(callbackRecord);
|
||||
respData.put("isValid", false);
|
||||
return respData;
|
||||
if (!callBackDTO.getExtra().contains("cash")) {
|
||||
CommonInfo info = commonInfoDao.findOne(921);
|
||||
if (info == null || StrUtil.isBlank(info.getValue())){
|
||||
callbackRecord.setErrMsg("CommonInfo时长时间未配置");
|
||||
log.warn(getBaseErrInfo(callbackRecord));
|
||||
save(callbackRecord);
|
||||
respData.put("isValid", false);
|
||||
return respData;
|
||||
}
|
||||
|
||||
redisService.setFreeWatchTime(callbackRecord.getUserId(), Integer.parseInt(info.getValue()) * 60, true);
|
||||
}else {
|
||||
redisService.setCanCashFlag(userEntity.getUserId(), callbackRecord.getId());
|
||||
}
|
||||
|
||||
redisService.setFreeWatchTime(callbackRecord.getUserId(), Integer.parseInt(info.getValue()) * 60, true);
|
||||
|
||||
save(callbackRecord);
|
||||
respData.put("isValid", true);
|
||||
return respData;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.sqx.modules.app.service.UserMoneyDetailsService;
|
|||
import com.sqx.modules.pay.entity.CashOut;
|
||||
import com.sqx.modules.pay.service.CashOutService;
|
||||
import com.sqx.modules.pay.service.PayDetailsService;
|
||||
import com.sqx.modules.redisService.RedisService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -24,7 +25,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
@Api(value = "提现", tags = {"提现"})
|
||||
@RequestMapping(value = "/app/cash")
|
||||
public class AppCashController {
|
||||
|
||||
private final RedisService redisService;
|
||||
/**
|
||||
* 提现记录
|
||||
*/
|
||||
|
|
@ -35,6 +36,10 @@ public class AppCashController {
|
|||
@Autowired
|
||||
private UserMoneyDetailsService userMoneyDetailsService;
|
||||
|
||||
public AppCashController(RedisService redisService) {
|
||||
this.redisService = redisService;
|
||||
}
|
||||
|
||||
|
||||
@Login
|
||||
@GetMapping(value = "/cashMoney")
|
||||
|
|
@ -43,11 +48,21 @@ public class AppCashController {
|
|||
return cashOutService.cashMoney(userId, money);
|
||||
}
|
||||
|
||||
@Login
|
||||
@GetMapping("/canCash")
|
||||
public Result canCash(@RequestAttribute("userId") Long userId) {
|
||||
return Result.success().put("data", redisService.isCanCash(userId));
|
||||
}
|
||||
|
||||
@Login
|
||||
@GetMapping(value = "/withdraw")
|
||||
@Debounce(interval = 3000, value = "#userId")
|
||||
@ApiOperation("发起提现 余额 金钱")
|
||||
public Result withdraw(@RequestAttribute("userId") Long userId, Double amount) {
|
||||
boolean canCash = redisService.isCanCash(userId);
|
||||
if (!canCash) {
|
||||
return Result.error("您未观看激励广告,清先观看");
|
||||
}
|
||||
return cashOutService.withdraw(userId, amount, null, false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,4 +65,5 @@ public interface CashOutService {
|
|||
Map<String,Object> alipayTransferSummaryQuery(String alipayAccountName);
|
||||
|
||||
Result batchCashOutOrder(Double maxMoney, Integer count);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -735,6 +735,7 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
|||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
private void batchSendCashMoney(List<Long> userIds, Double maxMoney, Integer count, int len) {
|
||||
if (CollUtil.isEmpty(userIds)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -27,4 +27,7 @@ public interface RedisService {
|
|||
int getCourseWeekPayCount(long courseId);
|
||||
|
||||
|
||||
void setCanCashFlag(Long userId, Long id);
|
||||
|
||||
boolean isCanCash(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,4 +329,17 @@ public class RedisServiceImpl implements RedisService {
|
|||
redisUtils.set(key, i, -1);
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCanCashFlag(Long userId, Long id) {
|
||||
String key = "cash:canCash:" + userId;
|
||||
redisUtils.set(key, id, 30);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCanCash(Long userId) {
|
||||
String key = "cash:canCash:" + userId;
|
||||
String s = redisUtils.get(key);
|
||||
return StrUtil.isNotBlank(s);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue