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

Commit 5e2f4f61 authored by 胡佳晨's avatar 胡佳晨

提交 sweet 二维码 admin sweet

parent 8206e3ed
...@@ -41,19 +41,20 @@ ...@@ -41,19 +41,20 @@
field: 'showNum', field: 'showNum',
title: '展示次数' title: '展示次数'
}, },
{ // {
field: 'readNum', // field: 'readNum',
title: '访问次数' // title: '访问次数'
}, // }
{ // , {
title: '操作', // title: '操作',
align: 'center', // align: 'center',
formatter: function (value, row, index) { // formatter: function (value, row, index) {
var actions = []; // var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.mid + '\')"><i class="fa fa-edit"></i>编辑</a> '); // actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.mid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
return actions.join(''); // return actions.join('');
} // }
}] // }
]
}; };
$.table.init(options); $.table.init(options);
}); });
......
...@@ -29,7 +29,7 @@ public class SweetQrCodeController { ...@@ -29,7 +29,7 @@ public class SweetQrCodeController {
private ISweetActiveTypeService sweetActiveTypeService; private ISweetActiveTypeService sweetActiveTypeService;
@GetMapping("qrCode/type") @GetMapping("qrCode/type")
@ApiOperation("获取答题记录详情") @ApiOperation("获取二维码url")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "int", name = "type", value = "活动type", required = true) @ApiImplicitParam(type = "form", dataType = "int", name = "type", value = "活动type", required = true)
}) })
......
...@@ -19,8 +19,12 @@ public class SweetActiveQrCodeServiceImpl implements ISweetActiveTypeService { ...@@ -19,8 +19,12 @@ public class SweetActiveQrCodeServiceImpl implements ISweetActiveTypeService {
public String getRandomQrCode(int type) { public String getRandomQrCode(int type) {
List<SweetQrCode> sweetQrCodeList = redisDataUtils.getQrCodeTypeNum(type);//SweetQrCodeList List<SweetQrCode> sweetQrCodeList = redisDataUtils.getQrCodeTypeNum(type);//SweetQrCodeList
SweetQrCode bean = judgeRandom(type, sweetQrCodeList); SweetQrCode bean = judgeRandom(type, sweetQrCodeList);
redisDataUtils.incrQrCodeShowNum(type, bean.getQrCodeId());//访问数量 if (bean == null) {
return bean.getUrl(); return "";
} else {
redisDataUtils.incrQrCodeShowNum(type, bean.getQrCodeId());//访问数量
return bean.getUrl();
}
} }
...@@ -31,6 +35,9 @@ public class SweetActiveQrCodeServiceImpl implements ISweetActiveTypeService { ...@@ -31,6 +35,9 @@ public class SweetActiveQrCodeServiceImpl implements ISweetActiveTypeService {
int maxNum = redisDataUtils.getQrCodeMaxNum(type); int maxNum = redisDataUtils.getQrCodeMaxNum(type);
if (showNum >= maxNum) {//超过阈值 if (showNum >= maxNum) {//超过阈值
sweetQrCodeList.remove(randomSwat); sweetQrCodeList.remove(randomSwat);
if (sweetQrCodeList.size() == 0) {
return null;
}
return judgeRandom(type, sweetQrCodeList); return judgeRandom(type, sweetQrCodeList);
} else { } else {
redisDataUtils.setQrCodeDetails(type, sweetQrCodeList); redisDataUtils.setQrCodeDetails(type, sweetQrCodeList);
......
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