提交 7815ac1e authored 作者: mooncake9527's avatar mooncake9527

update

上级 d002d9c1
...@@ -209,7 +209,7 @@ func GetGinUID(c context.Context) xsf.ID { ...@@ -209,7 +209,7 @@ func GetGinUID(c context.Context) xsf.ID {
v := cast.ToInt64(val) v := cast.ToInt64(val)
return xsf.ParseInt64(v) return xsf.ParseInt64(v)
} }
return xsf.ID(-1) return xsf.ID(0)
} }
func GetCtxUID(c context.Context) xsf.ID { func GetCtxUID(c context.Context) xsf.ID {
...@@ -220,7 +220,7 @@ func GetCtxUID(c context.Context) xsf.ID { ...@@ -220,7 +220,7 @@ func GetCtxUID(c context.Context) xsf.ID {
v := cast.ToInt64(val) v := cast.ToInt64(val)
return xsf.ParseInt64(v) return xsf.ParseInt64(v)
} }
return xsf.ID(-1) return xsf.ID(0)
} }
func GetGinUType(c *gin.Context) int { func GetGinUType(c *gin.Context) int {
...@@ -230,7 +230,7 @@ func GetGinUType(c *gin.Context) int { ...@@ -230,7 +230,7 @@ func GetGinUType(c *gin.Context) int {
} }
return cast.ToInt(val) return cast.ToInt(val)
} }
return -1 return 0
} }
func GetCtxUType(c context.Context) int { func GetCtxUType(c context.Context) int {
...@@ -240,7 +240,7 @@ func GetCtxUType(c context.Context) int { ...@@ -240,7 +240,7 @@ func GetCtxUType(c context.Context) int {
} }
return cast.ToInt(val) return cast.ToInt(val)
} }
return -1 return 0
} }
func GetGinUserName(c *gin.Context) string { func GetGinUserName(c *gin.Context) string {
...@@ -263,7 +263,7 @@ func GetGinCompanyID(c *gin.Context) xsf.ID { ...@@ -263,7 +263,7 @@ func GetGinCompanyID(c *gin.Context) xsf.ID {
v := cast.ToInt64(val) v := cast.ToInt64(val)
return xsf.ParseInt64(v) return xsf.ParseInt64(v)
} }
return xsf.ID(-1) return xsf.ID(0)
} }
func GetCtxCompanyID(c context.Context) xsf.ID { func GetCtxCompanyID(c context.Context) xsf.ID {
...@@ -274,7 +274,7 @@ func GetCtxCompanyID(c context.Context) xsf.ID { ...@@ -274,7 +274,7 @@ func GetCtxCompanyID(c context.Context) xsf.ID {
v := cast.ToInt64(val) v := cast.ToInt64(val)
return xsf.ParseInt64(v) return xsf.ParseInt64(v)
} }
return xsf.ID(-1) return xsf.ID(0)
} }
func getGinVal[T any](c *gin.Context, key string) T { func getGinVal[T any](c *gin.Context, key string) T {
......
...@@ -77,12 +77,12 @@ func GenerateApiID(ctx context.Context, bizTag string) (xsf.ID, error) { ...@@ -77,12 +77,12 @@ func GenerateApiID(ctx context.Context, bizTag string) (xsf.ID, error) {
} }
if err := req.SetRetry(leafRetryCount).SetContentType("application/json").SetURL(url).GET(ctx).BindJSON(reply).Err(); err != nil { if err := req.SetRetry(leafRetryCount).SetContentType("application/json").SetURL(url).GET(ctx).BindJSON(reply).Err(); err != nil {
logger.Error("调用leaf失败", logger.String("bizTag", bizTag), logger.Err(err)) logger.Error("调用leaf失败", logger.String("bizTag", bizTag), logger.Err(err))
return xsf.ID(-1), fmt.Errorf("调用leaf失败, %w", err) return xsf.ID(0), fmt.Errorf("调用leaf失败, %w", err)
} }
if reply.Code == 1 { if reply.Code == 1 {
return id, nil return id, nil
} }
return xsf.ID(-1), errors.New(reply.Msg) return xsf.ID(0), errors.New(reply.Msg)
} }
type IDReply struct { type IDReply struct {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论