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

Commit 56b89c3b authored by 胡佳晨's avatar 胡佳晨

提交 抽奖 job

parent 41df72c5
......@@ -66,6 +66,8 @@ liquidnet:
notifyUrl: https://devdragon.zhengzai.tv/dragon
platform:
url: http://devplatform.zhengzai.tv
sweet:
url: http://devsweet.zhengzai.tv
executor-main:
xxl:
admin:
......
......@@ -67,6 +67,8 @@ liquidnet:
notifyUrl: https://testdragon.zhengzai.tv/dragon
platform:
url: http://testplatform.zhengzai.tv
sweet:
url: http://devsweet.zhengzai.tv
executor-main:
xxl:
admin:
......
......@@ -23,3 +23,4 @@ liquidnet:
logpath: /data/logs/job
url:
platform: ${liquidnet.service.platform.url}
sweet: ${liquidnet.service.sweet.url}
......@@ -23,3 +23,4 @@ liquidnet:
logpath: /data/logs/job
url:
platform: ${liquidnet.service.platform.url}
sweet: ${liquidnet.service.sweet.url}
package com.liquidnet.service.feign.kylin.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.PostMapping;
@Component
@FeignClient(name = "liquidnet-service-sweet",
contextId = "FeignSweetTaskClient", path = "",
url = "${liquidnet.service.sweet.url}",
// url = "",
fallback = FallbackFactory.Default.class)
public interface FeignSweetTaskClient {
@PostMapping("sweet/sweetData/drawLuck/add")
ResponseDto<Boolean> drawLuckAdd();
}
package com.liquidnet.service.executor.main.handler;
import com.liquidnet.service.feign.kylin.task.FeignPlatformTaskClient;
import com.liquidnet.service.feign.kylin.task.FeignSweetTaskClient;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* XxlJob开发示例(Bean模式)
* <p>
* 开发步骤:
* 1、在Spring Bean实例中,开发Job方法,方式格式要求为 "public ReturnT<String> execute(String param)"
* 2、为Job方法添加注解 "@XxlJob(value="自定义jobhandler名称", init = "JobHandler初始化方法", destroy = "JobHandler销毁方法")",注解value值对应的是调度中心新建任务的JobHandler属性的值。
* 3、执行日志:需要通过 "XxlJobLogger.log" 打印执行日志;
*/
@Component
public class SweetTaskHandler {
private static final Logger log = LoggerFactory.getLogger(SweetTaskHandler.class);
@Autowired
private FeignSweetTaskClient feignSweetTaskClient;
@XxlJob(value = "sev-sweet:checkOrderTimeHandler")
public ReturnT<String> drawLuckAdd() {
try {
boolean result = feignSweetTaskClient.drawLuckAdd().getData();
log.info("drawLuckAdd:结果:"+result);
return ReturnT.SUCCESS;
} catch (Exception e) {
return ReturnT.FAIL;
}
}
}
......@@ -72,7 +72,7 @@ public class SweetDataController {
}
}
@PostMapping("drawLuck")
@PostMapping("drawLuck/add")
@ApiOperation("增加可中奖数量1最大6(20210820)")
public ResponseDto<Boolean> luckDrawAllAdd() {
try {
......
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