修改包引用和配置文件
This commit is contained in:
parent
cb0984e8de
commit
6877ade6c6
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"cloud": {
|
"cloud": {
|
||||||
"serviceName": "BlogFileService",
|
"serviceName": "BlogAdminService",
|
||||||
"registerCenter": "localhost:6379",
|
"registerCenter": "localhost:6379",
|
||||||
"address": "localhost:8081",
|
"address": "localhost:8081",
|
||||||
"db": "0"
|
"db": "0"
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
"timeout": 120
|
"timeout": 120
|
||||||
},
|
},
|
||||||
"sqlite": {
|
"sqlite": {
|
||||||
"path": "./db_blog_file.db"
|
"path": "./db_blog_admin.db"
|
||||||
},
|
},
|
||||||
"redis": {
|
"redis": {
|
||||||
"addr": "localhost:6379",
|
"addr": "localhost:6379",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package service
|
package cloud
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"BlogAdmin/third_party/database"
|
"BlogAdmin/third_party/database"
|
||||||
|
|
|
@ -2,10 +2,10 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"BlogFile/bootstrap"
|
"BlogFile/bootstrap"
|
||||||
|
"BlogFile/cloud"
|
||||||
"BlogFile/internal/controller"
|
"BlogFile/internal/controller"
|
||||||
"BlogFile/internal/controller/admin"
|
"BlogFile/internal/controller/admin"
|
||||||
"BlogFile/internal/middleware"
|
"BlogFile/internal/middleware"
|
||||||
"BlogFile/internal/service"
|
|
||||||
"BlogFile/third_party/database"
|
"BlogFile/third_party/database"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -83,13 +83,13 @@ func main() {
|
||||||
mvc.New(fileApi).Handle(new(controller.FileController))
|
mvc.New(fileApi).Handle(new(controller.FileController))
|
||||||
mvc.New(adminFileApi).Handle(new(admin.FileController))
|
mvc.New(adminFileApi).Handle(new(admin.FileController))
|
||||||
|
|
||||||
go service.DistributedService.ServiceUp()
|
go cloud.DistributedService.ServiceUp()
|
||||||
|
|
||||||
app.Listen("localhost:8088")
|
app.Listen("localhost:8088")
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
log.Println("程序结束,关闭资源")
|
log.Println("程序结束,关闭资源")
|
||||||
service.DistributedService.ServiceDown()
|
cloud.DistributedService.ServiceDown()
|
||||||
db.Close()
|
db.Close()
|
||||||
database.RedisTemplate.Close()
|
database.RedisTemplate.Close()
|
||||||
}()
|
}()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"cloud": {
|
"cloud": {
|
||||||
"serviceName": "BlogFileService",
|
"serviceName": "BlogService",
|
||||||
"registerCenter": "localhost:6379",
|
"registerCenter": "localhost:6379",
|
||||||
"address": "localhost:8081",
|
"address": "localhost:8081",
|
||||||
"db": "0"
|
"db": "0"
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
"timeout": 120
|
"timeout": 120
|
||||||
},
|
},
|
||||||
"sqlite": {
|
"sqlite": {
|
||||||
"path": "./db_blog_file.db"
|
"path": "./db_blog.db"
|
||||||
},
|
},
|
||||||
"redis": {
|
"redis": {
|
||||||
"addr": "localhost:6379",
|
"addr": "localhost:6379",
|
||||||
|
|
|
@ -2,11 +2,11 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"Blog/bootstrap"
|
"Blog/bootstrap"
|
||||||
|
"Blog/cloud"
|
||||||
"Blog/internal/controller"
|
"Blog/internal/controller"
|
||||||
"Blog/internal/middleware"
|
"Blog/internal/middleware"
|
||||||
"Blog/internal/service"
|
"Blog/internal/service"
|
||||||
"Blog/third_party/database"
|
"Blog/third_party/database"
|
||||||
"BlogAdmin/cloud"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
@ -100,11 +100,9 @@ func main() {
|
||||||
})
|
})
|
||||||
articleApi := app.Party("/article")
|
articleApi := app.Party("/article")
|
||||||
diaryApi := app.Party("/diary")
|
diaryApi := app.Party("/diary")
|
||||||
// fileApi := app.Party("/file")
|
|
||||||
|
|
||||||
mvc.New(articleApi).Handle(new(controller.ArticleController))
|
mvc.New(articleApi).Handle(new(controller.ArticleController))
|
||||||
mvc.New(diaryApi).Handle(new(controller.DiaryController))
|
mvc.New(diaryApi).Handle(new(controller.DiaryController))
|
||||||
// mvc.New(fileApi).Handle(new(controller.FileController))
|
|
||||||
|
|
||||||
go service.ArticleService.InitArticleData()
|
go service.ArticleService.InitArticleData()
|
||||||
go service.DiaryService.InitDiaryData()
|
go service.DiaryService.InitDiaryData()
|
||||||
|
|
Loading…
Reference in New Issue