feat: 完善前后端核心功能模块
后端: - 新增认证(auth)、任务(tasks)、映射(mappings)、对账(reconciliation)、异常(exceptions)、导出(exports) API - 新增核心模块: database, security, permissions, tenant, exceptions, error_handlers - 新增数据模型: user, company, reconciliation_task, field_mapping, uploaded_file 等 - 新增服务层: ai_recognizer, file_parser, file_storage, mapping, reconciliation 等 - 添加数据库迁移脚本 前端: - 新增登录页面和仪表盘页面 - 新增任务列表、任务详情、字段映射页面 - 新增异常处理页面和规则设置页面 - 新增 API 代理路由 /api/[...path] - 新增 UI 组件库 (button, card, dialog, input, table 等) - 新增 auth 组件 (ProtectedRoute, PermissionGate) - 新增 layout 组件 (Header, Sidebar) - 新增 mapping 组件 (FieldMappingTable, AISuggestionPanel) - 新增 API 客户端和 hooks (useAsync, useToast, usePermission 等) - 新增状态管理 (auth-store, company-store, ui-store) - 集成 Tailwind CSS 和 shadcn/ui 组件库 其他: - 添加 Alembic 数据库迁移配置 - 添加初始化示例数据脚本 - 更新项目文档
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* API 端点常量
|
||||
*/
|
||||
export const ENDPOINTS = {
|
||||
// 健康检查
|
||||
HEALTH: '/api/health',
|
||||
|
||||
// 认证相关
|
||||
AUTH: {
|
||||
LOGIN: '/api/auth/login',
|
||||
LOGOUT: '/api/auth/logout',
|
||||
ME: '/api/auth/me',
|
||||
REFRESH: '/api/auth/refresh',
|
||||
},
|
||||
|
||||
// 企业相关
|
||||
COMPANY: {
|
||||
LIST: '/api/companies',
|
||||
DETAIL: (id: number | string) => `/api/companies/${id}`,
|
||||
CREATE: '/api/companies',
|
||||
UPDATE: (id: number | string) => `/api/companies/${id}`,
|
||||
DELETE: (id: number | string) => `/api/companies/${id}`,
|
||||
},
|
||||
|
||||
// 用户相关
|
||||
USER: {
|
||||
LIST: '/api/users',
|
||||
DETAIL: (id: number | string) => `/api/users/${id}`,
|
||||
CREATE: '/api/users',
|
||||
UPDATE: (id: number | string) => `/api/users/${id}`,
|
||||
DELETE: (id: number | string) => `/api/users/${id}`,
|
||||
UPDATE_ROLE: (id: number | string) => `/api/users/${id}/role`,
|
||||
},
|
||||
|
||||
// 文件上传
|
||||
FILE: {
|
||||
UPLOAD: '/api/files/upload',
|
||||
DOWNLOAD: (id: number | string) => `/api/files/${id}/download`,
|
||||
DELETE: (id: number | string) => `/api/files/${id}`,
|
||||
},
|
||||
|
||||
// 任务相关
|
||||
TASK: {
|
||||
LIST: '/api/tasks',
|
||||
STATS: '/api/tasks/stats',
|
||||
DETAIL: (id: number | string) => `/api/tasks/${id}`,
|
||||
CREATE: '/api/tasks',
|
||||
UPDATE: (id: number | string) => `/api/tasks/${id}`,
|
||||
DELETE: (id: number | string) => `/api/tasks/${id}`,
|
||||
RECONCILE: (id: number | string) => `/api/reconciliation/execute/${id}`,
|
||||
RESULT: (id: number | string) => `/api/reconciliation/result/${id}`,
|
||||
EXPORT: (id: number | string) => `/api/exports/task/${id}`,
|
||||
},
|
||||
|
||||
// 异常相关
|
||||
ANOMALY: {
|
||||
LIST: '/api/anomalies',
|
||||
DETAIL: (id: number | string) => `/api/anomalies/${id}`,
|
||||
CONFIRM: (id: number | string) => `/api/anomalies/${id}/confirm`,
|
||||
IGNORE: (id: number | string) => `/api/anomalies/${id}/ignore`,
|
||||
},
|
||||
|
||||
// 分析相关
|
||||
ANALYSIS: {
|
||||
LABOR_COST: (taskId: number | string) => `/api/analysis/labor-cost/${taskId}`,
|
||||
TREND: '/api/analysis/trend',
|
||||
SUMMARY: '/api/analysis/summary',
|
||||
},
|
||||
|
||||
// 凭证相关
|
||||
VOUCHER: {
|
||||
GENERATE: (taskId: number | string) => `/api/vouchers/generate/${taskId}`,
|
||||
EXPORT: (taskId: number | string) => `/api/vouchers/export/${taskId}`,
|
||||
},
|
||||
|
||||
// 审计日志
|
||||
AUDIT: {
|
||||
LIST: '/api/audit-logs',
|
||||
},
|
||||
|
||||
// 字段映射
|
||||
MAPPING: {
|
||||
LIST: '/api/mappings',
|
||||
TASK_MAPPINGS: (taskId: number | string) => `/api/mappings/task/${taskId}`,
|
||||
RECOGNIZE: '/api/mappings/recognize',
|
||||
CONFIRM: '/api/mappings/confirm',
|
||||
DETAIL: (mappingId: number | string) => `/api/mappings/${mappingId}`,
|
||||
UPDATE: (mappingId: number | string) => `/api/mappings/${mappingId}`,
|
||||
SAVE_AS_RULE: (mappingId: number | string) => `/api/mappings/${mappingId}/save-as-rule`,
|
||||
RULES_LIST: '/api/mappings/rules/list',
|
||||
RULE_STATUS: (ruleId: number | string) => `/api/mappings/rules/${ruleId}/status`,
|
||||
RULE_DELETE: (ruleId: number | string) => `/api/mappings/rules/${ruleId}`,
|
||||
},
|
||||
} as const;
|
||||
|
||||
export default ENDPOINTS;
|
||||
Reference in New Issue
Block a user