account

package
v0.0.0-...-40778be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PermisMiddleware

func PermisMiddleware(r *znet.Engine, ignore ...string) error

func SendRealtime

func SendRealtime(uid string, data string, event ...string) bool

Types

type AccountModel

type AccountModel struct {
	*model.Store
	// contains filtered or unexported fields
}

func GetAccountModel

func GetAccountModel() *AccountModel

type Index

type Index struct {
	service.App

	Path string
	// contains filtered or unexported fields
}

func (*Index) AnyLogout

func (h *Index) AnyLogout(c *znet.Context) (any, error)

AnyLogout 用户退出

func (*Index) AnyPassword

func (h *Index) AnyPassword(c *znet.Context) (data any, err error)

AnyPassword 修改密码

func (*Index) GetInfo

func (h *Index) GetInfo(c *znet.Context) (interface{}, error)

GetInfo 获取用户信息

func (*Index) GetLogs

func (h *Index) GetLogs(c *znet.Context) (data any, err error)

GetLogs 操作日志

func (*Index) GetMessage

func (h *Index) GetMessage(c *znet.Context) (data ztype.Map, err error)

GetMessage 站内消息

func (*Index) Init

func (h *Index) Init(r *znet.Engine) error

func (*Index) POSTAvatar

func (h *Index) POSTAvatar(c *znet.Context) (any, error)

POSTAvatar 上传用户头像

func (*Index) PatchMe

func (h *Index) PatchMe(c *znet.Context) (any, error)

PatchMe 修改当前用户信息

type Message

type Message struct {
	service.App

	Path string
	// contains filtered or unexported fields
}

func (*Message) AnyRealtime

func (h *Message) AnyRealtime(c *znet.Context) error

AnyRealtime 实时通知

func (*Message) Get

func (h *Message) Get(c *znet.Context) (data ztype.Map, err error)

Get 站内通知列表

func (*Message) Init

func (h *Message) Init(r *znet.Engine) error

type MessageModel

type MessageModel struct {
	*model.Store
	// contains filtered or unexported fields
}

func GetMessageModel

func GetMessageModel() (*MessageModel, error)

func (*MessageModel) SendMessage

func (m *MessageModel) SendMessage(from, to, title, message string, mtype ...string) (err error)

func (*MessageModel) Unread

func (m *MessageModel) Unread(uid string) (ztype.Map, error)

type Module

type Module struct {
	service.ModuleLifeCycle
	service.App

	Request     *requestWith
	Inside      *inside
	Controllers []service.Controller
	Options     Options
	// contains filtered or unexported fields
}

func New

func New(key string, opt ...func(o *Options)) *Module

func (*Module) Controller

func (m *Module) Controller() []service.Controller

func (*Module) Done

func (m *Module) Done(zdi.Invoker) (err error)

func (*Module) Load

func (m *Module) Load(zdi.Invoker) (any, error)

func (*Module) Name

func (m *Module) Name() string

func (*Module) Start

func (m *Module) Start(di zdi.Invoker) (err error)

func (*Module) Stop

func (m *Module) Stop() error

func (*Module) Tasks

func (m *Module) Tasks() []service.Task

type Options

type Options struct {
	InitDB       func() (*zdb.DB, error)  `z:"-"`
	SSEReconnect func(uid, lastID string) `z:"-"`
	InlayRBAC    *rbac.RBAC               `z:"-"`

	ApiPrefix            string          `z:"prefix"`
	RBACFile             string          `z:"rbac_file"`
	AdminDefaultPassword string          `z:"admin_default_password"`
	ModelPrefix          string          `z:"model_prefix"`
	InlayUser            ztype.Maps      `z:"inlay_user"`
	Models               []schema.Schema `z:"-"`
	SSE                  znet.SSEOption  `z:"-"`
	Expire               int64           `z:"expire"`
	RefreshExpire        int64           `z:"refresh_expire"`
	Only                 bool            `z:"only"`
	DisabledLogIP        bool            `z:"disabled_ip"`
	EnableRegister       bool            `z:"register"`
	// contains filtered or unexported fields
}

func (Options) ConfKey

func (o Options) ConfKey() string

func (Options) DisableWrite

func (o Options) DisableWrite() bool

type User

type User struct {
	service.App

	Path string
	// contains filtered or unexported fields
}

func (*User) Get

func (h *User) Get(c *znet.Context) (data *model.PageData, err error)

Get 用户列表

func (*User) Init

func (h *User) Init(r *znet.Engine) error

func (*User) Post

func (h *User) Post(c *znet.Context) (id interface{}, err error)

Post 新增用户

func (*User) UIDDELETE

func (h *User) UIDDELETE(c *znet.Context) (res interface{}, err error)

UIDDELETE 删除用户

func (*User) UIDPut

func (h *User) UIDPut(c *znet.Context) (res interface{}, err error)

UIDPut 修改用户

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL