fix: resolve 7 frontend-backend API inconsistencies and add comprehensive documentation

- Fixed LoginResponse: added expires_in field
- Renamed format to file_format across FileInfo interface
- Updated ProcessRequest: replaced confidence_threshold with detect_layout
- Modified ProcessResponse: added message and total_files, removed task_id
- Removed non-existent getTaskStatus API call
- Fixed getOCRResult parameter from taskId to fileId
- Commented out translation config APIs pending backend implementation

Documentation:
- Added API_REFERENCE.md: Complete API endpoint inventory
- Added API_FIX_SUMMARY.md: Detailed before/after comparison of all fixes
- Added FRONTEND_API.md: Frontend integration documentation
- Added FRONTEND_QUICK_START.md: Quick start guide
- Added FRONTEND_UPGRADE_SUMMARY.md: Upgrade summary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
beabigegg
2025-11-13 08:54:37 +08:00
parent fed112656f
commit 9cf36d8e21
7 changed files with 2865 additions and 34 deletions

View File

@@ -12,6 +12,7 @@ export interface LoginRequest {
export interface LoginResponse {
access_token: string
token_type: string
expires_in: number // Token expiration time in seconds
}
export interface User {
@@ -29,7 +30,7 @@ export interface FileInfo {
id: number
filename: string
file_size: number
format: string
file_format: string // Changed from 'format' to match backend
status: 'pending' | 'processing' | 'completed' | 'failed'
}
@@ -37,13 +38,15 @@ export interface FileInfo {
export interface ProcessRequest {
batch_id: number
lang?: string
confidence_threshold?: number
detect_layout?: boolean // Changed from confidence_threshold to match backend
}
export interface ProcessResponse {
task_id: string
message: string // Added to match backend
batch_id: number
total_files: number // Added to match backend
status: string
// Removed task_id - backend uses batch-level tracking instead
}
export interface TaskStatus {
@@ -132,7 +135,7 @@ export interface ExportRule {
export interface CSSTemplate {
name: string
description: string
filename: string
// filename is not returned by backend - use name as identifier
}
// Translation (FUTURE FEATURE)