分享增加次数
Showing
2 changed files
with
14 additions
and
4 deletions
... | @@ -35,6 +35,8 @@ import java.util.Map; | ... | @@ -35,6 +35,8 @@ import java.util.Map; |
35 | @RestController | 35 | @RestController |
36 | public class ScoreLogInfoController { | 36 | public class ScoreLogInfoController { |
37 | 37 | ||
38 | public static Integer share_time = 1; | ||
39 | |||
38 | final String keySecret = "33974941d83111e78cda7cd30abdaa16"; | 40 | final String keySecret = "33974941d83111e78cda7cd30abdaa16"; |
39 | 41 | ||
40 | private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 42 | private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
... | @@ -118,8 +120,8 @@ public class ScoreLogInfoController { | ... | @@ -118,8 +120,8 @@ public class ScoreLogInfoController { |
118 | MessageEntity.Builder builder = new MessageEntity.Builder(request); | 120 | MessageEntity.Builder builder = new MessageEntity.Builder(request); |
119 | long l = this.scoreLogInfoService.countToDay(openid); | 121 | long l = this.scoreLogInfoService.countToDay(openid); |
120 | long s = this.scoreLogInfoService.shareToday(openid); | 122 | long s = this.scoreLogInfoService.shareToday(openid); |
121 | if (s > 5) { | 123 | if (s > share_time) { |
122 | s = 5; | 124 | s = share_time; |
123 | } | 125 | } |
124 | ConfigInfo configInfo = configInfoMapper.get(); | 126 | ConfigInfo configInfo = configInfoMapper.get(); |
125 | Long maxTime = configInfo.getMaxTime(); | 127 | Long maxTime = configInfo.getMaxTime(); |
... | @@ -200,4 +202,11 @@ public class ScoreLogInfoController { | ... | @@ -200,4 +202,11 @@ public class ScoreLogInfoController { |
200 | return builder.success(true).code("2000").create(); | 202 | return builder.success(true).code("2000").create(); |
201 | } | 203 | } |
202 | 204 | ||
205 | @RequestMapping("/setShareTime") | ||
206 | public MessageEntity setShareTime(HttpServletRequest request, @RequestParam Integer shareTime) { | ||
207 | if (shareTime != null && shareTime > 0) | ||
208 | ScoreLogInfoController.share_time = shareTime; | ||
209 | return null; | ||
210 | } | ||
211 | |||
203 | } | 212 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | package com.example.service; | 1 | package com.example.service; |
2 | 2 | ||
3 | import com.example.controller.ScoreLogInfoController; | ||
3 | import com.example.mapper.ConfigInfoMapper; | 4 | import com.example.mapper.ConfigInfoMapper; |
4 | import com.example.mapper.ScoreLogInfoMapper; | 5 | import com.example.mapper.ScoreLogInfoMapper; |
5 | import com.example.mapper.ShareLogMapper; | 6 | import com.example.mapper.ShareLogMapper; |
... | @@ -48,8 +49,8 @@ public class ScoreLogInfoServiceImpl implements ScoreLogInfoService { | ... | @@ -48,8 +49,8 @@ public class ScoreLogInfoServiceImpl implements ScoreLogInfoService { |
48 | }else{ | 49 | }else{ |
49 | long count = this.countToDay(scoreLogInfo.getOpenid()); | 50 | long count = this.countToDay(scoreLogInfo.getOpenid()); |
50 | long s = this.shareToday(scoreLogInfo.getOpenid()); | 51 | long s = this.shareToday(scoreLogInfo.getOpenid()); |
51 | if (s > 5) { | 52 | if (s > ScoreLogInfoController.share_time) { |
52 | s = 5; | 53 | s = ScoreLogInfoController.share_time; |
53 | } | 54 | } |
54 | if(count - s >= maxTime){ | 55 | if(count - s >= maxTime){ |
55 | code = "9902"; | 56 | code = "9902"; | ... | ... |
-
Please register or sign in to post a comment