main.go 944 字节
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()

	//https
	beego.BConfig.Listen.EnableHTTPS = true
	beego.BConfig.Listen.Graceful = true
	beego.BConfig.Listen.HTTPSPort = 443
	beego.BConfig.Listen.HTTPSCertFile = "conf/_.fjmaimaimai.com_bundle.crt"
	beego.BConfig.Listen.HTTPSKeyFile = "conf/fjmaimaimai.com_RSA.fjmaimaimai.com_RSA.key"

	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()
}