using System;

namespace CncModels.Constants
{
    /// <summary>
    /// 全局错误码
    /// 编号规则：5位数字，前2位为模块，后3位为具体错误
    /// </summary>
    public static class ErrorCode
    {
        // ======== 通用错误（40xxx）========

        /// <summary>请求参数错误</summary>
        public const int BadRequest = 40000;

        /// <summary>未认证（Token缺失或无效）</summary>
        public const int Unauthorized = 40101;

        /// <summary>资源不存在</summary>
        public const int NotFound = 40002;

        /// <summary>数据冲突（唯一性校验失败）</summary>
        public const int Conflict = 40003;

        /// <summary>数据已被引用，不允许操作</summary>
        public const int DataReferenced = 40001;

        /// <summary>服务器内部错误</summary>
        public const int InternalError = 50001;
    }
}
