This commit is contained in:
2026-08-15 01:58:41 +08:00
parent e55fb57432
commit 1a5969897a
32 changed files with 687 additions and 475 deletions
+11 -3
View File
@@ -2,9 +2,17 @@ package service
import (
"context"
"kra/internal/biz"
)
func (s *AuditService) LogDates(ctx context.Context, month string) (map[string]any, error) {
type LogViewerService struct{ uc *biz.AuditUsecase }
func NewLogViewerService(uc *biz.AuditUsecase) *LogViewerService {
return &LogViewerService{uc: uc}
}
func (s *LogViewerService) LogDates(ctx context.Context, month string) (map[string]any, error) {
items, err := s.uc.LogDates(ctx, month)
if err != nil {
return nil, err
@@ -15,7 +23,7 @@ func (s *AuditService) LogDates(ctx context.Context, month string) (map[string]a
}
return map[string]any{"month": month, "dates": out}, nil
}
func (s *AuditService) LogFiles(ctx context.Context, date string) (map[string]any, error) {
func (s *LogViewerService) LogFiles(ctx context.Context, date string) (map[string]any, error) {
items, err := s.uc.LogFiles(ctx, date)
if err != nil {
return nil, err
@@ -26,7 +34,7 @@ func (s *AuditService) LogFiles(ctx context.Context, date string) (map[string]an
}
return map[string]any{"date": date, "files": out}, nil
}
func (s *AuditService) LogContent(ctx context.Context, date, path string, cursor *int64) (map[string]any, error) {
func (s *LogViewerService) LogContent(ctx context.Context, date, path string, cursor *int64) (map[string]any, error) {
v, err := s.uc.LogContent(ctx, date, path, cursor)
if err != nil {
return nil, err