feat(core): 下沉查询密码工具与配置快照解码
Verify / verify (push) Canceled after 0s

This commit is contained in:
zhangdeman committed 2026-11-28 03:10:18 -08:00
1 parent bedcf4dd83
commit d2a9033695
23 files changed
+1544 -6

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
package query
// ListTarget 聚合一次列表查询的结果接收目标及是否统计总数,不包含查询条件。
type ListTarget[T any] struct {
Records *[]T `json:"-" dc:"接收本次查询记录的目标切片"`
Total *int64 `json:"-" dc:"接收符合条件的记录总数"`
DisableTotal bool `json:"-" dc:"是否沿用列表长度作为总数,避免执行额外计数"`
}
// NewListTarget 创建类型可推导的列表结果接收目标。
// 入参:records 为记录接收切片,total 为总数接收指针,disableTotal 表示跳过额外计数。
// 返回:供 ListAndTotal 使用的纯查询结果目标。
func NewListTarget[T any](records *[]T, total *int64, disableTotal bool) ListTarget[T] {
return ListTarget[T]{
Records: records,
Total: total,
DisableTotal: disableTotal,
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.