config.go 518 B

1234567891011121314151617181920212223
  1. package config
  2. import "github.com/silenceper/wechat/v2/cache"
  3. const defaultBaseURL = "https://openaiapi.weixin.qq.com"
  4. // Config for 微信智能对话.
  5. type Config struct {
  6. AppID string `json:"app_id"`
  7. Token string `json:"token"`
  8. AESKey string `json:"aes_key"`
  9. Account string `json:"account"`
  10. BaseURL string `json:"base_url"`
  11. Cache cache.Cache
  12. }
  13. // GetBaseURL returns the API base URL.
  14. func (cfg *Config) GetBaseURL() string {
  15. if cfg.BaseURL == "" {
  16. return defaultBaseURL
  17. }
  18. return cfg.BaseURL
  19. }