开拍提醒短信任务

This commit is contained in:
尹吉欢
2018-09-25 16:25:45 +08:00
parent 099f819ea8
commit 4910cabc56
6 changed files with 61 additions and 3 deletions
@@ -0,0 +1,36 @@
package com.fangjia.job.youfang.job;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.fangjia.job.common.base.Response;
import com.fangjia.job.common.util.DingDingMessageUtil;
import com.fangjia.job.common.util.RestApiCallUtils;
import com.fangjia.job.youfang.remote.FshApiRemoteService;
/**
* 拍卖数据开拍提醒通知任务(暂时放在这里)
* 每天早晨9点开始执行
* @author yinjihuan
*
*/
public class AuctionStartNoticeJob implements SimpleJob {
private static final Logger LOG = LoggerFactory.getLogger(AuctionStartNoticeJob.class);
@Value("${auction.url}")
private String auctionApiUrl;
@Override
public void execute(ShardingContext shardingContext) {
LOG.info("开始执行AuctionStartNoticeJob");
FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, auctionApiUrl);
Response response = fshApiRemoteService.sendStartAuctionSms();
if (response.getCode() == 200) {
DingDingMessageUtil.sendTextMessage("拍卖提醒处理成功");
}
}
}
@@ -95,4 +95,11 @@ public interface FshApiRemoteService {
*/
@RequestLine("POST /rest/message/push")
public Response pushMessage(@QueryMap Map<String, Object> queryMap);
/**
* 发送开拍提醒短信
* @return
*/
@RequestLine("GET /auction-service/auction/notice/sms")
public Response sendStartAuctionSms();
}
@@ -26,3 +26,5 @@ open.url=http://test2.open.fangjia.com
FANGJIA_API_TOKEN=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB
es.url=222.73.196.132
auction.url=http://test.basicapi.fangjia.com
@@ -29,3 +29,5 @@ open.url=http://open.fangjia.com
FANGJIA_API_TOKEN=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB
es.url=222.73.196.132
auction.url=http://basicapi.fangjia.com
@@ -26,3 +26,5 @@ open.url=http://192.168.10.47:9180
FANGJIA_API_TOKEN=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB
es.url=192.168.0.222
auction.url=http://test.basicapi.fangjia.com
@@ -169,4 +169,13 @@
</job:simple>
<!-- 企业统计任务 每天9点0分执行 -->
<job:simple id="auctionStartNoticeJob" class="com.fangjia.job.youfang.job.AuctionStartNoticeJob" registry-center-ref="regCenter"
sharding-total-count="1" cron="0 0 9 * * ?" sharding-item-parameters=""
failover="true" description="【拍卖】拍卖数据开拍提醒通知任务"
overwrite="true" event-trace-rdb-data-source="elasticJobLog" job-exception-handler="com.fangjia.job.youfang.handler.CustomJobExceptionHandler">
<job:listener class="com.fangjia.job.youfang.listener.MessageElasticJobListener"></job:listener>
</job:simple>
</beans>