AI驱动的全链路电商智能运营平台 —— 七大AI智能体矩阵
统一入口:https://e.rh.pub | 返回 JSON
登录/注册后获得 token,后续请求在 Header 中携带:
Authorization: Bearer 你的登录凭证
| 接口 | 方法 | 说明 |
|---|---|---|
/api/register | POST | 注册 {username, password, email} |
/api/login | POST | 登录 {username, password},返回 token |
/api/me | GET | 当前用户信息与 AI 额度 |
/api/logout | POST | 退出登录 |
| 接口 | 方法 | 说明 |
|---|---|---|
/api/products | GET | 商品列表 |
/api/products | POST | 添加商品 {name, category, price, cost, platform} |
/api/products/{id} | PUT | 更新商品 |
/api/products/{id} | DELETE | 删除商品 |
/api/products/search | POST | 🔍 语义搜索商品 {query, top_k}(Milvus 向量检索) |
添加商品时系统自动把「名称 + 类目 + 描述」向量化写入 Milvus,用自然语言即可检索最相似的商品,无需精确关键词。
# curl 语义搜索
curl https://e.rh.pub/api/products/search \
-H "Authorization: Bearer <你的token>" \
-H "Content-Type: application/json" \
-d '{"query":"碎花连衣裙","top_k":5}'
# 响应
{
"query": "碎花连衣裙",
"count": 2,
"products": [
{"id": 2, "name": "碎花雪纺连衣裙", "category": "女装", "price": 199, "similarity": 0.5157},
{"id": 5, "name": "碎花半身裙", "category": "女装", "price": 129, "similarity": 0.0952}
]
}
# Python 语义搜索
import requests
headers = {"Authorization": "Bearer <你的token>"}
r = requests.post("https://e.rh.pub/api/products/search",
json={"query": "夏天穿的裙子", "top_k": 5}, headers=headers)
for p in r.json()["products"]:
print(p["name"], "相关度", p["similarity"])
| 接口 | 方法 | 说明 |
|---|---|---|
/api/ai/market-analysis | POST | 市场分析报告 {keyword, category} |
/api/ai/select-products | POST | 智能选品推荐 {keyword, category} |
/api/ai/competitor-analysis | POST | 竞品四维分析 {product_name} |
/api/selection-reports | GET | 历史选品报告 |
| 接口 | 方法 | 说明 |
|---|---|---|
/api/ai/generate-copy | POST | 商品文案 {product_name, category, price, features} |
/api/ai/generate-marketing | POST | 营销文案 {product_name, category, features} |
/api/content-generations | GET | 历史生成记录 |
| 接口 | 方法 | 说明 |
|---|---|---|
/api/chat/sessions | POST | 创建会话,返回 session_id |
/api/chat/messages | POST | 发送消息 {session_id, message} |
/api/chat/messages/{session_id} | GET | 会话消息历史 |
| 接口 | 方法 | 说明 |
|---|---|---|
/api/dashboard | GET | 核心指标(商品数/报告数/内容数/会话数/Token) |
/api/plans | GET | 套餐列表 |
后端:FastAPI | 数据库:MySQL 8.0(关系数据) + Redis(缓存/会话) + Milvus v3.0(向量存储/语义搜索) | AI底座:如辉AI Token API(聚合 DeepSeek、通义、豆包等主流大模型)
import requests
BASE = "https://e.rh.pub/api"
# 注册
r = requests.post(f"{BASE}/register", json={"username":"demo","password":"123456"})
token = r.json()["token"]
headers = {"Authorization": f"Bearer {token}"}
# AI 市场分析
r = requests.post(f"{BASE}/ai/market-analysis", json={"keyword":"宠物用品"}, headers=headers)
print(r.json()["content"])
© 2026 广州如辉物联网科技有限公司 | 如辉AI电商系统