完成任务模块的执行接口与数据接入模块的查询sql执行接口+新增sql执行接口联调
parent
508c5ec521
commit
5c00b49080
|
@ -4,6 +4,7 @@ import com.muyu.common.core.domain.Result;
|
|||
import com.muyu.quest.model.DataModel;
|
||||
import com.muyu.quest.model.DataValueModel;
|
||||
import com.muyu.quest.remote.factory.RemoteDataSourceFactory;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
@ -26,4 +27,13 @@ public interface RemoteDataSourceService {
|
|||
|
||||
@PostMapping("/value/findTableValue")
|
||||
public Result<List<DataModel>> findTableValue(@RequestBody DataValueModel dataValueModel);
|
||||
|
||||
/**
|
||||
* 根据基础表ID和SQL语句查询数据
|
||||
*
|
||||
* @param dataValueModel 基础表ID和sql语句
|
||||
* @return DataValue{kltv}
|
||||
*/
|
||||
@PostMapping("/value/addTableValue")
|
||||
public Result addTableValue(@RequestBody DataValueModel dataValueModel);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,11 @@ public class RemoteDataSourceFactory implements FallbackFactory<RemoteDataSource
|
|||
public Result findTableValue(DataValueModel dataValueModel) {
|
||||
return Result.error("数据接入模块连接失败,网络异常...");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result addTableValue(DataValueModel dataValueModel) {
|
||||
return Result.error("数据接入模块连接失败,网络异常...");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,9 +204,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>
|
|||
}
|
||||
|
||||
log.info("任务执行完成,新增sql为: [{}]", addSql);
|
||||
Result<List<DataModel>> tableValue = remoteDataSourceService.findTableValue(new DataValueModel(4L, addSql));
|
||||
if (tableValue.getCode() != 200){
|
||||
throw new TaskException(tableValue.getMsg());
|
||||
Result i = remoteDataSourceService.addTableValue(new DataValueModel(4L, addSql));
|
||||
if (i.getCode() != 200){
|
||||
throw new TaskException(i.getMsg());
|
||||
}
|
||||
return "执行成功";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue