提现必须观看广告激励
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user