Files
energy_storage/src/app/errcode.h
2025-09-04 19:31:04 +08:00

29 lines
773 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <string>
#include <unordered_map>
enum class Errcode
{
OK = 0,
ERR = 1,
ERR_TOKEN, // TOKEN错误
ERR_PARAM, // 参数错误
ERR_PARAM_NUL, // 缺少参数
ERR_DATA_NUL, // 数据不存在
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);