feat(manual-entry): 支持筛选及全量导出 CSV
This commit is contained in:
@@ -96,6 +96,22 @@ func (s *Service) List(ctx context.Context, query ListQuery) (*PaginatedResult,
|
||||
return s.repo.List(ctx, query)
|
||||
}
|
||||
|
||||
// Export 按列表筛选条件生成 CSV;空筛选表示导出全部。
|
||||
func (s *Service) Export(ctx context.Context, query ListQuery) ([]byte, int, error) {
|
||||
if s.repo == nil {
|
||||
return nil, 0, ErrDependencyUnavailable
|
||||
}
|
||||
items, err := s.repo.ListForExport(ctx, query)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
data, err := buildManualEntryCSV(items)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
return data, len(items), nil
|
||||
}
|
||||
|
||||
// TodayAgentStats 返回今日(北京时间)各客服录单统计。
|
||||
func (s *Service) TodayAgentStats(ctx context.Context) ([]AgentDayStatsDTO, error) {
|
||||
if s.repo == nil {
|
||||
|
||||
Reference in New Issue
Block a user