CREATE TABLE IF NOT EXISTS `request_log` (
    `id` BIGINT AUTO_INCREMENT PRIMARY KEY,
    `endpoint` VARCHAR(100) NOT NULL,
    `mode` VARCHAR(10) NOT NULL,
    `method` VARCHAR(50) NOT NULL,
    `tool_name` VARCHAR(50) DEFAULT NULL,
    `request_params` JSON DEFAULT NULL,
    `response_data` JSON DEFAULT NULL,
    `http_status` SMALLINT NOT NULL DEFAULT 200,
    `execution_time_ms` INT DEFAULT NULL,
    `caller_ip` VARCHAR(45) DEFAULT NULL,
    `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    INDEX `idx_created_at` (`created_at`),
    INDEX `idx_endpoint` (`endpoint`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
