重构: User 相关类型拆分出 user_accessor.go/user_runtime.go

UserAccessor、UserRuntime 从 user.go 拆成独立文件,user.go 只保留 User 接口本身。
This commit is contained in:
2026-07-22 09:11:26 +08:00
parent a0ec297b61
commit 1868c8dd15
3 changed files with 103 additions and 29 deletions
Regular → Executable
-29
View File
@@ -19,32 +19,3 @@ type User interface {
// 是否匿名用户
IsAnonymous() bool
}
type UserRuntime struct {
platform string
saas string
}
// 账号运行平台
func (this UserRuntime) Platform() string {
return this.platform
}
// 账号运行租户
func (this UserRuntime) SaaS() string {
return this.saas
}
type UserRuntimeOption func(option *UserRuntime)
func UserRuntimePlatform(value string) UserRuntimeOption {
return func(option *UserRuntime) {
option.platform = value
}
}
func UserRuntimeSaaS(value string) UserRuntimeOption {
return func(option *UserRuntime) {
option.saas = value
}
}