Library Search
结果页02-dependency-injection-auth
在 元器件 / 技术栈 / 知识库 中找到 15 个匹配结果。
技术栈
技术栈
7 个 Amazon DynamoDB class TaskRepository:
@staticmethod
def create(user_id, title, due_date=None):
task = {
'PK': f'USER#{user_id}',
'SK': f'TASK#{uuid.uuid4().hex[:8]}',… 2% Flask class BookResource(Resource):
"""处理 /api/books/<book_id> 的 GET / PUT / DELETE"""
@marshal_with(book_fields)
def get(self, book_id):
"""获取单本书"""
book = next((b for b in boo… 2% Python def deposit(self, amount: float) -> bool:
"""存款"""
if amount <= 0:
print("存款金额必须大于 0")
return False
self.balance += amount
self._transactions.ap… 1% Fiber 参考文献:
[
{
"url": "https://docs.gofiber.io/",
"type": "web",
"year": 2024,
"title": "Fiber 官方文档",
"authors": [
"Fiber Team"
]
},
{
"url": "https://github.com/val… 1% Neo4j def create_data(tx):
"""批量创建节点和关系"""
tx.run("""
CREATE (:Person {name: '张三', age: 21, major: '计算机科学'})
CREATE (:Person {name: '李四', age: 22, major: '数学'})
CREATE (:Pers… 1% Bootstrap <div class="container-fluid">
<div class="row">
<!-- 侧边栏 -->
<aside class="col-md-3 col-lg-2 d-md-block bg-light sidebar p-3 min-vh-100">
<ul class="nav flex-column">… 1% Verilog / SystemVerilog always_ff @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
state <= S_IDLE; tx <= 1'b1;
clk_cnt <= 0; bit_idx <= 0;
end else begin
case (stat… 1%
知识库
知识库
8 个 02-dependency-injection-auth | 概念 | 说明 |
|------|------|
| `Depends()` | 依赖注入的核心,可嵌套形成依赖链 |
| `OAuth2PasswordBearer` | 标准 OAuth2 密码流,Swagger 自动显示 🔓 按钮 |
| 依赖工厂 | 返回 callable 的函数,用于参数化依赖(如 `require_role`)|
| `OAuth2PasswordReques… 3% AT24Cxx EEPROM 存储模块 — 代码例程 class AT24Cxx:
def __init__(self, i2c, addr=0x50, page_size=32):
self.i2c = i2c
self.addr = addr
self.page_size = page_size
def write_byte(self, mem_addr, data):… 2% INMP441 I2S 麦克风 — 代码例程 (ESP32 + STM32) void dual_i2s_init() {
i2s_config_t i2s_config = {
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),
.sample_rate = SAMPLE_RATE,
.bits_per_sample = I2S_BITS_PER_SAMPLE_3… 2% Serverless 后端实战 class TaskRepository:
@staticmethod
def create(user_id, title, due_date=None):
task = {
'PK': f'USER#{user_id}',
'SK': f'TASK#{uuid.uuid4().hex[:8]}',… 2% Arduino Nano 33 BLE — 代码例程 void setup() {
Serial.begin(115200);
while (!Serial);
if (!IMU.begin()) {
Serial.println("Failed to initialize IMU!");
while (1);
}
Serial.println("IMU in… 2% 基础语法与编程思维 def deposit(self, amount: float) -> bool:
"""存款"""
if amount <= 0:
print("存款金额必须大于 0")
return False
self.balance += amount
self._transactions.ap… 1% 火焰传感器(4针) 双模式检测与中断触发代码例程 enum AlarmLevel {
LEVEL_SAFE = 0, // 安全
LEVEL_WARNING, // 警告(微弱火源)
LEVEL_DANGER, // 危险(确认火焰)
LEVEL_CRITICAL // 紧急(强火焰)
};
AlarmLevel currentLevel = LEVEL_SAFE;… 1% 02-restful-api class BookListResource(Resource):
"""处理 /api/books 的 GET(列表)和 POST(创建)"""
def get(self):
"""获取所有书籍"""
return {"books": books_db, "total": len(books_db)}
@marshal_with(boo… 1%