feat: 完善聊天识别与规则页面响应式布局
- 按闲鱼协议字段识别官方系统消息、交易卡片和闲小蜜,清理空会话壳并补齐历史消息校正\n- 同步 README、项目展示页和 GitHub Wiki,补充在线聊天、账号自动评价与每日擦亮说明\n- 优化自动化规则页面的中等宽度布局,补充前端类型、响应式测试和嵌入资源
This commit is contained in:
1 parent
4d1f58c5ec
commit
fe3f715cdc
27 files changed
+336
-32
No files matched your search
@@ -110,6 +110,7 @@ func (s *ChatStore) LatestUnmaskedPeerName(ctx context.Context, cookieID, chatID
|
||||
var name string
|
||||
err := s.DB.QueryRowContext(ctx, `SELECT sender_name FROM chat_messages
|
||||
WHERE cookie_id=? AND chat_id=? AND direction='incoming' AND sender_name<>'' AND sender_name NOT LIKE '%***%'
|
||||
AND message_type<>'system'
|
||||
AND sender_name<>content AND sender_name NOT IN ('交易消息','系统消息','卡片消息','我完成了评价','对方完成了评价',
|
||||
'快给ta一个评价吧~','卖家已发货','买家已付款','买家已确认收货','等待您发货','超时未付款,系统关闭了订单','邀您填写售后问卷')
|
||||
ORDER BY sent_at DESC,id DESC LIMIT 1`, cookieID, chatID).Scan(&name)
|
||||
@@ -197,6 +198,14 @@ func (s *ChatStore) GetMessageByKey(ctx context.Context, cookieID, key string) (
|
||||
return &m, err
|
||||
}
|
||||
|
||||
// UpdateMessageType refreshes the classification of an already persisted
|
||||
// message when a later history response exposes richer protocol metadata.
|
||||
func (s *ChatStore) UpdateMessageType(ctx context.Context, cookieID, key, messageType string) error {
|
||||
_, err := s.DB.ExecContext(ctx, `UPDATE chat_messages SET message_type=?
|
||||
WHERE cookie_id=? AND message_key=?`, messageType, cookieID, key)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *ChatStore) ListSessions(ctx context.Context, userID int64, cookieID string, limit int) ([]ChatSession, error) {
|
||||
if limit <= 0 || limit > 500 {
|
||||
limit = 200
|
||||
|
||||
Reference in new issue
Block a user