account

package
v0.0.0-...-96504fd Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Inside = &inside{}
View Source
var Request = &requestWith{}

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.Operation
	// 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.Operation
	// 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

	Options *Options

	Controllers []service.Controller
	// 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)  `json:"-"`
	SSEReconnect         func(uid, lastID string) `json:"-"`
	InlayRBAC            *rbac.RBAC               `json:"-"`
	AdminDefaultPassword string                   `json:"admin_default_password"`
	ApiPrefix            string                   `json:"prefix"`
	RBACFile             string                   `json:"rbac_file"`

	InlayUser     ztype.Maps      `json:"inlay_user"`
	Models        []define.Define `json:"-"`
	SSE           znet.SSEOption  `json:"-"`
	Expire        int             `json:"expire"`
	Only          bool            `json:"only"`
	DisabledLogIP bool            `json:"disabled_ip"`
	// 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