getWecomConfig extracts the WeCom configuration from the AppIMSetting.
(setting *storepb.AppIMSetting)
| 22 | |
| 23 | // getWecomConfig extracts the WeCom configuration from the AppIMSetting. |
| 24 | func getWecomConfig(setting *storepb.AppIMSetting) *storepb.AppIMSetting_Wecom { |
| 25 | if setting == nil { |
| 26 | return nil |
| 27 | } |
| 28 | for _, s := range setting.Settings { |
| 29 | if s.Type == storepb.WebhookType_WECOM { |
| 30 | return s.GetWecom() |
| 31 | } |
| 32 | } |
| 33 | return nil |
| 34 | } |
| 35 | |
| 36 | // WebhookResponse is the API message for WeCom webhook response. |
| 37 | type WebhookResponse struct { |
no test coverage detected