修改包引用和配置文件
This commit is contained in:
parent
cb0984e8de
commit
6877ade6c6
|
@ -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",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package service
|
||||
package cloud
|
||||
|
||||
import (
|
||||
"BlogAdmin/third_party/database"
|
||||
|
|
|
@ -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()
|
||||
}()
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue