支持后台转移发布所有权
This commit is contained in:
@@ -63,7 +63,7 @@ func (r *Repository) Create(ctx context.Context, ownerID uint64, req CreateReque
|
||||
// 发布提交时建发布群
|
||||
var conversationID uint64
|
||||
if r.chatCreator != nil {
|
||||
convID, err := r.chatCreator.EnsureListingConversation(tx, listing)
|
||||
convID, err := r.chatCreator.EnsureListingConversation(tx, listing, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -137,6 +137,14 @@ func (r *Repository) CreateFromExternalUpload(ctx context.Context, upload extern
|
||||
if err := tx.Create(&listing).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
var conversationID uint64
|
||||
if r.chatCreator != nil {
|
||||
convID, err := r.chatCreator.EnsureListingConversation(tx, listing, admin.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
conversationID = convID
|
||||
}
|
||||
matchedAdminID := admin.ID
|
||||
ownerID := owner.ID
|
||||
listingID := listing.ID
|
||||
@@ -155,6 +163,7 @@ func (r *Repository) CreateFromExternalUpload(ctx context.Context, upload extern
|
||||
return err
|
||||
}
|
||||
dto = toDTO(account, listing)
|
||||
dto.ListingGroupConversationID = conversationID
|
||||
return nil
|
||||
})
|
||||
return dto, err
|
||||
|
||||
Reference in New Issue
Block a user