优化结构

This commit is contained in:
Yvan
2026-08-28 09:19:54 +08:00
parent 03a4131f6e
commit 279692375b
57 changed files with 778 additions and 799 deletions
+3 -5
View File
@@ -10,6 +10,8 @@ import (
"strings"
"time"
"kra/pkg/database/pagination"
"gorm.io/gorm"
)
@@ -171,11 +173,7 @@ func (r *exportRepo) ListExportTemplates(ctx context.Context, page, size int, q
return nil, 0, err
}
var pos []exportTemplatePO
// This module applies pageSize and its raw offset formula verbatim instead
// of using the shared PageInfo normalization.
if size != 0 {
db = db.Limit(size).Offset(size * (page - 1))
}
db = pagination.Apply(db, page, size, 100)
if err := db.Find(&pos).Error; err != nil {
return nil, 0, err
}