Files
energy_storage/src/app/errcode.h

29 lines
773 B
C
Raw Normal View History

#pragma once
2025-08-31 14:38:53 +08:00
#include <string>
#include <unordered_map>
enum class Errcode
{
OK = 0,
2025-08-31 14:38:53 +08:00
ERR = 1,
ERR_TOKEN, // TOKEN错误
ERR_PARAM, // 参数错误
ERR_PARAM_NUL, // 缺少参数
2025-09-04 19:31:04 +08:00
ERR_DATA_NUL, // 数据不存在
2025-08-31 14:38:53 +08:00
ERR_USER = 100,
ERR_LOGIN_USER_NOTEXIST, // 登入错误,用户不存在
ERR_LOGIN_PASSWD, // 登入错误,密码不正确
2025-08-31 14:38:53 +08:00
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);