handlers

package
v0.0.0-...-756a3e5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthHandler

func NewAuthHandler(g *echo.Group, middManager *middlewares.MiddlewareManager, userUsecase usecases.UserUsecase, appCfgs *config.AppConfig)

func NewKratosHookHandler

func NewKratosHookHandler(g *echo.Group, middManager *middlewares.MiddlewareManager, userUsecase usecases.UserUsecase)

NewKratosHookHandler will initialize the user resources endpoint

func NewOrgHandler

func NewOrgHandler(g *echo.Group, middManager *middlewares.MiddlewareManager, orgUsecase usecases.OrgUsecase)

NewOrgHandler will initialize the org resources endpoint

func NewUserHandler

func NewUserHandler(g *echo.Group, middManager *middlewares.MiddlewareManager, userUsecase usecases.UserUsecase)

NewUserHandler will initialize the user resources endpoint

Types

type AuthHandler

type AuthHandler struct {
	UserUC  usecases.UserUsecase
	Configs *config.AppConfig
}

func (*AuthHandler) LoginForm

func (h *AuthHandler) LoginForm(c echo.Context) error

func (*AuthHandler) LoginSuccess

func (h *AuthHandler) LoginSuccess(c echo.Context) error

type KratosHookHandler

type KratosHookHandler struct {
	UserUC usecases.UserUsecase
}

func (*KratosHookHandler) AfterRegistration

func (h *KratosHookHandler) AfterRegistration(c echo.Context) wrapper.Response

Create will store the user by given request body

func (*KratosHookHandler) AfterSettings

func (h *KratosHookHandler) AfterSettings(c echo.Context) wrapper.Response

type OrgHandler

type OrgHandler struct {
	OrgUC usecases.OrgUsecase
}

func (*OrgHandler) Create

func (h *OrgHandler) Create(c echo.Context) wrapper.Response

CreateNewOrg godoc @Summary Create a new org @Description Create a new org @Tags orgs @Accept json @Produce json @Success 200 {object} wrapper.SuccessResponse{data=domains.Org} @Security XFirebaseBearer @Router /admin/orgs [post]

func (*OrgHandler) Delete

func (h *OrgHandler) Delete(c echo.Context) wrapper.Response

Delete will delete org by given param

func (*OrgHandler) Fetch

func (h *OrgHandler) Fetch(c echo.Context) wrapper.Response

GetListOrgsOfCurrentUser godoc @Summary Get list org @Description Get list org @Tags orgs @Accept json @Produce json @Param limit query int false "Number of records should be returned" @Param page query int false "Page" @Success 200 {object} wrapper.SuccessResponse{data=[]domains.Org} @Security XFirebaseBearer @Router /admin/orgs [get]

func (*OrgHandler) GetByID

func (h *OrgHandler) GetByID(c echo.Context) wrapper.Response

GetOrgInfo godoc @Summary Get org info @Description Get org info by ID @Tags orgs @Accept json @Produce json @Param orgId path int true "Org ID" @Success 200 {object} wrapper.SuccessResponse{data=domains.Org} @Security XFirebaseBearer @Router /admin/orgs/{orgId} [get]

func (*OrgHandler) Invite

func (h *OrgHandler) Invite(c echo.Context) wrapper.Response

func (*OrgHandler) Update

func (h *OrgHandler) Update(c echo.Context) wrapper.Response

Update will get org by given request body

type UserHandler

type UserHandler struct {
	UserUC usecases.UserUsecase
}

func (*UserHandler) Create

func (h *UserHandler) Create(c echo.Context) wrapper.Response

CreateANewUser godoc @Summary Craete a new user @Description Craete a new user @Tags users @Accept json @Produce json @Success 200 {object} wrapper.SuccessResponse{data=domains.User} @Router /admin/users [post]

func (*UserHandler) Delete

func (h *UserHandler) Delete(c echo.Context) wrapper.Response

DeleteUser godoc @Summary Delete user @Description Delete user @Tags users @Accept json @Produce json @Success 200 {object} wrapper.SuccessResponse{} @Security XFirebaseBearer @Router /admin/users/{userId} [delete]

func (*UserHandler) Fetch

func (h *UserHandler) Fetch(c echo.Context) wrapper.Response

GetListUser godoc @Summary Get list user info @Description Get list user info @Tags users @Accept json @Produce json @Success 200 {object} wrapper.SuccessResponse{data=[]domains.User} @Security XFirebaseBearer @Router /admin/users [get]

func (*UserHandler) GetByID

func (h *UserHandler) GetByID(c echo.Context) wrapper.Response

GetUserInfo godoc @Summary Get user info @Description Get user info by ID @Tags users @Accept json @Produce json @Param userId path int true "User ID" @Success 200 {object} wrapper.SuccessResponse{data=domains.User} @Security XFirebaseBearer @Router /admin/users/{userId} [get]

func (*UserHandler) GetCurrentUserInfo

func (h *UserHandler) GetCurrentUserInfo(c echo.Context) wrapper.Response

GetCurrentUserInfo godoc @Summary Get current user info @Description Get current user info @Tags users @Accept json @Produce json @Success 200 {object} wrapper.SuccessResponse{data=domains.User} @Security XFirebaseBearer @Router /me [get]

func (*UserHandler) Update

func (h *UserHandler) Update(c echo.Context) wrapper.Response

UpdateUserInfo godoc @Summary Update user info @Description Update user info @Tags users @Accept json @Produce json @Param body body dto.UpdateUserReq true "Request body update user" @Param userId path int true "User ID" @Success 200 {object} wrapper.SuccessResponse{} @Security XFirebaseBearer @Router /admin/users/{userId} [put]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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