main.go 653 字节
package main

import (
	"fmt"

	"github.com/astaxie/beego"
	"gitlab.fjmaimaimai.com/mmm-go/gocomm/config"
	"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
	"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/redis"
	"openapi/pkg/constant"
	_ "openapi/pkg/infrastructure/bgorm"
	_ "openapi/pkg/log"
	_ "openapi/pkg/port/beego"
)

func main() {
	defer func() {
		log.Info("server on stop!")
	}()
	log.Info("server on start!")
	//constant.DebugConfig()
	err := redis.Init(config.Redis{
		Addr:     fmt.Sprintf("%v:%v", constant.REDIS_HOST, constant.REDIS_PORT),
		Password: constant.REDIS_AUTH,
		MaxIdle:  50,
	})
	if err != nil {
		log.Error(err)
	}
	beego.Run()
}