优化快捷回复功能
This commit is contained in:
@@ -883,7 +883,11 @@ func (r *Repository) ListConversationsWithFilter(principal Principal, page, page
|
||||
|
||||
items := make([]ConversationDTO, 0, len(rows))
|
||||
for _, row := range rows {
|
||||
items = append(items, row.toDTO(nil))
|
||||
participants, err := r.participants(row.ID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, row.toDTO(participants))
|
||||
}
|
||||
return &PaginatedResult{Items: items, Total: total, Page: page, PageSize: pageSize}, nil
|
||||
}
|
||||
@@ -957,8 +961,12 @@ func (r *Repository) ListQuickReplies(adminID uint64) ([]QuickReplyDTO, error) {
|
||||
|
||||
// CreateQuickReply 创建快捷回复
|
||||
func (r *Repository) CreateQuickReply(adminID uint64, req CreateQuickReplyRequest) (*QuickReplyDTO, error) {
|
||||
ownerID := adminID
|
||||
if req.IsGlobal {
|
||||
ownerID = 0
|
||||
}
|
||||
reply := model.ChatQuickReply{
|
||||
AdminUserID: adminID,
|
||||
AdminUserID: ownerID,
|
||||
Title: req.Title,
|
||||
Content: req.Content,
|
||||
SortOrder: req.SortOrder,
|
||||
@@ -972,7 +980,7 @@ func (r *Repository) CreateQuickReply(adminID uint64, req CreateQuickReplyReques
|
||||
Title: reply.Title,
|
||||
Content: reply.Content,
|
||||
SortOrder: reply.SortOrder,
|
||||
IsGlobal: false,
|
||||
IsGlobal: reply.AdminUserID == 0,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user