package main

import (
	"github.com/astaxie/beego"
	"github.com/tiptok/gocomm/config"
	"github.com/tiptok/gocomm/pkg/log"
	"gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/constant"
	_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/constant"
	_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/infrastructure/pg"
	_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/infrastructure/redis"
	_ "gitlab.fjmaimaimai.com/mmm-go/godevp/pkg/port/beego"
)

func main() {
	defer func() {

	}()
	beego.BConfig.CopyRequestBody = true

	log.InitLog(config.Logger{
		Filename: constant.LOG_File,
		Level:    constant.LOG_LEVEL,
	})

	//{
	//	// set up a span reporter
	//	reporter := zipkinhttp.NewReporter("http://106.52.15.41:9411/api/v2/spans")
	//	defer reporter.Close()
	//
	//	// create our local service endpoint
	//	endpoint, err := zipkin.NewEndpoint("godevp", "127.0.0.1:8080")
	//	if err != nil {
	//		log.Error("unable to create local endpoint: %+v\n", err)
	//	}
	//
	//	// initialize our tracer
	//	nativeTracer, err := zipkin.NewTracer(reporter, zipkin.WithLocalEndpoint(endpoint))
	//	if err != nil {
	//		log.Error("unable to create tracer: %+v\n", err)
	//	}
	//
	//	// use zipkin-go-opentracing to wrap our tracer
	//	tracer := zipkinot.Wrap(nativeTracer)
	//
	//	// optionally set as Global OpenTracing tracer instance
	//	opentracing.SetGlobalTracer(tracer)
	//}

	beego.Run()
}