controllers

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserController

type UserController struct {
	Service *services.UserService
}

UserController 用户 @Controller @Route /api/v1 @Authorization(Admin)

func (*UserController) Echo

func (c *UserController) Echo(ctx ctxpkg.Context, msg []byte) error

Echo handles WebSocket messages. Each incoming []byte is echoed back with a prefix. @GET /ws @WS @Ignore(Authorization)

func (*UserController) HealthCheck

func (c *UserController) HealthCheck(ctx ctxpkg.Context) error

HealthCheck 健康检查(无需鉴权) @GET /health @Ignore(Authorization,Global)

func (*UserController) ModifyUser

func (c *UserController) ModifyUser(ctx ctxpkg.Context, query models.UserQuery, db *services.DemoDB) (int, error)

ModifyUser 修改用户 @POST /user @POST /user_info @Log(stage=before)

func (*UserController) Stream

func (c *UserController) Stream(ctx ctxpkg.Context, w *ctxpkg.SSEWriter) error

Stream demonstrates Server-Sent Events. The handler receives an SSEWriter and pushes a series of events to the client. @GET /stream @SSE

Jump to

Keyboard shortcuts

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