1234567891011121314151617181920212223242526272829303132333435363738 |
- package config
- import "eta_mini_ht_api/common/contants"
- // RedisOpts redis 连接属性
- type WechatOpts struct {
- Appid string
- Secret string
- }
- type WechatConfig struct {
- BaseConfig
- opts WechatOpts
- }
- func (w *WechatConfig) GetAppid() string {
- return w.opts.Appid
- }
- func (w *WechatConfig) GetSecret() string {
- return w.opts.Secret
- }
- func (w *WechatConfig) InitConfig() {
- opts := WechatOpts{
- Appid: w.GetString("appid"),
- Secret: w.GetString("secret"),
- }
- w.opts = opts
- }
- func NewWechat() Config {
- return &WechatConfig{
- BaseConfig: BaseConfig{prefix: "wechat"},
- opts: WechatOpts{},
- }
- }
- func init() {
- Register(contants.WECHAT, NewWechat)
- }
|