125 lines
4.3 KiB
Go
125 lines
4.3 KiB
Go
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"`
|
||
AdminRemark string `json:"admin_remark,omitempty"`
|
||
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"`
|
||
}
|