Documentation
¶
Overview ¶
Package member 会员管理
Index ¶
- type Config
- type InvitedMember
- type Module
- func (m *Module) Add(state user.State, data *RegisterInfo, ip, ua, msg string) (*user.User, error)
- func (m *Module) AddSecurityLog(tx *orm.Tx, uid int64, content, ip, ua string) error
- func (m *Module) AddSecurityLogWithContext(tx *orm.Tx, uid int64, ctx *web.Context, content web.LocaleStringer) error
- func (m *Module) CurrentUser(ctx *web.Context) *user.User
- func (m *Module) Invited(uid int64, q *invitedQuery) (*query.Page[InvitedMember], error)
- func (m *Module) LeftJoin(sql *sqlbuilder.SelectStmt, alias, on string)
- func (m *Module) Middleware(next web.HandlerFunc, method, path, router string) web.HandlerFunc
- func (m *Module) SetLevel(tx *orm.Tx, uid, lv int64) error
- func (m *Module) SetType(tx *orm.Tx, uid, t int64) error
- func (m *Module) URLPrefix() string
- func (m *Module) UserModule() *user.Users
- type RegisterInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// User 用户相关的配置
User *user.Config `json:"user" xml:"user" yaml:"user" toml:"user"`
// 上传接口的相关配置
Upload *upload.Config `json:"upload" xml:"upload" yaml:"upload" toml:"upload"`
}
func (*Config) SanitizeConfig ¶
func (c *Config) SanitizeConfig() *web.FieldError
type InvitedMember ¶ added in v0.8.3
type InvitedMember struct {
XMLName struct{} `json:"-" cbor:"-" yaml:"-" xml:"member"`
ID int64 `json:"id,omitempty" yaml:"id,omitempty" xml:"id,attr,omitempty" cbor:"id,omitempty" comment:"id"`
NO string `json:"no" xml:"no" cbor:"no" yaml:"no" comment:"user no"`
Username string `json:"username" yaml:"username" xml:"username" cbor:"username" comment:"username"`
Inviter int64 `json:"inviter,omitempty" yaml:"inviter,omitempty" xml:"inviter,omitempty" cbor:"inviter,omitempty" comment:"inviter"`
Birthday time.Time `json:"birthday,omitzero" yaml:"birthday,omitempty" cbor:"birthday,omitzero" xml:"birthday,omitzero" comment:"birthday"`
Sex types.Sex `json:"sex,omitempty" xml:"sex,attr,omitempty" cbor:"sex,omitempty" yaml:"sex,omitempty" comment:"sex"`
Nickname string `json:"nickname,omitempty" xml:"nickname,omitempty" cbor:"nickname,omitempty" yaml:"nickname,omitempty" comment:"nickname"`
Avatar string `json:"avatar,omitempty" xml:"avatar,omitempty" cbor:"avatar,omitempty" yaml:"avatar,omitempty" comment:"avatar"`
Level int64 `json:"level,omitempty" yaml:"level,omitempty" xml:"level,attr,omitempty" cbor:"level,omitempty"`
Type int64 `json:"type,omitempty" yaml:"type,omitempty" xml:"type,attr,omitempty" cbor:"type,omitempty"`
}
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module 不带权限功能的会员管理模块
func Install ¶
func Install(mod *cmfx.Module, o *Config, up *upload.Module, adminL *admin.Module, ts []string, levels []string) *Module
Install 安装数据
ts 可用的类型名称; levels 可用的级别名称;
func (*Module) AddSecurityLog ¶
AddSecurityLog 记录一条安全日志
func (*Module) AddSecurityLogWithContext ¶
func (m *Module) AddSecurityLogWithContext(tx *orm.Tx, uid int64, ctx *web.Context, content web.LocaleStringer) error
AddSecurityLogWithContext 从 web.Context 中记录一条安全日志
func (*Module) CurrentUser ¶
CurrentUser 获取当前登录的用户信息
func (*Module) LeftJoin ¶ added in v0.8.7
func (m *Module) LeftJoin(sql *sqlbuilder.SelectStmt, alias, on string)
LeftJoin 将 以 LEFT JOIN 的形式插入到 sql 语句中
alias 为 [infoPO] 表的别名,on 为 LEFT JOIN 的条件。
func (*Module) Middleware ¶
func (m *Module) Middleware(next web.HandlerFunc, method, path, router string) web.HandlerFunc
Middleware 验证是否登录
func (*Module) UserModule ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.