Files
hfb_sys/backend/internal/modules/chat/adapter.go
T
2026-06-17 22:31:46 +08:00

25 lines
661 B
Go

package chat
import (
"gorm.io/gorm"
"hfb_sys/backend/internal/model"
)
// ListingChatCreatorAdapter 适配器,实现 listing.ListingChatCreator 接口
type ListingChatCreatorAdapter struct {
// 无需字段,直接调用包级函数
}
func NewListingChatCreatorAdapter() *ListingChatCreatorAdapter {
return &ListingChatCreatorAdapter{}
}
// EnsureListingConversation 实现接口
func (a *ListingChatCreatorAdapter) EnsureListingConversation(tx *gorm.DB, listing model.RentalListing, supportAdminID uint64) (uint64, error) {
conv, err := EnsureListingConversation(tx, listing, supportAdminID)
if err != nil {
return 0, err
}
return conv.ID, nil
}