handler

package
v0.0.0-...-91e59be Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERRNO_OK               = 0
	ERRNO_INVALID_ARGUMENT = 4000
	ERRNO_INTERNAL_ERROR   = 5000
)

error number

View Source
const (
	ERRSTR_OK               = "ok"
	ERRSTR_INVALID_ARGUMENT = "invalid parameter"
	ERRSTR_INTERNAL_ERROR   = "internal error"
)

error str

Variables

View Source
var (
	ProviderSet = wire.NewSet(NewUserHandler)
)

Functions

func GetLocFromAcceptLanguage

func GetLocFromAcceptLanguage(ctx *gin.Context) string

Types

type UserHandler

type UserHandler struct{}

func NewUserHandler

func NewUserHandler() *UserHandler

func (*UserHandler) Create

func (h *UserHandler) Create(ctx *gin.Context)

Create

@Tags			user
@Description	create
@Accept			json
@Produce		json
@Param			body	body		vo.ReqCreateUser	true	" "
@Success		200		{object}	responseWithoutData
@Failure		200		{object}	responseWithoutData
@Router			/api/v1/user [POST]

func (*UserHandler) Delete

func (h *UserHandler) Delete(ctx *gin.Context)

Delete

@Tags			user
@Description	delete
@Accept			json
@Produce		json
@Param			id	path		int64	true	" "
@Success		200	{object}	responseWithoutData
@Failure		200	{object}	responseWithoutData
@Router			/api/v1/user/:id [DELETE]

func (*UserHandler) Login

func (h *UserHandler) Login(ctx *gin.Context)

Login

@Tags			user
@Description	login
@Accept			json
@Produce		json
@Param			body	body		vo.ReqLogin	true	" "
@Success		200		{object}	responseWithoutData
@Failure		200		{object}	responseWithoutData
@Router			/api/v1/user/login [POST]

func (*UserHandler) Query

func (h *UserHandler) Query(ctx *gin.Context)

Query

@Tags			user
@Description	query
@Produce		json
@Param			id	path		int64	true	" "
@Success		200	{object}	response[po.User]
@Failure		200	{object}	responseWithoutData
@Router			/api/v1/user/:id [GET]

func (*UserHandler) QueryList

func (h *UserHandler) QueryList(ctx *gin.Context)

QueryList

@Tags			user
@Description	query list
@Produce		json
@Param			offset	query		int	true	" "
@Param			limit	query		int	true	" "
@Success		200		{object}	response[[]po.User]
@Failure		200		{object}	responseWithoutData
@Router			/api/v1/user/:id [GET]

func (*UserHandler) Refresh

func (h *UserHandler) Refresh(ctx *gin.Context)

Refresh

@Tags			user
@Description	refresh
@Accept			json
@Produce		json
@Success		200	{object}	responseWithoutData
@Failure		200	{object}	responseWithoutData
@Router			/api/v1/user/refresh [POST]

func (*UserHandler) Update

func (h *UserHandler) Update(ctx *gin.Context)

Update

@Tags			user
@Description	update
@Accept			json
@Produce		json
@Param			id		path		int64				true	" "
@Param			body	body		vo.ReqCreateUser	true	" "
@Success		200		{object}	responseWithoutData
@Failure		200		{object}	responseWithoutData
@Router			/api/v1/user/:id [PUT]

Jump to

Keyboard shortcuts

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