【fix sonar】DemoLockTest文件

This commit is contained in:
梁琦涛
2023-03-16 14:26:24 +08:00
parent 1d8fbda91e
commit 256a703204
@@ -1,16 +1,14 @@
package com.jero.modules.cloud.lock; package com.jero.modules.cloud.lock;
import com.jero.boot.starter.lock.annotation.JLock; import com.jero.boot.starter.lock.annotation.JLock;
import lombok.extern.slf4j.Slf4j;
import com.jero.boot.starter.lock.client.RedissonLockClient; import com.jero.boot.starter.lock.client.RedissonLockClient;
import com.jero.boot.starter.rabbitmq.client.RabbitMqClient; import com.jero.boot.starter.rabbitmq.client.RabbitMqClient;
import com.jero.common.base.BaseMap; import com.jero.common.base.BaseMap;
import com.jero.modules.cloud.constant.CloudConstant; import com.jero.modules.cloud.constant.CloudConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
@@ -34,7 +32,7 @@ public class DemoLockTest {
log.info("执行execute任务开始,休眠三秒"); log.info("执行execute任务开始,休眠三秒");
Thread.sleep(3000); Thread.sleep(3000);
log.info("=======================业务逻辑1============================="); log.info("=======================业务逻辑1=============================");
Map map = new BaseMap(); Map<String,Object> map = new BaseMap();
map.put("orderId", "BJ0001"); map.put("orderId", "BJ0001");
rabbitMqClient.sendMessage(CloudConstant.MQ_JERO_PLACE_ORDER, map); rabbitMqClient.sendMessage(CloudConstant.MQ_JERO_PLACE_ORDER, map);
//延迟10秒发送 //延迟10秒发送
@@ -44,6 +42,7 @@ public class DemoLockTest {
} }
public DemoLockTest() { public DemoLockTest() {
// do other
} }
/** /**