2bbf42b741
Remove Agent Desk users, roles, login sessions, tokens, and local permission persistence. Expose the backend as an embeddable ai-agent module with host-provided subject lookup and operation authorization callbacks, and complete the frontend/backend repository split.
33 lines
794 B
Go
33 lines
794 B
Go
package builders
|
|
|
|
import (
|
|
"code.tczkiot.com/wlw/ai-agent/internal/models"
|
|
"code.tczkiot.com/wlw/ai-agent/internal/pkg/dto/response"
|
|
)
|
|
|
|
func BuildQuickReplyResponse(item *models.QuickReply) *response.QuickReplyResponse {
|
|
if item == nil {
|
|
return nil
|
|
}
|
|
return &response.QuickReplyResponse{
|
|
ID: item.ID,
|
|
GroupName: item.GroupName,
|
|
Title: item.Title,
|
|
Content: item.Content,
|
|
Status: item.Status,
|
|
SortNo: item.SortNo,
|
|
CreatedBy: item.CreateUserID,
|
|
}
|
|
}
|
|
|
|
func BuildQuickReplyResponses(list []models.QuickReply) []response.QuickReplyResponse {
|
|
results := make([]response.QuickReplyResponse, 0, len(list))
|
|
for _, item := range list {
|
|
result := BuildQuickReplyResponse(&item)
|
|
if result != nil {
|
|
results = append(results, *result)
|
|
}
|
|
}
|
|
return results
|
|
}
|