优化结构

This commit is contained in:
Yvan
2026-08-28 10:51:19 +08:00
parent fec3820464
commit 5b17f47141
12 changed files with 63 additions and 31 deletions
+3 -3
View File
@@ -42,7 +42,7 @@ func apiResponses(items []*system.API) []*dto.APIResponse {
}
func (s *APIService) ListAPI(ctx context.Context, req *dto.APIListRequest) ([]*dto.APIResponse, int64, error) {
items, total, err := s.uc.ListAPIs(ctx, req.Page, req.PageSize, &system.API{Path: req.Path, Description: req.Description, APIGroup: req.APIGroup, Method: req.Method, OrderKey: req.OrderKey, Desc: req.Desc})
items, total, err := s.uc.ListAPIs(ctx, req.Page, req.PageSize, &system.APIFilter{Path: req.Path, Description: req.Description, APIGroup: req.APIGroup, Method: req.Method, OrderKey: req.OrderKey, Desc: req.Desc})
if err != nil {
return nil, 0, err
}
@@ -50,7 +50,7 @@ func (s *APIService) ListAPI(ctx context.Context, req *dto.APIListRequest) ([]*d
}
func (s *APIService) AllAPI(ctx context.Context, strict bool) ([]*dto.APIResponse, error) {
items, _, err := s.uc.ListAPIs(ctx, 0, 0, &system.API{StrictAll: strict})
items, _, err := s.uc.ListAPIs(ctx, 0, 0, &system.APIFilter{StrictAll: strict})
if err != nil {
return nil, err
}
@@ -61,7 +61,7 @@ func (s *APIService) Groups(ctx context.Context) ([]string, map[string]string, e
// The compatible group endpoint uses an unqualified Find, whose natural order is
// the primary-key ascending order. GetAllApis intentionally uses id DESC,
// so do not reuse it here or the group/dropdown order changes.
items, _, err := s.uc.ListAPIs(ctx, 0, 0, &system.API{OrderKey: "id"})
items, _, err := s.uc.ListAPIs(ctx, 0, 0, &system.APIFilter{OrderKey: "id"})
if err != nil {
return nil, nil, err
}