Files
aidemo-202606/mytest.txt
2026-06-13 16:53:08 +08:00

66 lines
1.8 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

测试插入
# ==================== 创建订单 ====================
# 创建订单1
curl -X POST http://localhost:8080/api/orders \
-H "Content-Type: application/json" \
-d '{
"kehuMingzi": "张三",
"items": [
{"shangpinMingcheng": "苹果", "danjia": 5.5, "shuliang": 3},
{"shangpinMingcheng": "香蕉", "danjia": 3.0, "shuliang": 5}
]
}'
# 创建订单2
curl -X POST http://localhost:8080/api/orders \
-H "Content-Type: application/json" \
-d '{
"kehuMingzi": "李四",
"items": [
{"shangpinMingcheng": "西瓜", "danjia": 20.0, "shuliang": 1},
{"shangpinMingcheng": "葡萄", "danjia": 12.5, "shuliang": 2}
]
}'
# 创建订单3
curl -X POST http://localhost:8080/api/orders \
-H "Content-Type: application/json" \
-d '{
"kehuMingzi": "王五",
"items": [
{"shangpinMingcheng": "苹果汁", "danjia": 8.0, "shuliang": 4},
{"shangpinMingcheng": "橙汁", "danjia": 6.5, "shuliang": 6}
]
}'
# ==================== 查询订单 ====================
# 查询所有订单
curl http://localhost:8080/api/orders
# 按ID查询订单假设ID为1
curl http://localhost:8080/api/orders/1
# ==================== 搜索订单(按商品名) ====================
# 搜索含"苹果"的订单
curl "http://localhost:8080/api/orders/search?name=苹果"
curl -G "http://localhost:8080/api/orders/search" --data-urlencode "name=苹果"
curl "http://localhost:8080/api/orders/search?name=%E8%8B%B9%E6%9E%9C"
curl "http://localhost:8080/api/orders/search?name=%25%27%20OR%201%3D1%20--%20"
# ==================== 取消订单 ====================
# 取消订单假设ID为1
curl -X PUT http://localhost:8080/api/orders/1/cancel
# ==================== 统计报表 ====================
# 查看订单统计报表
curl http://localhost:8080/api/orders/report