golang微服务架构之 gin框架会员微服务,golang微服务架构,golang微服务框架,golang微服务部署

import (
	"github.com/gin-gonic/gin"
	"github.com/jinzhu/gorm"
	"github.com/zngue/go_gin_member/app/middleware"
	"github.com/zngue/go_gin_member/migration"
	"github.com/zngue/go_gin_member/router"
	usermigration "github.com/zngue/go_gin_user/migration"
	"github.com/zngue/go_tool/src/db"
	"github.com/zngue/go_tool/src/gin_run"
)

func main() {
	gin_run.GinRun(func(group *gin.RouterGroup) {
		group.Use(middleware.Cors())
		//UserRouter.Router(group)//路由加载自己加载的路由
		//group.Use(middleware.JWTAuth())
		router.Router(group)

	}, func(db *gorm.DB) {
		usermigration.AutoMigrate(db)//数据库迁移
		migration.Migration(db)
	})
	defer db.ConnClose()
}

golang gin框架微服务一键搭建,为您很好的服务 

 

文章来源 :http://blog.zngue.com/post/c7f4c83263.html

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页