diff --git a/BlogAdminService/conf/bootstrap.json b/BlogAdminService/conf/bootstrap.json index 11255f2..70bf5f3 100644 --- a/BlogAdminService/conf/bootstrap.json +++ b/BlogAdminService/conf/bootstrap.json @@ -1,6 +1,6 @@ { "cloud": { - "serviceName": "BlogFileService", + "serviceName": "BlogAdminService", "registerCenter": "localhost:6379", "address": "localhost:8081", "db": "0" @@ -12,7 +12,7 @@ "timeout": 120 }, "sqlite": { - "path": "./db_blog_file.db" + "path": "./db_blog_admin.db" }, "redis": { "addr": "localhost:6379", diff --git a/BlogFileService/cloud/DistributedService.go b/BlogFileService/cloud/DistributedService.go index 91befc3..0228b4e 100644 --- a/BlogFileService/cloud/DistributedService.go +++ b/BlogFileService/cloud/DistributedService.go @@ -1,4 +1,4 @@ -package service +package cloud import ( "BlogAdmin/third_party/database" diff --git a/BlogFileService/main.go b/BlogFileService/main.go index d50f1ee..7fafedf 100644 --- a/BlogFileService/main.go +++ b/BlogFileService/main.go @@ -2,10 +2,10 @@ package main import ( "BlogFile/bootstrap" + "BlogFile/cloud" "BlogFile/internal/controller" "BlogFile/internal/controller/admin" "BlogFile/internal/middleware" - "BlogFile/internal/service" "BlogFile/third_party/database" "log" "net/http" @@ -83,13 +83,13 @@ func main() { mvc.New(fileApi).Handle(new(controller.FileController)) mvc.New(adminFileApi).Handle(new(admin.FileController)) - go service.DistributedService.ServiceUp() + go cloud.DistributedService.ServiceUp() app.Listen("localhost:8088") defer func() { log.Println("程序结束,关闭资源") - service.DistributedService.ServiceDown() + cloud.DistributedService.ServiceDown() db.Close() database.RedisTemplate.Close() }() diff --git a/BlogService/conf/bootstrap.json b/BlogService/conf/bootstrap.json index 11255f2..653a772 100644 --- a/BlogService/conf/bootstrap.json +++ b/BlogService/conf/bootstrap.json @@ -1,6 +1,6 @@ { "cloud": { - "serviceName": "BlogFileService", + "serviceName": "BlogService", "registerCenter": "localhost:6379", "address": "localhost:8081", "db": "0" @@ -12,7 +12,7 @@ "timeout": 120 }, "sqlite": { - "path": "./db_blog_file.db" + "path": "./db_blog.db" }, "redis": { "addr": "localhost:6379", diff --git a/BlogService/main.go b/BlogService/main.go index 6e6363c..6c5a865 100644 --- a/BlogService/main.go +++ b/BlogService/main.go @@ -2,11 +2,11 @@ package main import ( "Blog/bootstrap" + "Blog/cloud" "Blog/internal/controller" "Blog/internal/middleware" "Blog/internal/service" "Blog/third_party/database" - "BlogAdmin/cloud" "log" "net/http" "os" @@ -100,11 +100,9 @@ func main() { }) articleApi := app.Party("/article") diaryApi := app.Party("/diary") - // fileApi := app.Party("/file") mvc.New(articleApi).Handle(new(controller.ArticleController)) mvc.New(diaryApi).Handle(new(controller.DiaryController)) - // mvc.New(fileApi).Handle(new(controller.FileController)) go service.ArticleService.InitArticleData() go service.DiaryService.InitDiaryData()