Library Search
结果页02-controller-rest-api
在 知识库 中找到 8 个匹配结果。
知识库
知识库
8 个 02-controller-rest-api # C# ASP.NET Core — Controller RESTful API
## 目标
使用 Controller 模式构建完整的用户管理 RESTful API,模拟数据库 CRUD 操作。
## 完整代码
```csharp
// Models/User.cs
public record User(int Id, string Name, string Email);
//… 3% 入门篇 - RESTful API 实战 #### 步骤四:Controller `app/controllers/ProductController.php`
```php
<?php
use Phalcon\Http\Response;
use Phalcon\Mvc\Controller;
class ProductController extends Controller
{
public function list… 2% 入门到进阶教程 Spring Boot 配置加载优先级(从高到低):
1. 命令行参数
2. 操作系统环境变量
3. application-{profile}.properties(外部)
4. application.properties(外部)
5. application-{profile}.properties(classpath)
6. application.properties(classpath… 2% 02-restful-api # Flask RESTful API —— 构建完整的 CRUD 接口
## 目标
使用 Flask 构建一个完整的 RESTful API,实现对"书籍"资源的 CRUD 操作:
- 理解 RESTful URL 设计规范
- 掌握请求体 JSON 解析
- 掌握状态码的正确使用
- 使用 Flask-RESTful 扩展简化 API 开发
## 完整代码
```python
# ap… 2% 入门篇 - 构建 Task API protected $casts = [
'status' => 'string',
];
}
```
#### 步骤四:创建控制器
```bash
php artisan make:controller Api/TaskController
```
`app/Http/Controllers/Api/TaskController.php`:
```php
<?ph… 2% 02-drf-restful-api # Django REST Framework — 构建生产级 RESTful API
## 目标
使用 Django REST Framework (DRF) 构建完整的 RESTful API,实现对"文章"资源的 CRUD:
- 理解 Model → Serializer → ViewSet → Router 的 DRF 管线
- 掌握序列化器(Serializer)的验证与输出控制
-… 2% Hello World - 桌面应用 ipcMain.handle('show-message', async (event, message) => {
const { dialog } = require('electron');
dialog.showMessageBox(mainWindow, {
type: 'info',
title: '来自主进程',
message: message,… 1% 5V继电器模块驱动代码例程 if (msg == "ON") {
relay.on();
client.publish("home/relay/state", "ON");
} else if (msg == "OFF") {
relay.off();
client.publish("home/relay/state", "OFF");
} el… 1%