Skip to content

Commit

Permalink
代码规范度问题处理,注释补充。
Browse files Browse the repository at this point in the history
  • Loading branch information
chopper711 committed Jun 9, 2021
1 parent b30a55e commit f720134
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ PS:单独部署的话,数据库文件访问这里:https://gitee.com/beijing_

2.禁止将本开源的代码和资源进行任何形式任何名义的出售.

3.限制商用,如果需要商业使用请联系我们。QQ3409056806.
3.软件受国家计算机软件著作权保护(登记号:2021SR0805085)。

4.限制商用,如果需要商业使用请联系我们。QQ3409056806.


### 交流群

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import cn.lili.modules.payment.kit.enums.PaymentClientEnum;
import cn.lili.modules.payment.kit.enums.PaymentMethodEnum;
import cn.lili.modules.payment.kit.params.dto.CashierParam;
import cn.lili.modules.payment.service.PaymentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
Expand All @@ -33,8 +32,6 @@ public class CashierController {

@Autowired
private CashierSupport cashierSupport;
@Autowired
private PaymentService paymentService;


@ApiImplicitParams({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void addDelay(TimeTriggerMsg timeTriggerMsg, int delayTime) {
String generateKey = TimeTriggerUtil.generateKey(timeTriggerMsg.getTriggerExecutor(), timeTriggerMsg.getTriggerTime(), uniqueKey);
this.cache.put(generateKey, 1);
//设置延时任务
if (Boolean.TRUE.equals(promotionDelayQueue.addJobId(JSONUtil.toJsonStr(timeTriggerMsg), delayTime))) {
if (Boolean.TRUE.equals(promotionDelayQueue.addJob(JSONUtil.toJsonStr(timeTriggerMsg), delayTime))) {
log.info("add Redis key {}", generateKey);
log.info("定时执行在【" + DateUtil.toString(timeTriggerMsg.getTriggerTime(), "yyyy-MM-dd HH:mm:ss") + "】,消费【" + timeTriggerMsg.getParam().toString() + "】");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ public abstract class AbstractDelayQueueMachineFactory {
* @param time 延时时间(单位 :秒)
* @return 是否插入成功
*/
public boolean addJobId(String jobId, Integer time) {
public boolean addJob(String jobId, Integer time) {
//获取时间
Calendar instance = Calendar.getInstance();
instance.add(Calendar.SECOND, time);
long delaySeconds = instance.getTimeInMillis() / 1000;
//增加延时任务 参数依次为:队列名称、执行时间、任务id
boolean result = cache.zAdd(setDelayQueueName(), delaySeconds, jobId);
log.info("增加延时任务, 缓存key {}, 等待时间 {}", setDelayQueueName(), time);
return result;
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<module>seller-api</module>
<module>common-api</module>
<module>consumer</module>
<module>admin</module>
</modules>


Expand Down

0 comments on commit f720134

Please sign in to comment.