package controllers

import (
	"wechat-conf/utils"

	"github.com/astaxie/beego/config"
)

// 配置文件列表
const (
	AppConf    = "app"
	AliYunConf = "aliyun"
	WeChatConf = "wechat"
	SMSConf    = "sms"
)

func (c *BaseController) initConfig() {
	// c.RunMode = beego.AppConfig.String("runmode")

	if c.Configer == nil {
		c.Configer = make(map[string]config.Configer)
	}

	// 系统
	appConf, _ := utils.GetConfiger("conf/app.conf")
	if appConf != nil {
		c.Configer[AppConf] = appConf
	}

	c.RunMode = appConf.String("runmode")

	// 阿里云
	aliConf, _ := utils.GetConfiger("conf/aliyun.conf")
	if aliConf != nil {
		c.Configer[AliYunConf] = aliConf
	}
}