优化
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user