实现HTTP服务架构

This commit is contained in:
lixiaoyuan
2025-08-31 14:38:53 +08:00
parent 4af4e670d2
commit e0b64a20c4
46 changed files with 1436 additions and 545 deletions

View File

@@ -1,16 +1,28 @@
#pragma once
#include <string>
#include <unordered_map>
enum class Errcode
{
OK = 0,
ERR = 1,
ERR_TOKEN, // TOKEN错误
ERR_PARAM, // 参数错误
ERR_PARAM_NUL, // 缺少参数
ERR = 100,
ERR_DB_CONN = 101, // 数据库连接错误
ERR_DB_SQL = 102, // 数据库查询SQL错误
ERR_DB_DUPLICATE, // 数据重复
ERR_USER = 100,
ERR_LOGIN_USER_NOTEXIST, // 登入错误,用户不存在
ERR_LOGIN_PASSWD, // 登入错误,密码不正确
};
ERR_DEVICE = 200,
ERR_DB_CONN = 1001, // 数据库连接错误
ERR_DB_DUPLICATE = 1062, // Duplicate entry for key
ERR_DB_SQL = 1064, // 数据库查询SQL错误
ERR_DB_VAL = 1366, // 1366,Incorrect decimal value通常为参数值错误例如空值、值类型错误
};
extern std::string ErrcodeStr(Errcode code);