如辉AI电商系统 · 开发者文档

AI驱动的全链路电商智能运营平台 —— 七大AI智能体矩阵

统一入口:https://e.rh.pub | 返回 JSON

认证方式

登录/注册后获得 token,后续请求在 Header 中携带:

Authorization: Bearer 你的登录凭证

1. 用户认证

接口方法说明
/api/registerPOST注册 {username, password, email}
/api/loginPOST登录 {username, password},返回 token
/api/meGET当前用户信息与 AI 额度
/api/logoutPOST退出登录

2. 商品管理

接口方法说明
/api/productsGET商品列表
/api/productsPOST添加商品 {name, category, price, cost, platform}
/api/products/{id}PUT更新商品
/api/products/{id}DELETE删除商品
/api/products/searchPOST🔍 语义搜索商品 {query, top_k}(Milvus 向量检索)

商品语义搜索(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"])

3. AI 智能选品 Agent

接口方法说明
/api/ai/market-analysisPOST市场分析报告 {keyword, category}
/api/ai/select-productsPOST智能选品推荐 {keyword, category}
/api/ai/competitor-analysisPOST竞品四维分析 {product_name}
/api/selection-reportsGET历史选品报告

4. AI 内容生成 Agent

接口方法说明
/api/ai/generate-copyPOST商品文案 {product_name, category, price, features}
/api/ai/generate-marketingPOST营销文案 {product_name, category, features}
/api/content-generationsGET历史生成记录

5. AI 智能客服 Agent

接口方法说明
/api/chat/sessionsPOST创建会话,返回 session_id
/api/chat/messagesPOST发送消息 {session_id, message}
/api/chat/messages/{session_id}GET会话消息历史

6. 运营看板

接口方法说明
/api/dashboardGET核心指标(商品数/报告数/内容数/会话数/Token)
/api/plansGET套餐列表

7. 技术架构

后端:FastAPI | 数据库:MySQL 8.0(关系数据) + Redis(缓存/会话) + Milvus v3.0(向量存储/语义搜索) | AI底座:如辉AI Token API(聚合 DeepSeek、通义、豆包等主流大模型)

8. 快速开始(Python)

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电商系统