add reply in recall and +5 sec in recall and fix utc time in recall

This commit is contained in:
lnk
2025-08-25 11:25:03 +08:00
parent e2ee8546c7
commit 320cf6d9ba
5 changed files with 113 additions and 5 deletions

View File

@@ -6926,6 +6926,34 @@ void send_reply_to_kafka(const std::string& guid, const std::string& step, const
kafka_data_list_mutex.unlock();
}
void send_reply_to_kafka_recall(const std::string& guid, const std::string& step, const std::string& result,const std::string& lineIndex,const std::string& recallStartDate,const std::string& recallEndDate){
// 构造 JSON 字符串
std::ostringstream oss;
oss << "{"
<< "\"guid\":\"" << guid << "\","
<< "\"step\":\"" << step << "\","
<< "\"result\":\"" << result << "\","
<< "\"lineIndex\":\"" << lineIndex << "\","
<< "\"recallStartDate\":\"" << recallStartDate << "\","
<< "\"recallEndDate\":\"" << recallEndDate << "\","
<< "\"processNo\":\"" << g_front_seg_index << "\","
<< "\"frontType\":\"" << get_front_type_from_subdir() << "\","
<< "\"nodeId\":\"" << FRONT_INST << "\""
<< "}";
std::string jsonString = oss.str();
// 封装 Kafka 消息
Ckafka_data_t connect_info;
connect_info.strTopic = QString::fromStdString(Topic_Reply_Topic);
connect_info.strText = QString::fromStdString(jsonString);
// 加入发送队列(带互斥锁保护)
kafka_data_list_mutex.lock();
kafka_data_list.append(connect_info);
kafka_data_list_mutex.unlock();
}
void send_heartbeat_to_kafka(const std::string& status) {
// 构造 JSON 字符串
std::ostringstream oss;

View File

@@ -535,6 +535,10 @@ extern "C" {
send_reply_to_kafka(std::string(guid), std::string(step), std::string(result));
}
void send_reply_to_kafka_recall_c(const char* guid, const char* step, const char* result,const char* lineIndex,const char* recallStartDate,const char* recallEndDate) {
send_reply_to_kafka_recall(std::string(guid), std::string(step), std::string(result),std::string(lineIndex), std::string(recallStartDate), std::string(recallEndDate));
}
//标准化日志接口
void format_log_msg(char* buf, size_t buf_size, const char* fmt, ...) {
// 写入时间