|
@@ -6,7 +6,7 @@ import (
|
|
|
"git.sxidc.com/go-tools/api_binding/http_binding/middleware"
|
|
|
"git.sxidc.com/go-tools/api_binding/http_binding/request"
|
|
|
"git.sxidc.com/go-tools/api_binding/http_binding/response"
|
|
|
- "git.sxidc.com/go-tools/api_binding/utils"
|
|
|
+ "git.sxidc.com/go-tools/utils/strutils"
|
|
|
"git.sxidc.com/service-supports/fserr"
|
|
|
"git.sxidc.com/service-supports/fslog"
|
|
|
"github.com/gin-gonic/gin"
|
|
@@ -25,7 +25,7 @@ type Binding struct {
|
|
|
|
|
|
func NewBinding(apiVersion string, middlewares ...middleware.Func) *Binding {
|
|
|
apiPrefix := urlPrefix + "/api"
|
|
|
- if utils.IsStringNotEmpty(apiVersion) && apiVersion != "root" {
|
|
|
+ if strutils.IsStringNotEmpty(apiVersion) && apiVersion != "root" {
|
|
|
apiPrefix += "/" + apiVersion
|
|
|
}
|
|
|
|
|
@@ -45,11 +45,11 @@ func NewBinding(apiVersion string, middlewares ...middleware.Func) *Binding {
|
|
|
type HandleFunc func(c *binding_context.Context)
|
|
|
|
|
|
func (binding *Binding) AddHandler(method string, relativePath string, handleFunctions ...HandleFunc) error {
|
|
|
- if utils.IsStringEmpty(method) {
|
|
|
+ if strutils.IsStringEmpty(method) {
|
|
|
return errors.New("没有传递方法名")
|
|
|
}
|
|
|
|
|
|
- if utils.IsStringEmpty(relativePath) {
|
|
|
+ if strutils.IsStringEmpty(relativePath) {
|
|
|
return errors.New("没有传递相对路径")
|
|
|
}
|
|
|
|
|
@@ -131,11 +131,11 @@ type BindItem[I any, O any] struct {
|
|
|
}
|
|
|
|
|
|
func (item *BindItem[I, O]) bind(routerGroup *gin.RouterGroup, middlewares ...middleware.Func) {
|
|
|
- if utils.IsStringEmpty(item.Path) {
|
|
|
+ if strutils.IsStringEmpty(item.Path) {
|
|
|
panic("需要指定路径")
|
|
|
}
|
|
|
|
|
|
- if utils.IsStringEmpty(item.Method) {
|
|
|
+ if strutils.IsStringEmpty(item.Method) {
|
|
|
panic("需要指定方法")
|
|
|
}
|
|
|
|