Documentation ¶
Index ¶
- Variables
- type CasbinService
- type LoginService
- func (a *LoginService) GetCaptcha(c *gin.Context)
- func (a *LoginService) GetUserInfo(c *gin.Context)
- func (a *LoginService) Login(c *gin.Context)
- func (a *LoginService) Logout(c *gin.Context)
- func (a *LoginService) ParseUserID(c *gin.Context) (string, error)
- func (a *LoginService) QueryMenus(c *gin.Context)
- func (a *LoginService) RefreshToken(c *gin.Context)
- func (a *LoginService) ResponseCaptcha(c *gin.Context)
- func (a *LoginService) UpdatePassword(c *gin.Context)
- func (a *LoginService) UpdateUser(c *gin.Context)
- type MenuService
- type NodeService
- type RoleService
- type StressService
- func (s *StressService) QueryPlanAndTaskRecords(c *gin.Context)
- func (s *StressService) QueryPlanRecords(c *gin.Context)
- func (s *StressService) QueryTaskRecords(c *gin.Context)
- func (s *StressService) RestartStress(c *gin.Context)
- func (s *StressService) StartStress(c *gin.Context)
- func (s *StressService) StopStress(c *gin.Context)
- type UserService
Constants ¶
This section is empty.
Variables ¶
var ProviderSet = wire.NewSet( NewCasbinService, NewLoginService, NewMenuService, NewRoleService, NewStressService, NewUserService, NewNodeService, )
Functions ¶
This section is empty.
Types ¶
type CasbinService ¶
type CasbinService struct {
// contains filtered or unexported fields
}
func NewCasbinService ¶
func NewCasbinService(uc *biz.CasbinUsecase) *CasbinService
func (*CasbinService) GetEnforcer ¶
func (a *CasbinService) GetEnforcer() *casbin.Enforcer
type LoginService ¶
type LoginService struct {
// contains filtered or unexported fields
}
func NewLoginService ¶
func NewLoginService(uc *biz.LoginUsecase) *LoginService
func (*LoginService) GetCaptcha ¶
func (a *LoginService) GetCaptcha(c *gin.Context)
GetCaptcha @Tags LoginAPI @Summary Get captcha ID @Success 200 {object} common.ResponseResult{data=schema.Captcha} @Router /api/v1/captcha/id [get]
func (*LoginService) GetUserInfo ¶
func (a *LoginService) GetUserInfo(c *gin.Context)
GetUserInfo @Tags LoginAPI @Security ApiKeyAuth @Summary Get current user info @Success 200 {object} common.ResponseResult{data=schema.User} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/current/user [get
func (*LoginService) Login ¶
func (a *LoginService) Login(c *gin.Context)
Login @Tags LoginAPI @Summary Login system with username and password @Param body body schema.LoginForm true "Request body" @Success 200 {object} common.ResponseResult{data=schema.LoginToken} @Failure 400 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/login [post
func (*LoginService) Logout ¶
func (a *LoginService) Logout(c *gin.Context)
Logout @Tags LoginAPI @Security ApiKeyAuth @Summary Logout system @Success 200 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/current/logout [post]
func (*LoginService) ParseUserID ¶
func (a *LoginService) ParseUserID(c *gin.Context) (string, error)
func (*LoginService) QueryMenus ¶
func (a *LoginService) QueryMenus(c *gin.Context)
QueryMenus @Tags LoginAPI @Security ApiKeyAuth @Summary Query current user menus based on the current user role @Success 200 {object} common.ResponseResult{data=[]schema.Menu} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/current/menus [get]
func (*LoginService) RefreshToken ¶
func (a *LoginService) RefreshToken(c *gin.Context)
RefreshToken @Tags LoginAPI @Security ApiKeyAuth @Summary Refresh current access token @Success 200 {object} common.ResponseResult{data=schema.LoginToken} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/current/refresh-token [post]
func (*LoginService) ResponseCaptcha ¶
func (a *LoginService) ResponseCaptcha(c *gin.Context)
ResponseCaptcha @Tags LoginAPI @Summary Response captcha image @Param id query string true "Captcha ID" @Param reload query number false "Reload captcha image (reload=1)" @Produce image/png @Success 200 "Captcha image" @Failure 404 {object} common.ResponseResult @Router /api/v1/captcha/image [get
func (*LoginService) UpdatePassword ¶
func (a *LoginService) UpdatePassword(c *gin.Context)
UpdatePassword @Tags LoginAPI @Security ApiKeyAuth @Summary Change current user password @Param body body schema.UpdateLoginPassword true "Request body" @Success 200 {object} common.ResponseResult @Failure 400 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/current/password [put]
func (*LoginService) UpdateUser ¶
func (a *LoginService) UpdateUser(c *gin.Context)
UpdateUser @Tags LoginAPI @Security ApiKeyAuth @Summary Update current user info @Param body body schema.UpdateCurrentUser true "Request body" @Success 200 {object} common.ResponseResult @Failure 400 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/current/user [put]
type MenuService ¶
type MenuService struct {
// contains filtered or unexported fields
}
func NewMenuService ¶
func NewMenuService(uc *biz.MenuUsecase) *MenuService
func (*MenuService) Create ¶
func (a *MenuService) Create(c *gin.Context)
Create @Tags MenuAPI @Security ApiKeyAuth @Summary Create menu record @Param body body schema.MenuForm true "Request body" @Success 200 {object} common.ResponseResult{data=schema.Menu} @Failure 400 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/menus [post]
func (*MenuService) Delete ¶
func (a *MenuService) Delete(c *gin.Context)
Delete @Tags MenuAPI @Security ApiKeyAuth @Summary Delete menu record by ID @Param id path string true "unique id" @Success 200 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/menus/{id} [delete]
func (*MenuService) Get ¶
func (a *MenuService) Get(c *gin.Context)
Get @Tags MenuAPI @Security ApiKeyAuth @Summary Get menu record by ID @Param id path string true "unique id" @Success 200 {object} common.ResponseResult{data=schema.Menu} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/menus/{id} [get]
func (*MenuService) Query ¶
func (a *MenuService) Query(c *gin.Context)
Query @Tags MenuAPI @Security ApiKeyAuth @Summary Query menu tree data @Param code query string false "Code path of menu (like xxx.xxx.xxx)" @Param name query string false "Name of menu" @Param includeResources query bool false "Whether to include menu resources" @Success 200 {object} common.ResponseResult{data=[]schema.Menu} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/menus [get]
func (*MenuService) Update ¶
func (a *MenuService) Update(c *gin.Context)
Update @Tags MenuAPI @Security ApiKeyAuth @Summary Update menu record by ID @Param id path string true "unique id" @Param body body schema.MenuForm true "Request body" @Success 200 {object} common.ResponseResult @Failure 400 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/menus/{id} [put]
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
func NewNodeService ¶
func NewNodeService(uc *biz.NodeUsecase) *NodeService
func (*NodeService) QueryAllNodes ¶
func (s *NodeService) QueryAllNodes(c *gin.Context)
QueryAllNodes retrieves all nodes based on the query parameters.
Takes in a gin Context as a parameter and does not return anything.
func (*NodeService) QueryNodes ¶
func (s *NodeService) QueryNodes(c *gin.Context)
QueryNodes is a function to query nodes.
It takes a gin Context as a parameter and does not return any value.
func (*NodeService) UpdateNodeQuota ¶
func (s *NodeService) UpdateNodeQuota(c *gin.Context)
UpdateNodeQuota updates the quota for a node.
context *gin.Context
type RoleService ¶
type RoleService struct {
// contains filtered or unexported fields
}
func NewRoleService ¶
func NewRoleService(uc *biz.RoleUsecase) *RoleService
func (*RoleService) Create ¶
func (a *RoleService) Create(c *gin.Context)
Create @Tags RoleAPI @Security ApiKeyAuth @Summary Create role record @Param body body biz.RoleForm true "Request body" @Success 200 {object} common.ResponseResult{data=biz.Role} @Failure 400 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/roles [post]
func (*RoleService) Delete ¶
func (a *RoleService) Delete(c *gin.Context)
Delete @Tags RoleAPI @Security ApiKeyAuth @Summary Delete role record by ID @Param id path string true "unique id" @Success 200 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/roles/{id} [delete]
func (*RoleService) Get ¶
func (a *RoleService) Get(c *gin.Context)
Get @Tags RoleAPI @Security ApiKeyAuth @Summary Get role record by ID @Param id path string true "unique id" @Success 200 {object} common.ResponseResult{data=biz.Role} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/roles/{id} [get]
func (*RoleService) Query ¶
func (a *RoleService) Query(c *gin.Context)
Query @Tags RoleAPI @Security ApiKeyAuth @Summary Query role list @Param current query int true "pagination index" default(1) @Param pageSize query int true "pagination size" default(10) @Param name query string false "Display name of role" @Param status query string false "Status of role (disabled, enabled)" @Success 200 {object} common.ResponseResult{data=[]biz.Role} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/roles [get]
func (*RoleService) Update ¶
func (a *RoleService) Update(c *gin.Context)
Update @Tags RoleAPI @Security ApiKeyAuth @Summary Update role record by ID @Param id path string true "unique id" @Param body body biz.RoleForm true "Request body" @Success 200 {object} common.ResponseResult @Failure 400 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/roles/{id} [put]
type StressService ¶
type StressService struct {
// contains filtered or unexported fields
}
func NewStressService ¶
func NewStressService(uc *biz.StressUsecase) *StressService
func (*StressService) QueryPlanAndTaskRecords ¶
func (s *StressService) QueryPlanAndTaskRecords(c *gin.Context)
func (*StressService) QueryPlanRecords ¶
func (s *StressService) QueryPlanRecords(c *gin.Context)
func (*StressService) QueryTaskRecords ¶
func (s *StressService) QueryTaskRecords(c *gin.Context)
func (*StressService) RestartStress ¶
func (s *StressService) RestartStress(c *gin.Context)
func (*StressService) StartStress ¶
func (s *StressService) StartStress(c *gin.Context)
func (*StressService) StopStress ¶
func (s *StressService) StopStress(c *gin.Context)
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(uc *biz.UserUsecase) *UserService
func (*UserService) Create ¶
func (a *UserService) Create(c *gin.Context)
Create @Tags UserAPI @Security ApiKeyAuth @Summary Create user record @Param body body biz.UserForm true "Request body" @Success 200 {object} common.ResponseResult{data=biz.User} @Failure 400 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/users [post]
func (*UserService) Delete ¶
func (a *UserService) Delete(c *gin.Context)
Delete @Tags UserAPI @Security ApiKeyAuth @Summary Delete user record by ID @Param id path string true "unique id" @Success 200 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/users/{id} [delete]
func (*UserService) Get ¶
func (a *UserService) Get(c *gin.Context)
Get @Tags UserAPI @Security ApiKeyAuth @Summary Get user record by ID @Param id path string true "unique id" @Success 200 {object} common.ResponseResult{data=biz.User} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/users/{id} [get]
func (*UserService) Query ¶
func (a *UserService) Query(c *gin.Context)
Query @Tags UserAPI @Security ApiKeyAuth @Summary Query user list @Param current query int true "pagination index" default(1) @Param pageSize query int true "pagination size" default(10) @Param username query string false "Username for login" @Param name query string false "Name of user" @Param status query string false "Status of user (activated, freezed)" @Success 200 {object} common.ResponseResult{data=[]biz.User} @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/users [get]
func (*UserService) ResetPassword ¶
func (a *UserService) ResetPassword(c *gin.Context)
ResetPassword @Tags UserAPI @Security ApiKeyAuth @Summary Reset user password by ID @Param id path string true "unique id" @Success 200 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/users/{id}/reset-pwd [patch]
func (*UserService) Update ¶
func (a *UserService) Update(c *gin.Context)
Update @Tags UserAPI @Security ApiKeyAuth @Summary Update user record by ID @Param id path string true "unique id" @Param body body biz.UserForm true "Request body" @Success 200 {object} common.ResponseResult @Failure 400 {object} common.ResponseResult @Failure 401 {object} common.ResponseResult @Failure 500 {object} common.ResponseResult @Router /api/v1/users/{id} [put]