Browse Source

修改errors

yjp 1 year ago
parent
commit
de9786ab87

+ 2 - 3
go.mod

@@ -5,9 +5,9 @@ go 1.22.3
 require (
 	git.sxidc.com/go-framework/baize v0.11.3
 	git.sxidc.com/go-tools/utils v1.5.15
-	git.sxidc.com/service-supports/fserr v0.3.5
 	git.sxidc.com/service-supports/fslog v0.5.9
 	git.sxidc.com/service-supports/scm-sdk v0.1.0
+	github.com/pkg/errors v0.9.1
 	github.com/stretchr/testify v1.9.0
 	github.com/vrecan/death v3.0.1+incompatible
 	gopkg.in/yaml.v3 v3.0.1
@@ -34,6 +34,7 @@ require (
 	github.com/go-playground/validator/v10 v10.20.0 // indirect
 	github.com/go-resty/resty/v2 v2.11.0 // indirect
 	github.com/goccy/go-json v0.10.2 // indirect
+	github.com/google/go-cmp v0.6.0 // indirect
 	github.com/google/uuid v1.6.0 // indirect
 	github.com/huandu/xstrings v1.3.3 // indirect
 	github.com/iancoleman/strcase v0.3.0 // indirect
@@ -52,9 +53,7 @@ require (
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/pelletier/go-toml/v2 v2.2.2 // indirect
-	github.com/pkg/errors v0.9.1 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
-	github.com/puzpuzpuz/xsync v1.5.2 // indirect
 	github.com/redis/go-redis/v9 v9.4.0 // indirect
 	github.com/satori/go.uuid v1.2.0 // indirect
 	github.com/shopspring/decimal v1.2.0 // indirect

+ 0 - 4
go.sum

@@ -2,8 +2,6 @@ git.sxidc.com/go-framework/baize v0.11.3 h1:6+U49L0uJCrgsON+AxWlOoqPKa6lRF1NK+Vx
 git.sxidc.com/go-framework/baize v0.11.3/go.mod h1:xE4XwsvwSO8tR5j8BaVZUTngU+HLNICHwdl5x1LULa0=
 git.sxidc.com/go-tools/utils v1.5.15 h1:7xs/EM8XZyKycrSSHcPZ6wvyYs+v8uWQ7ZmPP/fHyFI=
 git.sxidc.com/go-tools/utils v1.5.15/go.mod h1:fkobAXFpOMTvkZ82TQXWcpsayePcyk/MS5TN6GTlRDg=
-git.sxidc.com/service-supports/fserr v0.3.5 h1:1SDC60r3FIDd2iRq/oHRLK4OMa1gf67h9B7kierKTUE=
-git.sxidc.com/service-supports/fserr v0.3.5/go.mod h1:8U+W/ulZIGVPFojV6cE18shkGXqvaICuzaxIJpOcBqI=
 git.sxidc.com/service-supports/fslog v0.5.9 h1:q2XIK2o/fk/qmByy4x5kKLC+k7kolT5LrXHcWRSffXQ=
 git.sxidc.com/service-supports/fslog v0.5.9/go.mod h1:/m03ATmmOle75qtEgvEw8a1+Dcg6iHp08M1bGFXJTBU=
 git.sxidc.com/service-supports/scm-sdk v0.1.0 h1:198qs/XxffOrHioKEWXyPfsQLoO3E8Ifj4idOWJxIe0=
@@ -110,8 +108,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/puzpuzpuz/xsync v1.5.2 h1:yRAP4wqSOZG+/4pxJ08fPTwrfL0IzE/LKQ/cw509qGY=
-github.com/puzpuzpuz/xsync v1.5.2/go.mod h1:K98BYhX3k1dQ2M63t1YNVDanbwUPmBCAhNmVrrxfiGg=
 github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk=
 github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
 github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=

+ 2 - 2
project/mono/application/domain/class/entity.go

@@ -5,7 +5,7 @@ import (
 	"git.sxidc.com/go-framework/baize/framework/core/domain/entity"
 	"git.sxidc.com/go-framework/baize/framework/core/tag/check"
 	"git.sxidc.com/go-tools/utils/strutils"
-	"git.sxidc.com/service-supports/fserr"
+	"github.com/pkg/errors"
 )
 
 const (
@@ -97,7 +97,7 @@ func (e *Entity) ForUpdate() error {
 
 func (e *Entity) checkUpdateFields(checkResult check.Result) error {
 	if strutils.AllBlank(e.Name) {
-		return fserr.New(e.DomainCNName() + "没有传递需要更新的字段")
+		return errors.New(e.DomainCNName() + "没有传递需要更新的字段")
 	}
 
 	if strutils.IsStringNotEmpty(e.Name) {

+ 2 - 2
project/server/application/domain/class/entity.go

@@ -5,7 +5,7 @@ import (
 	"git.sxidc.com/go-framework/baize/framework/core/domain/entity"
 	"git.sxidc.com/go-framework/baize/framework/core/tag/check"
 	"git.sxidc.com/go-tools/utils/strutils"
-	"git.sxidc.com/service-supports/fserr"
+	"github.com/pkg/errors"
 )
 
 const (
@@ -84,7 +84,7 @@ func (e *Entity) ForUpdate() error {
 
 func (e *Entity) checkUpdateFields(checkResult check.Result) error {
 	if strutils.AllBlank(e.Name) {
-		return fserr.New(e.DomainCNName() + "没有传递需要更新的字段")
+		return errors.New(e.DomainCNName() + "没有传递需要更新的字段")
 	}
 
 	if strutils.IsStringNotEmpty(e.Name) {

+ 2 - 2
project/server/application/domain/family/entity.go

@@ -5,7 +5,7 @@ import (
 	"git.sxidc.com/go-framework/baize/framework/core/domain/entity"
 	"git.sxidc.com/go-framework/baize/framework/core/tag/check"
 	"git.sxidc.com/go-tools/utils/strutils"
-	"git.sxidc.com/service-supports/fserr"
+	"github.com/pkg/errors"
 )
 
 const (
@@ -89,7 +89,7 @@ func (e *Entity) ForUpdate() error {
 
 func (e *Entity) checkUpdateFields(checkResult check.Result) error {
 	if strutils.AllBlank(e.Father, e.Mother) {
-		return fserr.New(e.DomainCNName() + "没有传递需要更新的字段")
+		return errors.New(e.DomainCNName() + "没有传递需要更新的字段")
 	}
 
 	if strutils.IsStringNotEmpty(e.Father) {

+ 2 - 2
project/server/application/domain/identity/entity.go

@@ -5,7 +5,7 @@ import (
 	"git.sxidc.com/go-framework/baize/framework/core/domain/entity"
 	"git.sxidc.com/go-framework/baize/framework/core/tag/check"
 	"git.sxidc.com/go-tools/utils/strutils"
-	"git.sxidc.com/service-supports/fserr"
+	"github.com/pkg/errors"
 )
 
 const (
@@ -80,7 +80,7 @@ func (e *Entity) ForUpdate() error {
 
 func (e *Entity) checkUpdateFields(checkResult check.Result) error {
 	if strutils.AllBlank(e.Name) {
-		return fserr.New(e.DomainCNName() + "没有传递需要更新的字段")
+		return errors.New(e.DomainCNName() + "没有传递需要更新的字段")
 	}
 
 	if strutils.IsStringNotEmpty(e.Name) {

+ 2 - 2
project/server/application/domain/student/entity.go

@@ -5,7 +5,7 @@ import (
 	"git.sxidc.com/go-framework/baize/framework/core/domain/entity"
 	"git.sxidc.com/go-framework/baize/framework/core/tag/check"
 	"git.sxidc.com/go-tools/utils/strutils"
-	"git.sxidc.com/service-supports/fserr"
+	"github.com/pkg/errors"
 )
 
 const (
@@ -83,7 +83,7 @@ func (e *Entity) ForUpdate() error {
 
 func (e *Entity) checkUpdateFields(checkResult check.Result) error {
 	if strutils.AllBlank(e.Name) {
-		return fserr.New(e.DomainCNName() + "没有传递需要更新的字段")
+		return errors.New(e.DomainCNName() + "没有传递需要更新的字段")
 	}
 
 	if strutils.IsStringNotEmpty(e.Name) {

+ 2 - 2
project/server/application/service/version.go

@@ -9,7 +9,7 @@ import (
 	"git.sxidc.com/go-framework/baize/framework/core/domain"
 	"git.sxidc.com/go-framework/baize/framework/core/infrastructure"
 	"git.sxidc.com/go-tools/utils/strutils"
-	"git.sxidc.com/service-supports/fserr"
+	"github.com/pkg/errors"
 )
 
 var versionService = &VersionService{}
@@ -43,7 +43,7 @@ func (svc *VersionService) prefixRoot(appInstance *application.App) {
 			}
 
 			if localCacheVersion != redisCacheVersion {
-				return nil, fserr.New("版本不一致")
+				return nil, errors.New("版本不一致")
 			}
 
 			if strutils.IsStringEmpty(localCacheVersion) {