记得上下班打卡 | git大法好,push需谨慎

Commit 4c118c46 authored by 张国柄's avatar 张国柄

+券发放JOB调度;

parent 6e5ca16e
package com.liquidnet.service.feign.platform.task;
import com.liquidnet.service.base.ResponseDto;
import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PutMapping;
@Component
@FeignClient(
name = "liquidnet-service-platform",
contextId = "FeignPlatformCandyTaskClient",
path = "platform",
fallback = FallbackFactory.Default.class
)
public interface FeignPlatformCandyTaskClient {
@PutMapping("/candy/task/issue/coupons")
ResponseDto<String> issueCoupons();
}
package com.liquidnet.service.executor.main.handler;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.feign.kylin.task.FeignPlatformAlipayBackClient;
import com.liquidnet.service.feign.platform.task.FeignPlatformCandyTaskClient;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
......@@ -17,6 +19,8 @@ public class PlatformTaskHandler {
@Autowired
private FeignPlatformAlipayBackClient feignPlatformAlipayBackClient;
@Autowired
private FeignPlatformCandyTaskClient feignPlatformCandyTaskClient;
@XxlJob(value = "sev-platform:alipayActiveCallbackHandler")
public ReturnT<String> alipayActiveCallbackHandler() {
......@@ -29,4 +33,15 @@ public class PlatformTaskHandler {
}
}
@XxlJob(value = "sev-platform:candyCouponIssuanceHandler")
public ReturnT<String> candyCouponIssuanceHandler() {
try {
ResponseDto<String> dto = feignPlatformCandyTaskClient.issueCoupons();
log.info("result of handler:{}", dto.toJson());
return ReturnT.SUCCESS;
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
return ReturnT.FAIL;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment