Commit a508c511 authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents 2152360e 8a78e0d1
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @author licancan
* @description 商险模块dapr属性
* @date 2022-08-03 10:25:48
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.insurances", ignoreInvalidFields = false)
public class DaprInsurancesProperties {
/**
* dapr sidercar url 如:http://localhost:3511/v1.0/invoke/
*/
String appUrl;
/**
* app_id 如:"yifu_insurances_sider"
*/
String appId;
}
...@@ -12,3 +12,6 @@ dapr.check.appId=yifu-check ...@@ -12,3 +12,6 @@ dapr.check.appId=yifu-check
dapr.archives.appUrl=http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/ dapr.archives.appUrl=http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.archives.appId=yifu-archives dapr.archives.appId=yifu-archives
dapr.insurances.appUrl=http://yifu-insurances.qas-mvp.svc.cluster.local:3511/v1.0/invoke/
dapr.insurances.appId=yifu-insurances
...@@ -47,10 +47,9 @@ public class TInsuranceDetailController { ...@@ -47,10 +47,9 @@ public class TInsuranceDetailController {
* @param * @param
* @return void * @return void
*/ */
@Operation(summary = "每日定时刷新商险到期数据", description = "每日定时刷新商险到期数据")
@SysLog("每日定时刷新商险到期数据") @SysLog("每日定时刷新商险到期数据")
@Inner @Inner
@GetMapping("/inner/updateOverdueByTask") @PostMapping("/inner/updateOverdueByTask")
public void updateOverdueByTask() { public void updateOverdueByTask() {
tInsuranceDetailService.updateOverdueByTask(); tInsuranceDetailService.updateOverdueByTask();
} }
......
package com.yifu.cloud.plus.v1.job.compont;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @author licancan
* @description 商险模块到期定时任务
* @date 2022-08-03 10:39:14
*/
@Component(value = "updateOverdueTask")
@Slf4j
@EnableConfigurationProperties(DaprInsurancesProperties.class)
public class UpdateOverdueTask {
@Resource
private DaprInsurancesProperties daprInsurancesProperties;
/**
* 更新商险到期定时任务
*
* @author licancan
* @param
* @return void
*/
public void updateOverdueTask() throws Exception {
log.info("-------------更新商险到期-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId(),"/insuranceDetail/inner/updateOverdueByTask","", Void.class, SecurityConstants.FROM_IN);
log.info("------------更新商险到期-定时任务结束------------");
}
}
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