invite

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Note      string `json:"note"`
	MaxUses   int    `json:"max_uses"`
	ExpiresAt int64  `json:"expires_at"`
}

type Handler

type Handler struct{}

func (*Handler) AdminDelete

func (h *Handler) AdminDelete(c *app.Context, req api.IDPathRequest) (api.StatusResponse, error)

AdminDelete 撤销任意邀请码。

func (*Handler) AdminList

AdminList 列出全部邀请码(可按 code 搜索、按 creator_id 过滤)。

func (*Handler) Create

Create 建一个邀请码,归属当前用户。非管理员受双重限额约束。

func (*Handler) DeleteMine

func (h *Handler) DeleteMine(c *app.Context, req api.IDPathRequest) (api.StatusResponse, error)

DeleteMine 删除自己的邀请码;删他人的返回 404(不泄露存在性)。

func (*Handler) ListMine

ListMine 列出当前用户自己创建的邀请码(分页,可按 code 搜索)。

type ListRequest

type ListRequest struct {
	api.PaginationQuery
	Search    string `form:"search"`     // code 模糊搜索
	CreatorID string `form:"creator_id"` // 仅管理员列表使用,按建码人过滤
}

Jump to

Keyboard shortcuts

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