update
This commit is contained in:
parent
54c624bde6
commit
43db1bdd7f
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
test.env
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// 构造函数, 用户初始化这个结构体
|
||||
func NewBookHandler() *BookApiHandler {
|
||||
func NewBookApiHandler() *BookApiHandler {
|
||||
return &BookApiHandler{
|
||||
db: config.Get().MySQL.DB(),
|
||||
svc: controller.NewBookController(),
|
||||
|
||||
11
book/main.go
11
book/main.go
@ -6,7 +6,11 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gitlab.com/go-course-project/go17/book/api"
|
||||
book "gitlab.com/go-course-project/go17/book/api"
|
||||
|
||||
// user "gitlab.com/go-course-project/go17/user/api"
|
||||
// comment "gitlab.com/go-course-project/go17/comment/api"
|
||||
// token "gitlab.com/go-course-project/go17/token/api"
|
||||
"gitlab.com/go-course-project/go17/book/config"
|
||||
)
|
||||
|
||||
@ -27,7 +31,10 @@ func main() {
|
||||
|
||||
// gin Engine, 它包装了http server
|
||||
server := gin.Default()
|
||||
api.NewBookHandler().Registry(server)
|
||||
book.NewBookApiHandler().Registry(server)
|
||||
// user.NewUserApiHandler().Registry(server)
|
||||
// comment.NewCommentApiHandler().Registry(server)
|
||||
// token.NewTokenApiHandler().Registry(server)
|
||||
|
||||
if err := server.Run(conf.App.Address()); err != nil {
|
||||
log.Println(err)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user