ywl
2025-07-02 c7df7556e073d5e3953d17f94c35517f1ee48410
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
#ifndef DATASTRUCTURES_H
#define DATASTRUCTURES_H
 
// 注册请求结构体
struct RegisterReq {
    int type;          // 功能类型
    int len;           // 封包长度
    char username[32]; // 用户名
    char password[32]; // 密码
    char email[32];    // 邮箱
    char tel[32];      // 手机号
    char dept[32];     // 部门
 
    RegisterReq() {
        type = 400;                // 注册功能类型值
        len = sizeof(RegisterReq); // 计算结构体大小
    }
};
 
// 登录请求结构体
struct LoginReq {
    int type;          // 功能类型
    int len;           // 封包长度
    char username[32]; // 用户名
    char password[32]; // 密码
 
    LoginReq() {
        type = 401;               // 登录功能类型值
        len = sizeof(LoginReq);   // 计算结构体大小
    }
};
 
#endif // DATASTRUCTURES_H