From 057d62cdc018a10ba908bc43b8dc4ca7dfa642d7 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 28 Oct 2022 16:57:00 -0400 Subject: [PATCH] wip --- go.mod | 2 +- go.sum | 4 ++-- main.go | 6 +++--- service/service.go | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 6c454be..ab604ed 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d - github.com/IceWhaleTech/CasaOS-Common v0.0.0-20220929035515-b1287110d6d8 + github.com/IceWhaleTech/CasaOS-Common v0.0.0-20221028205031-b7c1d053db0b github.com/IceWhaleTech/CasaOS-Gateway v0.3.6 github.com/Microsoft/go-winio v0.5.0 // indirect github.com/ambelovsky/go-structs v1.1.0 // indirect diff --git a/go.sum b/go.sum index 0bf42e2..951fa55 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d github.com/Curtis-Milo/nat-type-identifier-go v0.0.0-20220215191915-18d42168c63d/go.mod h1:lW9x+yEjqKdPbE3+cf2fGPJXCw/hChX3Omi9QHTLFsQ= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/IceWhaleTech/CasaOS-Common v0.0.0-20220901034123-ca130f6b5ce9/go.mod h1:2MiivEMzvh41codhEKUcn46WK3Ffesop/04qa9jsvQk= -github.com/IceWhaleTech/CasaOS-Common v0.0.0-20220929035515-b1287110d6d8 h1:r8nhgQ6tnrn6ikXN9aLH/K4H4H64Nc0hZ6jyW2B22x0= -github.com/IceWhaleTech/CasaOS-Common v0.0.0-20220929035515-b1287110d6d8/go.mod h1:2MiivEMzvh41codhEKUcn46WK3Ffesop/04qa9jsvQk= +github.com/IceWhaleTech/CasaOS-Common v0.0.0-20221028205031-b7c1d053db0b h1:HKdwfgoFQbq9OoGrTVuBug1fUFADER0hy6o2L/RsLKA= +github.com/IceWhaleTech/CasaOS-Common v0.0.0-20221028205031-b7c1d053db0b/go.mod h1:2MiivEMzvh41codhEKUcn46WK3Ffesop/04qa9jsvQk= github.com/IceWhaleTech/CasaOS-Gateway v0.3.6 h1:2tQQo85+jzbbjqIsKKn77QlAA73bc7vZsVCFvWnK4mg= github.com/IceWhaleTech/CasaOS-Gateway v0.3.6/go.mod h1:hnZwGUzcOyiufMpVO7l3gu2gAm6Ws4TY4Nlj3kMshXA= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= diff --git a/main.go b/main.go index ede006d..67726a2 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "path/filepath" "time" - "github.com/IceWhaleTech/CasaOS-Gateway/common" + "github.com/IceWhaleTech/CasaOS-Common/model" "github.com/IceWhaleTech/CasaOS/model/notify" "github.com/IceWhaleTech/CasaOS/pkg/cache" "github.com/IceWhaleTech/CasaOS/pkg/config" @@ -112,7 +112,7 @@ func main() { } routers := []string{"sys", "apps", "container", "app-categories", "port", "file", "folder", "batch", "image", "samba", "notify"} for _, v := range routers { - err = service.MyService.Gateway().CreateRoute(&common.Route{ + err = service.MyService.Gateway().CreateRoute(&model.Route{ Path: "/v1/" + v, Target: "http://" + listener.Addr().String(), }) @@ -126,7 +126,7 @@ func main() { time.Sleep(time.Second * 2) // v0.3.6 if config.ServerInfo.HttpPort != "" { - changePort := common.ChangePortRequest{} + changePort := model.ChangePortRequest{} changePort.Port = config.ServerInfo.HttpPort err := service.MyService.Gateway().ChangePort(&changePort) if err == nil { diff --git a/service/service.go b/service/service.go index e2164c0..3858fef 100644 --- a/service/service.go +++ b/service/service.go @@ -11,7 +11,7 @@ package service import ( - gateway "github.com/IceWhaleTech/CasaOS-Gateway/common" + "github.com/IceWhaleTech/CasaOS-Common/external" "github.com/gorilla/websocket" "github.com/patrickmn/go-cache" "gorm.io/gorm" @@ -35,12 +35,12 @@ type Repository interface { System() SystemService Shares() SharesService Connections() ConnectionsService - Gateway() gateway.ManagementService + Gateway() external.ManagementService } func NewService(db *gorm.DB, RuntimePath string) Repository { - gatewayManagement, err := gateway.NewManagementService(RuntimePath) + gatewayManagement, err := external.NewManagementService(RuntimePath) if err != nil && len(RuntimePath) > 0 { panic(err) } @@ -68,10 +68,10 @@ type store struct { system SystemService shares SharesService connections ConnectionsService - gateway gateway.ManagementService + gateway external.ManagementService } -func (c *store) Gateway() gateway.ManagementService { +func (c *store) Gateway() external.ManagementService { return c.gateway } func (s *store) Connections() ConnectionsService {