aec184ec by joe

分享增加次数

1 parent c5a6e046
......@@ -35,6 +35,8 @@ import java.util.Map;
@RestController
public class ScoreLogInfoController {
public static Integer share_time = 1;
final String keySecret = "33974941d83111e78cda7cd30abdaa16";
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -118,8 +120,8 @@ public class ScoreLogInfoController {
MessageEntity.Builder builder = new MessageEntity.Builder(request);
long l = this.scoreLogInfoService.countToDay(openid);
long s = this.scoreLogInfoService.shareToday(openid);
if (s > 5) {
s = 5;
if (s > share_time) {
s = share_time;
}
ConfigInfo configInfo = configInfoMapper.get();
Long maxTime = configInfo.getMaxTime();
......@@ -200,4 +202,11 @@ public class ScoreLogInfoController {
return builder.success(true).code("2000").create();
}
@RequestMapping("/setShareTime")
public MessageEntity setShareTime(HttpServletRequest request, @RequestParam Integer shareTime) {
if (shareTime != null && shareTime > 0)
ScoreLogInfoController.share_time = shareTime;
return null;
}
}
\ No newline at end of file
......
package com.example.service;
import com.example.controller.ScoreLogInfoController;
import com.example.mapper.ConfigInfoMapper;
import com.example.mapper.ScoreLogInfoMapper;
import com.example.mapper.ShareLogMapper;
......@@ -48,8 +49,8 @@ public class ScoreLogInfoServiceImpl implements ScoreLogInfoService {
}else{
long count = this.countToDay(scoreLogInfo.getOpenid());
long s = this.shareToday(scoreLogInfo.getOpenid());
if (s > 5) {
s = 5;
if (s > ScoreLogInfoController.share_time) {
s = ScoreLogInfoController.share_time;
}
if(count - s >= maxTime){
code = "9902";
......