diff --git a/ms-biz/src/main/java/com/ms/biz/spi/timer/TestSendMsgService.java b/ms-biz/src/main/java/com/ms/biz/spi/timer/TestSendMsgService.java new file mode 100644 index 0000000..126e8b5 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/spi/timer/TestSendMsgService.java @@ -0,0 +1,39 @@ +package com.ms.biz.spi.timer; + +import com.doudian.open.utils.StringUtil; +import com.jinritemai.cloud.base.api.BaseRequest; +import com.jinritemai.cloud.base.api.BaseResponse; +import com.jinritemai.cloud.base.api.ExtensionService; +import com.jinritemai.cloud.base.api.ExtensionServiceHandler; +import com.jinritemai.cloud.base.core.util.AuthThreadLocalUtil; +import com.ms.api.dto.ShopInfoDao; +import com.ms.biz.common.R; +import com.ms.biz.common.Ret; +import com.ms.biz.common.TimerBaseService; +import com.ms.biz.service.DoudianMsgService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.List; + +@ExtensionService("testSendMsg") +@Slf4j +public class TestSendMsgService extends TimerBaseService implements ExtensionServiceHandler { + @Autowired + private DoudianMsgService doudianMsgService; + + @Override + public BaseResponse handle(BaseRequest req) { + String shopId = req.getData().getShopId(); + if (StringUtil.isEmpty(shopId)) { + shopId = "4463798"; + } + AuthThreadLocalUtil.set(shopId); + + List msgList = new ArrayList<>(); + msgList.add("{\"tag\":\"16000\",\"msg_id\":\"57088508275362107630:037250343:16000:1709036986:1925842976:7290512081592305208\",\"data\":\"{\\\"cargo_id\\\":3658552585478095162,\\\"event_time\\\":1709036986,\\\"product_id\\\":3670126357280588075,\\\"shop_id\\\":37250343}\"}"); + doudianMsgService.receiveMessages(msgList); + return R.ok(Ret.success()); + } +} diff --git a/ms-biz/src/main/java/com/ms/biz/tool/DfJsonRequestTemplate.java b/ms-biz/src/main/java/com/ms/biz/tool/DfJsonRequestTemplate.java index 970673d..a9c007d 100644 --- a/ms-biz/src/main/java/com/ms/biz/tool/DfJsonRequestTemplate.java +++ b/ms-biz/src/main/java/com/ms/biz/tool/DfJsonRequestTemplate.java @@ -42,8 +42,8 @@ public class DfJsonRequestTemplate { dfHost = dfHostProd; dfToken = dfTokenProd; } else { - dfHost = dfHostTest; - dfToken = dfTokenTest; + dfHost = dfHostProd; + dfToken = dfTokenProd; } } System.out.println(dfHost + url);