2025-02-11 15:35:52 +08:00

60 lines
1.2 KiB
Go

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) PostInit1() {
ct.selfConf = ct.GetById(int64(0))
if ct.selfConf == nil {
panic("无法读取config.json")
}
}