优化结构

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
+2 -8
View File
@@ -5,8 +5,6 @@ import (
"kra/internal/biz/system"
"time"
"kra/pkg/database/pagination"
"gorm.io/gorm"
)
@@ -53,12 +51,8 @@ func (r *auditQueryRepo) ListLogins(ctx context.Context, page, size int, q *syst
db = db.Where("created_at <= ?", *q.EndCreatedAt)
}
}
var total int64
if err := db.Count(&total).Error; err != nil {
return nil, 0, err
}
var pos []loginLogPO
if err := pagination.ApplyRequired(db.Order("id desc"), page, size, 100).Find(&pos).Error; err != nil {
pos, total, err := queryRows[loginLogPO](db.Order("id desc"), page, size, true, true)
if err != nil {
return nil, 0, err
}
ids := make([]uint, 0, len(pos))