Skip to content

Commit 7194d05

Browse files
committed
update docs
1 parent f521bed commit 7194d05

3 files changed

Lines changed: 2 additions & 12 deletions

File tree

docs/controllers-routing.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ async fn get_post(&self, Path((user_id, post_id)): Path<(i64, i64)>) -> Json<Pos
5353
}
5454
```
5555

56-
## 支持的 HTTP 方法
57-
58-
| 注解 | HTTP 方法 |
59-
|------|-----------|
60-
| `#[get]` | GET |
61-
| `#[post]` | POST |
62-
| `#[put]` | PUT |
63-
| `#[delete]` | DELETE |
64-
| `#[patch]` | PATCH |
65-
6656
## 控制器结构体字段
6757

6858
控制器 struct 的字段通过 `Inject<T>` 声明依赖,启动时自动注入:

docs/dependency-injection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WebR 的 IoC 容器管理所有组件的生命周期,启动时自动完成依
55
## 核心概念
66

77
- **`#[component]`** — 标记一个结构体为可管理组件,自动注册到 IoC 容器
8-
- **`#[controller]`** — 标记控制器,也是组件的一种,附带路由功能
8+
- **`#[controller]`** — 标记控制器,也是组件的一种,用于声明式路由
99
- **`#[config]`** — 标记配置类型,也是组件,值从 TOML 文件加载
1010
- **`Inject<T>`** — 注入智能指针,自动解析并持有组件实例
1111

docs/file-upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl FileController {
4545
}
4646
```
4747

48-
### 从文件路径读取(缓冲模式)
48+
### 从文件路径读取
4949

5050
```rust
5151
#[controller]

0 commit comments

Comments
 (0)