fangjia-job 1.2

This commit is contained in:
zongzhimin
2018-02-28 10:11:32 +08:00
parent 80ef043df1
commit dd36120b30
4 changed files with 50 additions and 1 deletions
@@ -0,0 +1,26 @@
package com.fangjia.job.youfang.job;
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.util.RestApiCallUtils;
import com.fangjia.job.youfang.remote.FshApiRemoteService;
public class DistrictInfoJob implements SimpleJob{
@Value("${FANGJIA_API_TOKEN}")
private String token;
@Value("${fsh.url}")
private String fshApiUrl;
@Override
public void execute(ShardingContext shardingContext) {
System.out.println("111");
FshApiRemoteService fshApiRemoteService = RestApiCallUtils.getRestClient(FshApiRemoteService.class, fshApiUrl);
}
}
@@ -0,0 +1,11 @@
package com.fangjia.job.youfang.remote;
/**
* openApi接口调用
* @author zongzhimin
*
*/
public interface OpenApiProxyService {
}
@@ -13,4 +13,6 @@ spring.datasource.log.driver-class-name=com.mysql.jdbc.Driver
fsh.url=http://192.168.0.251:8086
zk.server-lists=192.168.10.47:2181
zk.namespace=fangjia-job-youfang-test
zk.namespace=fangjia-job-youfang-test
FANGJIA_API_TOKEN="F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
@@ -93,4 +93,14 @@
</job:simple>
<!-- 有房 -->
<job:simple id="districtInfoJob" class="com.fangjia.job.youfang.job.DistrictInfoJob" registry-center-ref="regCenter"
sharding-total-count="1" cron="0 01 14 * * ?" sharding-item-parameters=""
failover="true" description="【有房】 123"
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>