Browse Source

修改bug

yjp 1 year ago
parent
commit
2f6a3260f8
2 changed files with 1 additions and 24 deletions
  1. 1 21
      project/mono/application/service/version.go
  2. 0 3
      project/mono/main.go

+ 1 - 21
project/mono/application/service/version.go

@@ -8,8 +8,6 @@ import (
 	"git.sxidc.com/go-framework/baize/framework/core/application"
 	"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"
 )
 
 var versionService = &VersionService{}
@@ -32,26 +30,8 @@ func (svc *VersionService) prefixRoot(appInstance *application.App) {
 		Path:             "/version",
 		SendResponseFunc: response.SendMapResponse,
 		ServiceFunc: func(c *api.Context, params request.Params, objects []domain.Object, i *infrastructure.Infrastructure) (map[string]any, error) {
-			localCacheVersion, err := i.LocalCache().Get("version")
-			if err != nil {
-				return nil, err
-			}
-
-			redisCacheVersion, err := i.RedisCache().Get("version")
-			if err != nil {
-				return nil, err
-			}
-
-			if localCacheVersion != redisCacheVersion {
-				return nil, fserr.New("版本不一致")
-			}
-
-			if strutils.IsStringEmpty(localCacheVersion) {
-				localCacheVersion = "cache-empty-v1.0.0"
-			}
-
 			return map[string]any{
-				"version": localCacheVersion,
+				"version": "v1.0.0",
 			}, nil
 		},
 	})

+ 0 - 3
project/mono/main.go

@@ -6,9 +6,6 @@ import (
 	"syscall"
 )
 
-// Version
-// curl -X GET "http://localhost:32000/mono/api/version"
-
 func main() {
 	application.NewApp()
 	defer application.DestroyApp()