优化结构

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"
)
@@ -39,12 +37,8 @@ func (r *auditQueryRepo) ListDataAccess(ctx context.Context, page, size int, q *
db = db.Where("target_table LIKE ?", "%"+q.TargetTable+"%")
}
}
var total int64
if err := db.Count(&total).Error; err != nil {
return nil, 0, err
}
var pos []DataAccessLogPO
if err := pagination.ApplyRequired(db.Order("id desc"), page, size, 100).Find(&pos).Error; err != nil {
pos, total, err := queryRows[DataAccessLogPO](db.Order("id desc"), page, size, true, true)
if err != nil {
return nil, 0, err
}
out := make([]*system.DataAccessLog, 0, len(pos))