init: 遗留订单系统初始版本

This commit is contained in:
micrograils
2026-06-13 16:53:08 +08:00
commit caffc89686
16 changed files with 1506 additions and 0 deletions

65
mytest.txt Normal file
View File

@@ -0,0 +1,65 @@
测试插入
# ==================== 创建订单 ====================
# 创建订单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