feat: router.server -> router.Server
This commit is contained in:
@@ -29,7 +29,7 @@ import (
|
||||
"github.com/mcuadros/go-defaults"
|
||||
)
|
||||
|
||||
func (s *server) getFormInitValue(ctx *gin.Context, uriCfg define.UriConfig) (any, error) {
|
||||
func (s *Server) getFormInitValue(ctx *gin.Context, uriCfg define.UriConfig) (any, error) {
|
||||
var (
|
||||
formParam reflect.Value
|
||||
formValue any
|
||||
@@ -58,7 +58,7 @@ func (s *server) getFormInitValue(ctx *gin.Context, uriCfg define.UriConfig) (an
|
||||
return formValue, nil
|
||||
}
|
||||
|
||||
func (s *server) initRequest(ctx *gin.Context, uriCfg define.UriConfig) (any, reflect.Value, exception.IException) {
|
||||
func (s *Server) initRequest(ctx *gin.Context, uriCfg define.UriConfig) (any, reflect.Value, exception.IException) {
|
||||
var (
|
||||
err error
|
||||
formValue any
|
||||
@@ -92,7 +92,7 @@ func (s *server) initRequest(ctx *gin.Context, uriCfg define.UriConfig) (any, re
|
||||
}
|
||||
|
||||
// callFunc 调用方法
|
||||
func (s *server) callFunc(ctx *gin.Context, uriCfg define.UriConfig, inputValue reflect.Value) (any, exception.IException) {
|
||||
func (s *Server) callFunc(ctx *gin.Context, uriCfg define.UriConfig, inputValue reflect.Value) (any, exception.IException) {
|
||||
|
||||
var (
|
||||
firstParam = reflect.ValueOf(ctx)
|
||||
@@ -108,7 +108,7 @@ func (s *server) callFunc(ctx *gin.Context, uriCfg define.UriConfig, inputValue
|
||||
}
|
||||
|
||||
// formatError 格式化错误
|
||||
func (s *server) formatError(ctx *gin.Context, err any) exception.IException {
|
||||
func (s *Server) formatError(ctx *gin.Context, err any) exception.IException {
|
||||
if nil == err {
|
||||
return nil
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func (s *server) formatError(ctx *gin.Context, err any) exception.IException {
|
||||
}
|
||||
|
||||
// RequestHandler 获取请求处理方法
|
||||
func (s *server) RequestHandler(uriCfg define.UriConfig) gin.HandlerFunc {
|
||||
func (s *Server) RequestHandler(uriCfg define.UriConfig) gin.HandlerFunc {
|
||||
return func(ctx *gin.Context) {
|
||||
defer s.hook(ctx, uriCfg)
|
||||
var (
|
||||
@@ -164,7 +164,7 @@ func (s *server) RequestHandler(uriCfg define.UriConfig) gin.HandlerFunc {
|
||||
}
|
||||
|
||||
// SseHandler sse连接请求
|
||||
func (s *server) SseHandler(uriCfg define.UriConfig) gin.HandlerFunc {
|
||||
func (s *Server) SseHandler(uriCfg define.UriConfig) gin.HandlerFunc {
|
||||
return func(ctx *gin.Context) {
|
||||
var (
|
||||
err error
|
||||
|
||||
Reference in New Issue
Block a user