class Constants {
  // ==================== 环境配置 ====================
  /// 当前环境：dev / staging / prod，通过 --dart-define=APP_ENV=xxx 注入
  static const String env = String.fromEnvironment('APP_ENV', defaultValue: 'dev');

  /// 根据环境返回对应的 API 地址
  static String get baseUrl {
    switch (env) {
      case 'dev':
        return 'http://121.41.57.178:9090';
      case 'staging':
        return 'http://121.41.57.178:9090';
      case 'prod':
        return 'http://121.41.57.178:9090';
      default:
        return 'http://121.41.57.178:9090';
    }
  }
  



  // ==================== 超时配置 ====================
  static const int connectTimeout = 30000;
  static const int receiveTimeout = 30000;
  static const int sendTimeout = 30000;

  // ==================== 业务状态码 ====================
  static const int successCode = 200;
  static const int tokenExpiredCode = 401;
  static const int forbiddenCode = 403;
  static const int notFoundCode = 404;
  static const int serverErrorCode = 500;

  // ==================== 重试配置 ====================
  static const int maxRetries = 3;
  static const int retryInterval = 1000;
  static const bool enableExponentialBackoff = true;

  // ==================== 缓存配置 ====================
  static const bool enableCache = false;
  static const int cacheDuration = 300;

  // ==================== Token 配置 ====================
  static const int tokenExpiryHours = 24;

  // ==================== 其他配置 ====================
  static const String defaultLang = 'zh-CN';
}
