#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);
|
}
|
};
|
|
|
|
//
|