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

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

提交 sweet 二维码 admin sweet

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