mirror of
https://git.boos.lat/aibo/BossChat.git
synced 2026-10-30 23:26:09 +00:00
0f40930a41
- Rename Go module: cs-agent → bosschat - Rename all import paths across 200+ Go files - Rename SDK: cs-ai-agent-sdk → bosschat-sdk - Rename message protocol: cs-agent:* → bosschat:* - Rename JS globals: CSAgentConfig → BossChatConfig - Rename CSS classes: cs-agent-* → bosschat-* - Update Makefile APP_NAME and ARCHIVE_NAME - Update logo assets - Fix display name: BoosChat → BossChat
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package builders
|
|
|
|
import (
|
|
"bosschat/internal/models"
|
|
"bosschat/internal/pkg/dto/response"
|
|
"bosschat/internal/pkg/utils"
|
|
"time"
|
|
)
|
|
|
|
func BuildCustomerContactResponse(item *models.CustomerContact) response.CustomerContactResponse {
|
|
if item == nil {
|
|
return response.CustomerContactResponse{}
|
|
}
|
|
return response.CustomerContactResponse{
|
|
ID: item.ID,
|
|
CustomerID: item.CustomerID,
|
|
ContactType: item.ContactType,
|
|
ContactValue: item.ContactValue,
|
|
IsPrimary: item.IsPrimary,
|
|
IsVerified: item.IsVerified,
|
|
VerifiedAt: utils.FormatTimePtr(item.VerifiedAt),
|
|
Source: item.Source,
|
|
Status: item.Status,
|
|
Remark: item.Remark,
|
|
CreatedAt: item.CreatedAt.Format(time.DateTime),
|
|
UpdatedAt: item.UpdatedAt.Format(time.DateTime),
|
|
}
|
|
}
|
|
|
|
func BuildCustomerContactList(list []models.CustomerContact) []response.CustomerContactResponse {
|
|
results := make([]response.CustomerContactResponse, 0, len(list))
|
|
for i := range list {
|
|
results = append(results, BuildCustomerContactResponse(&list[i]))
|
|
}
|
|
return results
|
|
}
|