feat(backend): simple product list API with Ktor
This commit is contained in:
1 parent
4e10335748
commit
2b51111a04
4 files changed
+122
No files matched your search
@@ -0,0 +1,31 @@
|
||||
# kmp-mini-shopping backend
|
||||
|
||||
一个超轻量 Ktor 后端,用于提供商品列表接口。
|
||||
|
||||
## 运行
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
./gradlew run
|
||||
```
|
||||
|
||||
默认监听:`http://localhost:8080`
|
||||
|
||||
## 接口
|
||||
|
||||
- `GET /` 服务状态
|
||||
- `GET /api/health` 健康检查
|
||||
- `GET /api/products` 商品列表(推荐)
|
||||
- `GET /products` 商品列表(兼容)
|
||||
|
||||
## 返回字段
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "1",
|
||||
"title": "KMP 入门课",
|
||||
"price": 99.0,
|
||||
"description": "跨平台开发基础课程",
|
||||
"imageUrl": "https://picsum.photos/seed/kmp1/600/360"
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user