抽奖 获取抽奖次数
This commit is contained in:
@@ -24,9 +24,7 @@ import com.sqx.modules.pay.service.CashOutService;
|
|||||||
import com.sqx.modules.pay.wuyou.BaseResp;
|
import com.sqx.modules.pay.wuyou.BaseResp;
|
||||||
import com.sqx.modules.pay.wuyou.WuyouPay;
|
import com.sqx.modules.pay.wuyou.WuyouPay;
|
||||||
import com.sqx.modules.utils.AliPayOrderUtil;
|
import com.sqx.modules.utils.AliPayOrderUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.*;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -127,14 +125,22 @@ public class DiscSpinningController {
|
|||||||
@Login
|
@Login
|
||||||
@GetMapping("/app/discSpinning/drawCount")
|
@GetMapping("/app/discSpinning/drawCount")
|
||||||
@ApiOperation("获取大转盘抽奖机会")
|
@ApiOperation("获取大转盘抽奖机会")
|
||||||
@ApiModelProperty
|
@ApiResponse(code = 200, message = "" +
|
||||||
|
"{\n" +
|
||||||
|
"\t\"sum\":总抽奖次数,\n" +
|
||||||
|
"\t\"count\":可抽奖次数\n" +
|
||||||
|
"}", response = Map.class)
|
||||||
public Result drawCount(@RequestAttribute("userId") Long userId) {
|
public Result drawCount(@RequestAttribute("userId") Long userId) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
int drawCount = Integer.parseInt(commonRepository.findOne(901).getValue());
|
int drawCount = Integer.parseInt(commonRepository.findOne(901).getValue());
|
||||||
|
map.put("sum",drawCount);
|
||||||
int i = recordService.countDraw(userId);
|
int i = recordService.countDraw(userId);
|
||||||
if (drawCount - i > 0) {
|
if (drawCount - i > 0) {
|
||||||
return new Result().put("data", ordersService.selectOrdersCountStatisticsByDay(userId, drawCount - i));
|
map.put("count",ordersService.selectOrdersCountStatisticsByDay(userId, drawCount - i));
|
||||||
|
return Result.success(map);
|
||||||
} else {
|
} else {
|
||||||
return new Result().put("data", 0);
|
map.put("count",0);
|
||||||
|
return Result.success(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user