根据配置项判断是否启用看广告体现
This commit is contained in:
@@ -6,6 +6,8 @@ import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.annotation.Login;
|
||||
import com.sqx.modules.app.service.UserMoneyDetailsService;
|
||||
import com.sqx.modules.common.entity.CommonInfo;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
import com.sqx.modules.pay.entity.CashOut;
|
||||
import com.sqx.modules.pay.service.CashOutService;
|
||||
import com.sqx.modules.pay.service.PayDetailsService;
|
||||
@@ -25,7 +27,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
@Api(value = "提现", tags = {"提现"})
|
||||
@RequestMapping(value = "/app/cash")
|
||||
public class AppCashController {
|
||||
private final RedisService redisService;
|
||||
private final CommonInfoService commonInfoService;
|
||||
private final RedisService redisService;
|
||||
/**
|
||||
* 提现记录
|
||||
*/
|
||||
@@ -36,7 +39,8 @@ private final RedisService redisService;
|
||||
@Autowired
|
||||
private UserMoneyDetailsService userMoneyDetailsService;
|
||||
|
||||
public AppCashController(RedisService redisService) {
|
||||
public AppCashController(CommonInfoService commonInfoService, RedisService redisService) {
|
||||
this.commonInfoService = commonInfoService;
|
||||
this.redisService = redisService;
|
||||
}
|
||||
|
||||
@@ -51,6 +55,10 @@ private final RedisService redisService;
|
||||
@Login
|
||||
@GetMapping("/canCash")
|
||||
public Result canCash(@RequestAttribute("userId") Long userId) {
|
||||
CommonInfo info = commonInfoService.findOne(928);
|
||||
if ("0".equals(info.getValue())) {
|
||||
return Result.success().put("data", true);
|
||||
}
|
||||
return Result.success().put("data", redisService.isCanCash(userId));
|
||||
}
|
||||
|
||||
@@ -61,7 +69,10 @@ private final RedisService redisService;
|
||||
public Result withdraw(@RequestAttribute("userId") Long userId, Double amount) {
|
||||
boolean canCash = redisService.isCanCash(userId);
|
||||
if (!canCash) {
|
||||
return Result.error("您未观看激励广告,清先观看");
|
||||
CommonInfo info = commonInfoService.findOne(928);
|
||||
if ("1".equals(info.getValue())) {
|
||||
return Result.error("您未观看激励广告,清先观看");
|
||||
}
|
||||
}
|
||||
return cashOutService.withdraw(userId, amount, null, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user