feat: 重构订单和物流信息展示格式
主要改动: - 订单列表:使用 order_list 格式,展示 5 个订单(全部状态) - 订单详情:使用 order_detail 格式,优化价格和时间显示 - 物流信息:使用 logistics 格式,根据 track id 动态生成步骤 - 商品图片:从 orderProduct.imageUrl 字段获取 - 时间格式:统一为 YYYY-MM-DD HH:MM:SS - 多语言支持:amountLabel、orderTime 支持中英文 - 配置管理:新增 FRONTEND_URL 环境变量 - API 集成:改进 Mall API tracks 数据解析 - 认证优化:account_id 从 webhook 动态获取 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -367,7 +367,8 @@ async def process_message(
|
||||
message: str,
|
||||
history: list[dict] = None,
|
||||
context: dict = None,
|
||||
user_token: str = None
|
||||
user_token: str = None,
|
||||
mall_token: str = None
|
||||
) -> AgentState:
|
||||
"""Process a user message through the agent workflow
|
||||
|
||||
@@ -379,6 +380,7 @@ async def process_message(
|
||||
history: Previous conversation history
|
||||
context: Existing conversation context
|
||||
user_token: User JWT token for API calls
|
||||
mall_token: Mall API token (if different from user_token)
|
||||
|
||||
Returns:
|
||||
Final agent state with response
|
||||
@@ -393,7 +395,8 @@ async def process_message(
|
||||
current_message=message,
|
||||
messages=history,
|
||||
context=context,
|
||||
user_token=user_token
|
||||
user_token=user_token,
|
||||
mall_token=mall_token
|
||||
)
|
||||
|
||||
# Get compiled graph
|
||||
|
||||
@@ -66,6 +66,7 @@ class AgentState(TypedDict):
|
||||
user_id: str # User identifier
|
||||
account_id: str # B2B account identifier
|
||||
user_token: Optional[str] # User JWT token for API calls
|
||||
mall_token: Optional[str] # Mall API token (if different from user_token)
|
||||
|
||||
# ============ Message Content ============
|
||||
messages: list[dict[str, Any]] # Conversation history [{role, content}]
|
||||
@@ -117,7 +118,8 @@ def create_initial_state(
|
||||
current_message: str,
|
||||
messages: Optional[list[dict[str, Any]]] = None,
|
||||
context: Optional[dict[str, Any]] = None,
|
||||
user_token: Optional[str] = None
|
||||
user_token: Optional[str] = None,
|
||||
mall_token: Optional[str] = None
|
||||
) -> AgentState:
|
||||
"""Create initial agent state for a new message
|
||||
|
||||
@@ -129,6 +131,7 @@ def create_initial_state(
|
||||
messages: Previous conversation history
|
||||
context: Existing conversation context
|
||||
user_token: User JWT token for API calls
|
||||
mall_token: Mall API token (if different from user_token)
|
||||
|
||||
Returns:
|
||||
Initialized AgentState
|
||||
@@ -139,6 +142,7 @@ def create_initial_state(
|
||||
user_id=user_id,
|
||||
account_id=account_id,
|
||||
user_token=user_token,
|
||||
mall_token=mall_token,
|
||||
|
||||
# Messages
|
||||
messages=messages or [],
|
||||
|
||||
Reference in New Issue
Block a user