重构: User 相关类型拆分出 user_accessor.go/user_runtime.go
UserAccessor、UserRuntime 从 user.go 拆成独立文件,user.go 只保留 User 接口本身。
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user