feat: 接口层同步 CallWithUser 与 ResScope 重命名

HTTPService.Invoke 新增 caller req.User 参数,指定时内部转发请求认证成该身份,配合 req-v2 新增的 Router.CallWithUser。

HttpController.AuthDB()、Orm.Model.SetAuthDB()、OrmController.AuthDB() 的返回值/参数类型从 req.ResAuthDB 同步改成 req.ResScope,跟 req-v2 那边的重命名保持一致。
This commit is contained in:
2026-07-21 18:02:16 +08:00
parent 9ad5d25836
commit 53169264da
2 changed files with 11 additions and 46 deletions
+5 -3
View File
@@ -30,7 +30,7 @@ const (
OrmRightJoin RelationType = "right"
)
type ModelDecorator func(Model) Model
type ModelDecorator = func(Model) Model
type Orm interface {
SetGlobalParams(g req.UserAccessor) Orm
@@ -83,7 +83,7 @@ type Model interface {
SetQueryField(...req.QueryField)
// SetRelationResult(code string, items []reflux.R)
GetJoinsCode() []string
SetAuthDB(req.ResAuthDB)
SetAuthDB(req.ResScope)
SetOrderBy(params ...OrderBy) Model
SetGroupBy(params ...GroupBy) Model
SetJoin(Join) Model
@@ -103,7 +103,7 @@ type Model interface {
}
type OrmController interface {
AuthDB() req.ResAuthDB
AuthDB() req.ResScope
}
type OrderBy interface {
@@ -119,6 +119,8 @@ type GroupBy interface {
type QueryWithRecursive interface {
ToQueryBuilder(*db.SelectDataset, Model) (*db.SelectDataset, any)
ToTreeData([]reflux.R) reflux.R
// RootCondition 返回锚点条件(pField = root),供外部如 Count() 在不展开递归查询的情况下复用。
RootCondition() exp.Expression
}
// @title 创建关联模型