记得上下班打卡 | git大法好,push需谨慎

Commit 41df72c5 authored by 胡佳晨's avatar 胡佳晨

抽奖数据迁移

parent 8930b3f7
......@@ -11,10 +11,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -75,6 +72,24 @@ public class SweetDataController {
}
}
@PostMapping("drawLuck")
@ApiOperation("增加可中奖数量1最大6(20210820)")
public ResponseDto<Boolean> luckDrawAllAdd() {
try {
String redisKey = SweetConstant.REDIS_KEY_SWEET_LUCK_DRAW_ALL.concat("20210820");
int count = (int) redisUtil.get(redisKey);
if (count >= 6) {
redisUtil.set(redisKey, 6);
} else {
redisUtil.incr(redisKey, 1);
}
return ResponseDto.success();
}catch (Exception e){
e.printStackTrace();
return ResponseDto.failure();
}
}
private void presentRedis(String mobile) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_LUCK_DRAW_PRESENT_MOBILE.concat(mobile);
Object obj = redisUtil.get(redisKey);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment