fertao
2025-08-02 3465c52e01909d9879c480019b945fd6d42ae6a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef STRUCT_DATA_H
#define STRUCT_DATA_H
#include <mutex>
#include <condition_variable>
 
#define DEPENDS_ON  1
#define DEPENDS_OFF 0
 
 
enum TypeInfo {
    HEART_CHECK_REQ = 1,
    HEART_CHECK_RES,
    UPLOAD_REQ = 100,
    HEAD_UPLOAD_REQ,
    DATA_UPLOAD_REQ,
    UP_LOAD_FIN,
    UPLOAD_SQL_REQ,
    RELEASE_SQL_REQ,
    RELEASE_SQL_RES,
    ROLLBACK_SQL_REQ,
    ROLLBACK_SQL_RES,
    LOG_DATA_REQ,
    LOG_DATA_QUARY,
    LOG_DATA_RES
};
// ÏûϢͷ
struct Head {
    int len;
    short type;
};
 
// ÎļþÍ·
struct UpLoadPkgHead {
    Head head;
    int upLoadType;
    int fileNameLen;
    char fileName[0];
};
 
// ÎļþÊý¾Ý
struct UpLoadPkgData {
    Head head;
    int upLoadType;
    int fileNameLen;
    int dataLen;
    int flag;
    char data[0];
};
struct SQLFiles {
    std::string filename;
    std::string current_ver;
    std::string created_tm;
    std::string updated_tm;
};
struct SQLVersions {
    std::string file_id;
    std::string created_tm;
    std::string desc;
    int depends_on;
};
// ´«Êä½áÊø
struct UpLoadPkgFin {
    Head head;
    int upLoadType;
    int fileNameLen;
    int verSionLen;
    int cnt;
    char fileName[0];
};
 
// SQL½á¹¹Ìå
struct SQLData {
    int len;
    char data[0];
};
struct SQLPkg {
    Head head;
    SQLData data;
};
struct ReleaseReq {
    Head head;
    ReleaseReq() {
        head.len = sizeof(ReleaseReq);
        head.type = RELEASE_SQL_REQ;
    }
};
struct RollbackReq {
    Head head;
    RollbackReq() {
        head.len = sizeof(RollbackReq);
        head.type = ROLLBACK_SQL_REQ;
    }
};
struct LogDataReq {
    Head head;
    LogDataReq() {
        head.len = sizeof(LogDataReq);
        head.type = LOG_DATA_REQ;
    }
};
struct HeartCheckReq  // ÐÄÌøÇëÇó°ü
{
    Head head;
    HeartCheckReq()
    {
        head.type = HEART_CHECK_REQ;
        head.len = sizeof(HeartCheckReq);
    }
};
 
struct HeartCheckRes  // ÐÄÌøÏìÓ¦°ü
{
    Head head;
    HeartCheckRes()
    {
        head.type = HEART_CHECK_RES;
        head.len = sizeof(HeartCheckRes);
    }
};
 
#endif // STRUCT_DATA_H