diff --git a/ms-api/src/main/java/com/ms/api/dto/ShopInfoDao.java b/ms-api/src/main/java/com/ms/api/dto/ShopInfoDao.java new file mode 100644 index 0000000..9206b16 --- /dev/null +++ b/ms-api/src/main/java/com/ms/api/dto/ShopInfoDao.java @@ -0,0 +1,8 @@ +package com.ms.api.dto; + +import lombok.Data; + +@Data +public class ShopInfoDao { + private String shopId; +} diff --git a/ms-biz/src/main/java/com/ms/biz/spi/timer/GetAuthInfoTimerService.java b/ms-biz/src/main/java/com/ms/biz/spi/timer/GetAuthInfoTimerService.java index e32d3a9..0ff389a 100644 --- a/ms-biz/src/main/java/com/ms/biz/spi/timer/GetAuthInfoTimerService.java +++ b/ms-biz/src/main/java/com/ms/biz/spi/timer/GetAuthInfoTimerService.java @@ -1,26 +1,40 @@ package com.ms.biz.spi.timer; +import com.alibaba.fastjson.JSONObject; +import com.doudian.open.api.open_getAuthInfo.data.OpenGetAuthInfoData; +import com.doudian.open.api.open_getAuthInfo.param.OpenGetAuthInfoParam; +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.ms.api.dto.ItemDTO; +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.task.GetAuthInfoTaskService; +import com.ms.biz.util.DDApi; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; + +import java.util.HashMap; +import java.util.Map; @ExtensionService("getAuthInfoTimer") @Slf4j -public class GetAuthInfoTimerService extends TimerBaseService implements ExtensionServiceHandler { - @Autowired - GetAuthInfoTaskService getAuthInfoTaskService; - +public class GetAuthInfoTimerService extends TimerBaseService implements ExtensionServiceHandler { @Override - public BaseResponse handle(BaseRequest req) { - getAuthInfoTaskService.runTask(); - return R.ok(Ret.success()); + public BaseResponse handle(BaseRequest req) { + String shopId = req.getData().getShopId(); + if (StringUtil.isEmpty(shopId)) { + shopId = "4463798"; + } + AuthThreadLocalUtil.set(shopId); + OpenGetAuthInfoParam param = new OpenGetAuthInfoParam(); + param.setAuthId(shopId); + OpenGetAuthInfoData data = DDApi.getAuthInfo(param); + log.info("GetAuthInfoServiceļ¼š" + JSONObject.toJSONString(data)); + Map result = new HashMap<>(); + result.put("result", JSONObject.toJSONString(data)); + return R.ok(Ret.success(result)); } }