Files
hfb_sys/backend/internal/modules/chat/dto.go
T
yml2213 a4189db4ca 业务更名为撞车并切换crash路由
用户可见文案与页面/API路径改为撞车与crash,保留mohong表与权限码兼容;移动端入口去掉租/撞图标。
2026-07-16 21:19:35 +08:00

124 lines
4.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package chat
import "time"
type Principal struct {
Type string
ID uint64
}
type ConversationDTO struct {
ID uint64 `json:"id"`
OrderID *uint64 `json:"order_id"`
ListingID *uint64 `json:"listing_id"`
LatestOrderID *uint64 `json:"latest_order_id,omitempty"`
LatestOrderNo string `json:"latest_order_no,omitempty"`
LatestOrderStatus string `json:"latest_order_status,omitempty"`
LatestHandoffStatus string `json:"latest_handoff_status,omitempty"`
LatestRefundStatus string `json:"latest_refund_status,omitempty"`
Type string `json:"type"`
SupportScene string `json:"support_scene,omitempty"`
Title string `json:"title"`
Status string `json:"status"`
Role string `json:"role"`
Participants []ParticipantDTO `json:"participants,omitempty"`
LastMessageID *uint64 `json:"last_message_id"`
LastMessagePreview string `json:"last_message_preview"`
LastMessageAt *time.Time `json:"last_message_at"`
LastSenderType string `json:"last_sender_type,omitempty"`
LastSenderID uint64 `json:"last_sender_id,omitempty"`
LastSenderRole string `json:"last_sender_role,omitempty"`
UnreadCount int64 `json:"unread_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// EnsureSupportRequest 创建/复用客服会话。
type EnsureSupportRequest struct {
// Scene 业务场景:general(默认)/ crash(撞车,兼容旧值 mohong
Scene string `json:"scene"`
}
type ParticipantDTO struct {
ID uint64 `json:"id"`
ConversationID uint64 `json:"conversation_id"`
ParticipantType string `json:"participant_type"`
ParticipantID uint64 `json:"participant_id"`
Role string `json:"role"`
Remark string `json:"remark"`
DisplayName string `json:"display_name"`
AvatarURL string `json:"avatar_url"`
LastReadAt *time.Time `json:"last_read_at"`
JoinedAt time.Time `json:"joined_at"`
}
type MessageDTO struct {
ID uint64 `json:"id"`
ConversationID uint64 `json:"conversation_id"`
SenderType string `json:"sender_type"`
SenderID uint64 `json:"sender_id"`
SenderRole string `json:"sender_role"`
SenderName string `json:"sender_name"`
SenderAvatar string `json:"sender_avatar"`
IsSelf bool `json:"is_self"`
IsRead bool `json:"is_read"`
ContentType string `json:"content_type"`
Content string `json:"content"`
AttachmentURLS []string `json:"attachment_urls"`
CreatedAt time.Time `json:"created_at"`
}
type UnreadCountDTO struct {
UnreadCount int64 `json:"unread_count"`
}
type SendMessageRequest struct {
Content string `json:"content"`
AttachmentURLS []string `json:"attachment_urls"`
}
type TransferRequest struct {
ToAdminID uint64 `json:"to_admin_id" binding:"required"`
}
type UpdateRemarkRequest struct {
Remark string `json:"remark"`
}
type SupportAdminDTO struct {
ID uint64 `json:"id"`
Nickname string `json:"nickname"`
SupportStatus string `json:"support_status"`
ChatCount int64 `json:"chat_count"`
}
type QuickReplyDTO struct {
ID uint64 `json:"id"`
AdminUserID uint64 `json:"admin_user_id"`
Title string `json:"title"`
Content string `json:"content"`
SortOrder int `json:"sort_order"`
IsGlobal bool `json:"is_global"`
}
type CreateQuickReplyRequest struct {
Title string `json:"title" binding:"required"`
Content string `json:"content" binding:"required"`
SortOrder int `json:"sort_order"`
IsGlobal bool `json:"is_global"`
}
type UpdateQuickReplyRequest struct {
Title string `json:"title"`
Content string `json:"content"`
SortOrder *int `json:"sort_order"`
}
type PaginatedResult struct {
Items interface{} `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
Counts interface{} `json:"counts,omitempty"`
}