Documentation ¶
Index ¶
- Variables
- func Build() *webserver.WebHandlers
- func Register(funcId string, funcService IFuncService)
- type FuncCtxHandler
- type FuncService
- func (self *FuncService) Check()
- func (self *FuncService) CheckSessionToken() gin.HandlerFunc
- func (self *FuncService) ExeFunc(c *gin.Context) (any, error)
- func (self *FuncService) Execute(ctx *gin.Context)
- func (self *FuncService) FindNameOfIface() string
- func (self *FuncService) GetCache(ctx *gin.Context, key string) any
- func (self *FuncService) GetFuncService() *FuncService
- func (self *FuncService) GetSessionToken(ctx *gin.Context) (int, *webdto.WebUserId, error)
- func (self *FuncService) GetUserId(ctx *gin.Context) *webdto.WebUserId
- func (self *FuncService) IfWebHandlers() bool
- func (self *FuncService) Init(srv IFuncService)
- func (self *FuncService) InitRoute(ifuncservice IFuncService, method webserver.HttpMethod, path string)
- func (self *FuncService) InitRouter(funcservice IFuncService, webGroupPath ...string) *FuncService
- func (self *FuncService) ParseBody(ctx *gin.Context, dto any) error
- func (self *FuncService) ParseResult(ctx *gin.Context, data interface{}) bool
- func (self *FuncService) Register()
- func (self *FuncService) RegisterRouter(method webserver.HttpMethod, path string, handler gin.HandlerFunc)
- func (self *FuncService) RegisterRouterMethod()
- func (self *FuncService) RegisterRouterRes(method webserver.HttpMethod, path string, handler gin.HandlerFunc, ...)
- func (self *FuncService) SetCache(ctx *gin.Context, key string, value any)
- func (self *FuncService) SetUserId(ctx *gin.Context)
- func (self *FuncService) WebCheckAllowed(ctx *gin.Context)
- type FuncServiceRes
- type IFuncService
Constants ¶
This section is empty.
Variables ¶
View Source
var Fclose = func(ctx *gin.Context) { if err := ctx.Request.Body.Close(); err != nil { logrus.Errorf("failed to close: %v\n", err) } }
View Source
var FuncServiceMap map[string]IFuncService = make(map[string]IFuncService)
Functions ¶
func Build ¶
func Build() *webserver.WebHandlers
func Register ¶
func Register(funcId string, funcService IFuncService)
Types ¶
type FuncCtxHandler ¶
type FuncService ¶
type FuncService struct { Fclose FuncCtxHandler `json:"-"` IFuncService IFuncService `json:"-"` *FuncServiceRes FuncId string `json:"func_id"` RelativePath string `json:"relative_path"` Handler gin.HandlerFunc `json:"-"` webserver.WebHandlers `json:"-"` }
func NewFuncService ¶
func NewFuncService() *FuncService
func (*FuncService) Check ¶
func (self *FuncService) Check()
func (*FuncService) CheckSessionToken ¶
func (self *FuncService) CheckSessionToken() gin.HandlerFunc
func (*FuncService) Execute ¶
func (self *FuncService) Execute(ctx *gin.Context)
func (*FuncService) FindNameOfIface ¶
func (self *FuncService) FindNameOfIface() string
func (*FuncService) GetFuncService ¶
func (self *FuncService) GetFuncService() *FuncService
func (*FuncService) GetSessionToken ¶
func (*FuncService) GetUserId ¶
func (self *FuncService) GetUserId(ctx *gin.Context) *webdto.WebUserId
func (*FuncService) IfWebHandlers ¶
func (self *FuncService) IfWebHandlers() bool
func (*FuncService) Init ¶
func (self *FuncService) Init(srv IFuncService)
func (*FuncService) InitRoute ¶
func (self *FuncService) InitRoute(ifuncservice IFuncService, method webserver.HttpMethod, path string)
single method will discard!
func (*FuncService) InitRouter ¶
func (self *FuncService) InitRouter(funcservice IFuncService, webGroupPath ...string) *FuncService
func (*FuncService) ParseResult ¶
func (self *FuncService) ParseResult(ctx *gin.Context, data interface{}) bool
func (*FuncService) Register ¶
func (self *FuncService) Register()
func (*FuncService) RegisterRouter ¶
func (self *FuncService) RegisterRouter(method webserver.HttpMethod, path string, handler gin.HandlerFunc)
不需要授权,不注入表中,注入内存中
func (*FuncService) RegisterRouterMethod ¶
func (self *FuncService) RegisterRouterMethod()
func (*FuncService) RegisterRouterRes ¶
func (self *FuncService) RegisterRouterRes(method webserver.HttpMethod, path string, handler gin.HandlerFunc, checkRes ...string)
注册 需要权限授权的资源,会自动注入表中
func (*FuncService) SetCache ¶
func (self *FuncService) SetCache(ctx *gin.Context, key string, value any)
func (*FuncService) SetUserId ¶
func (self *FuncService) SetUserId(ctx *gin.Context)
func (*FuncService) WebCheckAllowed ¶
func (self *FuncService) WebCheckAllowed(ctx *gin.Context)
type FuncServiceRes ¶
type FuncServiceRes struct { CheckRight bool `json:"check_right"` WebGroupPath string `json:"web_group_path"` Method webserver.HttpMethod `json:"method"` Path string Res string *webcontext.WebUserContext }
func NewFuncServiceRes ¶
func NewFuncServiceRes() *FuncServiceRes
func (*FuncServiceRes) SaveRes2Db ¶
func (self *FuncServiceRes) SaveRes2Db()
func (*FuncServiceRes) Single ¶
func (this *FuncServiceRes) Single() bool
type IFuncService ¶
type IFuncService interface { Execute(c *gin.Context) Register() Check() GetFuncService() *FuncService ExeFunc(c *gin.Context) (any, error) InitRouter(funcservice IFuncService, webGroupPath ...string) *FuncService RegisterRouter(method webserver.HttpMethod, path string, handler gin.HandlerFunc) RegisterRouterRes(method webserver.HttpMethod, path string, handler gin.HandlerFunc, checkRes ...string) }
func Find ¶
func Find(funcId string) (IFuncService, bool)
Click to show internal directories.
Click to hide internal directories.