43 lines
1.0 KiB
Markdown
43 lines
1.0 KiB
Markdown
# CadLabel Backend
|
|
|
|
Spring Boot backend skeleton for CadLabel.
|
|
|
|
## Stack
|
|
|
|
- Java 21
|
|
- Spring Boot 3.4.4
|
|
- Maven
|
|
- MyBatis-Plus
|
|
- MySQL
|
|
- Tencent Cloud COS SDK
|
|
|
|
This project intentionally does not include Spring Security, JWT, login APIs, or user-system code.
|
|
|
|
## Run
|
|
|
|
```bash
|
|
mvn test
|
|
mvn spring-boot:run
|
|
```
|
|
|
|
The default profile is `dev`. Configure these environment variables before starting against a real database and COS bucket:
|
|
|
|
```bash
|
|
export APP_DB_URL='jdbc:mysql://localhost:3306/cadlabel?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&createDatabaseIfNotExist=true'
|
|
export APP_DB_USERNAME='root'
|
|
export APP_DB_PASSWORD=''
|
|
|
|
export APP_COS_SECRET_ID=''
|
|
export APP_COS_SECRET_KEY=''
|
|
export APP_COS_BUCKET=''
|
|
export APP_COS_REGION='ap-beijing'
|
|
export APP_COS_PUBLIC_BASE_URL=''
|
|
```
|
|
|
|
## COS APIs
|
|
|
|
- `POST /api/cos/upload-sessions` issues temporary STS credentials for direct browser upload.
|
|
- `POST /api/cos/objects` accepts multipart file upload and stores the file through the backend.
|
|
|
|
Both endpoints return the standard `ApiResponse<T>` shape.
|