/**
 * HTTP模块统一导出文件
 * 提供完整的API接口、配置管理、工具函数和认证功能
 */

// 导入所有API模块
import * as petsApi from './api/pets.js'
import * as assistantApi from './api/assistant.js'
import * as adoptionApi from './api/adoption.js'
import * as profileApi from './api/profile.js'
import * as reviewApi from './api/review.js'
import * as commonApi from './api/common.js'
import * as authApi from './api/auth.js'

// ==================== 配置导出 ====================
export { HTTP_CONFIG, NO_AUTH_APIS, addNoAuthApis, setEnvironment } from './config/config.js'

// ==================== 工具函数导出 ====================
export { validateRequired, validateId, validatePagination, validateFileUpload } from './utils/validator.js'

// ==================== 认证工具导出 ====================
export {
	isUserLoggedIn,
	validateToken,
	checkLoginStatus,
	clearAuthData,
	clearTempLoginData,
	navigateToLogin,
	handleAuthRequired,
	tryAutoLogin
} from './utils/auth-helper.js'

// ==================== API模块导出 ====================
export {
	petsApi,
	assistantApi,
	adoptionApi,
	profileApi,
	reviewApi,
	commonApi,
	authApi
}

// ==================== 默认导出 ====================
export default {
	// API模块
	pets: petsApi,
	assistant: assistantApi,
	adoption: adoptionApi,
	profile: profileApi,
	review: reviewApi,
	common: commonApi,
	auth: authApi,

	// 配置
	config: {
		HTTP_CONFIG,
		NO_AUTH_APIS,
		addNoAuthApis,
		setEnvironment
	},

	// 工具函数
	utils: {
		validateRequired,
		validateId,
		validatePagination,
		validateFileUpload,
		isUserLoggedIn,
		validateToken,
		checkLoginStatus,
		clearAuthData,
		clearTempLoginData,
		navigateToLogin,
		handleAuthRequired,
		tryAutoLogin
	}
}


