优化结构

This commit is contained in:
Yvan
2026-08-20 23:02:06 +08:00
parent 63dbb4cfbc
commit e65cf0b1d0
338 changed files with 622 additions and 481 deletions
-27
View File
@@ -1,27 +0,0 @@
package biz
import "context"
type DataScope struct {
All bool
Scope int
UserID uint
AuthorityID uint
PrimaryDeptID uint
OwnerUserID uint
DepartmentIDs []uint
RequestID string
Method string
Path string
}
type dataScopeKey struct{}
func NewDataScopeContext(ctx context.Context, scope DataScope) context.Context {
return context.WithValue(ctx, dataScopeKey{}, scope)
}
func DataScopeFromContext(ctx context.Context) (DataScope, bool) {
scope, ok := ctx.Value(dataScopeKey{}).(DataScope)
return scope, ok
}