package controller

import (
	"ktogame/dbUtil"

	"github.com/astaxie/beego"
	"github.com/beego/i18n"
	"github.com/go-xorm/xorm"
)

type baseController struct {
	beego.Controller
	engine *xorm.Engine
	i18n.Locale
}

func (p *baseController) Prepare() {
	p.engine = dbUtil.Engine
	al := p.Ctx.Request.Header.Get("Accept-Language")
	if al == "en-US" {
		p.Lang = al
	} else {
		p.Lang = "zh-CN"
	}
}
