Documentation ¶
Index ¶
- Constants
- Variables
- func GetLocFromAcceptLanguage(ctx *gin.Context) string
- type UserHandler
- func (h *UserHandler) Create(ctx *gin.Context)
- func (h *UserHandler) Delete(ctx *gin.Context)
- func (h *UserHandler) Login(ctx *gin.Context)
- func (h *UserHandler) Query(ctx *gin.Context)
- func (h *UserHandler) QueryList(ctx *gin.Context)
- func (h *UserHandler) Refresh(ctx *gin.Context)
- func (h *UserHandler) Update(ctx *gin.Context)
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 ¶
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]
Click to show internal directories.
Click to hide internal directories.