# record-backend **Repository Path**: xiaozh0722/record-backend ## Basic Information - **Project Name**: record-backend - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-27 - **Last Updated**: 2026-03-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Record Backend - AI 语音记账后端 ## 技术栈 - Java 21 (虚拟线程) - Spring Boot 3.4 - MyBatis Plus - MySQL 8.0 - Redis 7.0 - 阿里云 DashScope (通义千问 Qwen-Plus) ## 前置条件 1. Java 21+ 2. Maven 3.8+ 3. MySQL 8.0+ 4. Redis 7.0+ 5. 阿里云 DashScope API Key ## 快速启动 ### 1. 初始化数据库 ```bash mysql -u root -p < src/main/resources/db/init.sql ``` ### 2. 配置环境变量 ```bash export DASHSCOPE_API_KEY="your-api-key" ``` ### 3. 修改数据库配置 编辑 `src/main/resources/application.yml`: ```yaml spring: datasource: username: your-username password: your-password data: redis: host: your-redis-host ``` ### 4. 启动服务 ```bash mvn spring-boot:run ``` ## API 接口 | 接口 | 方法 | 说明 | |------|------|------| | `/api/ledger/parse` | POST | 语音/文字记账 | | `/api/ledger/list` | GET | 查询日期账目列表 | | `/api/ledger/stats/monthly` | GET | 月度统计 | ## API 示例 ### 记账 ```bash curl -X POST "http://localhost:8080/api/ledger/parse?userId=1&text=今天打车花了 50 块" ``` ### 查询今日账目 ```bash curl "http://localhost:8080/api/ledger/list?userId=1" ``` ### 月度统计 ```bash curl "http://localhost:8080/api/ledger/stats/monthly?userId=1&year=2025&month=3" ```