ztt
2025-09-09 bb2db3ef88acfa42169355334f3b887f064ffdec
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
122
123
124
125
#pragma once
 
//
//±¨ÎÄÀàÐÍ
//
enum TypeInfo
{
    LOGIN_REQ,        //µÇ¼ÇëÇó
    LOGIN_RES,        //µÇ¼ÏìÓ¦
 
    REGISTER_REQ,    //×¢²áÇëÇó
    REGISTER_RES,    //×¢²áÏìÓ¦
 
    //´ýÔö¼Ó
};
 
 
 
//
//³ÉԱȨÏÞ
//
struct Permission
{
    int admin;            // ¹ÜÀíԱȨÏÞ
    int history;        // ÀúÊ·²éѯ
    int log_search;        // ÈÕÖ¾²éѯȨÏÞ
    int map_change;        // µØÍ¼ÐÞ¸Ä
    int attend_manage;    // ¿¼ÇÚ¹ÜÀí
    int device_manage;    // É豸¹ÜÀí
    int version_manage; // °æ±¾¹ÜÀí
    int notify_manage;    // Í¨Öª¹ÜÀí
    int image_input;    // Í¼Ïñ¼Èë
    int monitor_back;    // ºǫ́¼à¿Ø
};
 
 
 
//
//Head
//
struct Head                //ʹÓÃHead£¬½«±¨ÎÄÍ·ºÍÄÚÈÝ·ÖÀ룬±ãÓÚ½â¾öÕ³°üÎÊÌâ
{
    int type;
    int len;
};
 
 
 
//
//µÇ¼ÇëÇó½á¹¹Ìå
//
struct LoginReq            
{
    Head head;
    char user_name[32];
    char password[32];
 
    LoginReq() {
        head.type = LOGIN_REQ;
        head.len = sizeof(LoginReq);
    }
};
 
 
 
//
//µÇ¼ÏìÓ¦½á¹¹Ìå
//
struct LoginRes            
{
    Head head;
    char user_name[32];
    int emp_id;            //·µ»Ø¹¤ºÅ
    int status;
    Permission per;
 
    LoginRes() {
        head.type = LOGIN_RES;
        head.len = sizeof(LoginRes);
    }
};
 
 
 
//
//×¢²áÇëÇó½á¹¹Ìå
//
struct RegisterReq        
{
    Head head;
    char user_name[32];
    char password[32];
    char email[32];
    char telephone[32];
    char department[32];
 
    RegisterReq() {
        head.type = REGISTER_REQ;
        head.len = sizeof(RegisterReq);
    }
};
 
 
 
//
//×¢²áÏìÓ¦½á¹¹Ìå
//
struct RegisterRes
{
    Head head;
    char user_name[32];
    int emp_id;            //·µ»Ø¹¤ºÅ
    int status;
    Permission per;//ȨÏÞ¶ÔÏó
    char res_info[100];//·þÎñÆ÷ÏìÓ¦µÄÐÅÏ¢
 
    RegisterRes() {
        head.type = REGISTER_RES;
        head.len = sizeof(RegisterRes);
    }
};
 
 
 
//