up:基本验证逻辑完成。

This commit is contained in:
2025-11-06 23:12:13 +08:00
parent d92ab6c029
commit 648fca13c5
12 changed files with 62 additions and 19 deletions

View File

@@ -87,14 +87,19 @@ void ClientCore::handleAsk(QSharedPointer<FrameBuffer> frame)
InfoMsg msg = infoUnpack<InfoMsg>(frame->data);
// TODO: 处理询问请求
if (msg.command == STRMSG_AC_CHECK_FILE_EXIST) {
InfoMsg ans;
ans.command = STRMSG_AC_ANSWER_FILE_EXIST;
for (const auto& filePath : msg.list) {
if (!Util::FileExist(filePath)) {
ans.list.append(filePath);
msg.command = STRMSG_AC_ANSWER_FILE_EXIST;
for (auto& item : msg.mapData) {
if (item.mark == STRMSG_AC_UP) {
if (!Util::DirExist(item.key, true)) {
item.properD = static_cast<qint32>(FCS_DIR_NOT_EXIST);
}
} else {
if (!Util::FileExist(item.key)) {
item.properD = static_cast<qint32>(FCS_FILE_NOT_EXIST);
}
}
}
if (!Send<InfoMsg>(ans, FBT_MSGINFO_ANSWER, frame->fid)) {
if (!Send<InfoMsg>(msg, FBT_MSGINFO_ANSWER, frame->fid)) {
auto logMsg = tr("") + frame->fid + tr("返回检查文件存在性消息失败。");
qCritical() << logMsg;
return;

View File

@@ -10,7 +10,6 @@
#include "ClientCore.h"
constexpr int MAX_SEND_TASK = 10;
struct TransTask {
bool isUpload{false};
QString localId;
@@ -19,6 +18,9 @@ struct TransTask {
QString remoteId;
QString remotePath;
QString remoteUUID;
QString taskUUID;
FileCheckState localCheckState{FCS_NORMAL};
FileCheckState remoteCheckState{FCS_NORMAL};
};
enum class TaskState {