Files
booschat/internal/builders/company_builder.go
T
Aibo117 0f40930a41 refactor: rebrand from cs-agent to BossChat
- 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
2026-05-26 13:17:07 +08:00

33 lines
751 B
Go

package builders
import (
"bosschat/internal/models"
"bosschat/internal/pkg/dto/response"
"time"
)
func BuildCompany(item *models.Company) *response.CompanyResponse {
if item == nil {
return nil
}
return &response.CompanyResponse{
ID: item.ID,
Name: item.Name,
Code: item.Code,
Status: item.Status,
Remark: item.Remark,
CreatedAt: item.CreatedAt.Format(time.DateTime),
UpdatedAt: item.UpdatedAt.Format(time.DateTime),
}
}
func BuildCompanyList(list []models.Company) []response.CompanyResponse {
results := make([]response.CompanyResponse, 0, len(list))
for _, item := range list {
if company := BuildCompany(&item); company != nil {
results = append(results, *company)
}
}
return results
}