package mt

import (
	"f5"
	"main/mtb"
	"strings"
)

type Config struct {
	mtb.Config
}

type ConfigTable struct {
	f5.IdMetaTable[Config]
	selfConf *Config
}

func (ct *ConfigTable) GetGameApiUrl() string {
	return ct.selfConf.GetGameapiUrl()
}

func (ct *ConfigTable) GetWxUrl() []string {
	return strings.Split(ct.selfConf.GetWxUrl(), "|")
}

func (ct *ConfigTable) GetWxNotifyToken() string {
    return ct.selfConf.GetWxNotifyToken()
}

func (ct *ConfigTable) GetWxNotifyEncodingAesKey() string {
	return ct.selfConf.GetWxNotifyEncodingAesKey()
}

func (ct *ConfigTable) GetWxMerchantId() string {
	return ct.selfConf.GetWxMerchantId()
}

func (ct *ConfigTable) GetWxCertificateSn() string {
    return ct.selfConf.GetWxCertificateSn()
}

func (ct *ConfigTable) GetWxMerchantApiKey() string {
    return ct.selfConf.GetWxMerchantApiKey()
}

func (ct *ConfigTable) GetWxMsgNotifyToken() string {
    return ct.selfConf.GetWxMsgNotifyToken()
}

func (ct *ConfigTable) GetWxMsgNotifyEncodingAesKey() string {
	return ct.selfConf.GetWxMsgNotifyEncodingAesKey()
}

func (ct *ConfigTable) GetWxNofityHost() string {
	return ct.selfConf.GetWxNofityHost()
}

func (ct *ConfigTable) GetWxLinkTitle() string {
	return ct.selfConf.GetWxLinkTitle()
}

func (ct *ConfigTable) GetWxLinkDescription() string {
	return ct.selfConf.GetWxLinkDescription()
}

func (ct *ConfigTable) GetWxMerchantPublicKeyId() string {
	return ct.selfConf.GetWxMerchantPublicKeyId()
}

func (ct *ConfigTable) PostInit1() {
	ct.selfConf = ct.GetById(int64(0))
	if ct.selfConf == nil {
		panic("无法读取config.json")
	}
}
