Documentation
¶
Index ¶
- type CreateRequest
- type Handler
- func (h *Handler) AdminDelete(c *app.Context, req api.IDPathRequest) (api.StatusResponse, error)
- func (h *Handler) AdminList(c *app.Context, req ListRequest) (api.PaginatedResponse[models.InviteCode], error)
- func (h *Handler) Create(c *app.Context, req CreateRequest) (api.Created[models.InviteCode], error)
- func (h *Handler) DeleteMine(c *app.Context, req api.IDPathRequest) (api.StatusResponse, error)
- func (h *Handler) ListMine(c *app.Context, req ListRequest) (api.PaginatedResponse[models.InviteCode], error)
- type ListRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
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 ¶
func (h *Handler) AdminList(c *app.Context, req ListRequest) (api.PaginatedResponse[models.InviteCode], error)
AdminList 列出全部邀请码(可按 code 搜索、按 creator_id 过滤)。
func (*Handler) Create ¶
func (h *Handler) Create(c *app.Context, req CreateRequest) (api.Created[models.InviteCode], error)
Create 建一个邀请码,归属当前用户。非管理员受双重限额约束。
func (*Handler) DeleteMine ¶
func (h *Handler) DeleteMine(c *app.Context, req api.IDPathRequest) (api.StatusResponse, error)
DeleteMine 删除自己的邀请码;删他人的返回 404(不泄露存在性)。
func (*Handler) ListMine ¶
func (h *Handler) ListMine(c *app.Context, req ListRequest) (api.PaginatedResponse[models.InviteCode], error)
ListMine 列出当前用户自己创建的邀请码(分页,可按 code 搜索)。
type ListRequest ¶
type ListRequest struct {
api.PaginationQuery
Search string `form:"search"` // code 模糊搜索
CreatorID string `form:"creator_id"` // 仅管理员列表使用,按建码人过滤
}
Click to show internal directories.
Click to hide internal directories.