# eat **Repository Path**: divle/eat ## Basic Information - **Project Name**: eat - **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-02-04 - **Last Updated**: 2026-02-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 吃饭照片打卡系统 一个简单易用的吃饭照片打卡应用,记录每天早中晚三餐的饭前饭后照片。 ## 功能特性 - 每日三餐打卡(早餐、午餐、晚餐) - 饭前/饭后照片记录 - 日历视图浏览历史 - 腾讯云COS对象存储 ## 技术栈 ### 后端 - JDK 17 - Spring Boot 3.2 - Spring Data JPA - H2 数据库 - 腾讯云 COS ### 前端 - Vue 3 - Vite - Element Plus - Axios ## 项目结构 ``` eat/ ├── eat-backend/ # 后端项目 │ ├── src/main/java/com/eat/ │ │ ├── config/ # 配置类 │ │ ├── controller/ # REST API │ │ ├── dto/ # 数据传输对象 │ │ ├── entity/ # JPA实体 │ │ ├── repository/ # 数据访问层 │ │ └── service/ # 业务逻辑层 │ └── pom.xml │ ├── eat-frontend/ # 前端项目 │ ├── src/ │ │ ├── api/ # API封装 │ │ ├── components/ # 组件 │ │ ├── router/ # 路由 │ │ └── views/ # 页面 │ └── package.json │ └── README.md ``` ## 快速开始 ### 1. 克隆项目 ```bash cd d:\temp\eat ``` ### 2. 配置后端 编辑 `eat-backend/src/main/resources/application.yml`,配置腾讯云COS: ```yaml cos: secret-id: your-secret-id secret-key: your-secret-key region: ap-guangzhou bucket: your-bucket-name access-url: https://your-bucket.cos.ap-guangzhou.myqcloud.com ``` ### 3. 启动后端 ```bash cd eat-backend mvn spring-boot:run ``` 后端将在 http://localhost:8080 启动 ### 4. 启动前端 ```bash cd eat-frontend npm install npm run dev ``` 前端将在 http://localhost:3000 启动 ## API 接口 | 方法 | 路径 | 说明 | |------|------|------| | GET | /api/meals/today | 获取今日记录 | | GET | /api/meals/date/{date} | 获取指定日期记录 | | POST | /api/meals | 创建/更新记录 | | PUT | /api/meals/{id} | 更新记录 | | DELETE | /api/meals/{id} | 删除记录 | | POST | /api/upload/before | 上传饭前照片 | | POST | /api/upload/after | 上传饭后照片 | | GET | /api/meals/calendar/{year}/{month} | 获取月历数据 | ## 配置说明 ### 腾讯云COS配置 1. 登录 [腾讯云控制台](https://console.cloud.tencent.com/) 2. 进入对象存储 COS 3. 创建存储桶,获取 SecretId、SecretKey 4. 配置存储桶的跨域访问规则 ### H2数据库 开发环境使用H2内存数据库,生产环境可切换为MySQL: ```yaml spring: datasource: url: jdbc:mysql://localhost:3306/eat_db username: root password: your_password jpa: hibernate: ddl-auto: update ```