Skip to content

Commit 0cd0204

Browse files
authored
Update README.md
1 parent 7a2eeaa commit 0cd0204

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

domain-driven-design/README.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -438,22 +438,6 @@ class OrderRepository {
438438
}
439439
}
440440

441-
async get(id) {
442-
if (!this.apiUrl) {
443-
// 如果 apiUrl 为空,从模拟数据中查找订单
444-
return this.mockData.find(order => order.id === id) || null;
445-
}
446-
// 否则,执行实际的 API 请求
447-
try {
448-
const response = await fetch(`${this.apiUrl}/${id}`);
449-
const data = await response.json();
450-
return data || null;
451-
} catch (error) {
452-
console.error("获取订单失败:", error);
453-
return null;
454-
}
455-
}
456-
457441
async getAll() {
458442
if (!this.apiUrl) {
459443
// 如果 apiUrl 为空,返回模拟数据

0 commit comments

Comments
 (0)