disable & notify
(channelError types.ChannelError, reason string)
| 18 | |
| 19 | // disable & notify |
| 20 | func DisableChannel(channelError types.ChannelError, reason string) { |
| 21 | success := model.UpdateChannelStatus(channelError.ChannelId, channelError.UsingKey, common.ChannelStatusAutoDisabled, reason) |
| 22 | if success { |
| 23 | subject := fmt.Sprintf("通道「%s」(#%d)已被禁用", channelError.ChannelName, channelError.ChannelId) |
| 24 | content := fmt.Sprintf("通道「%s」(#%d)已被禁用,原因:%s", channelError.ChannelName, channelError.ChannelId, reason) |
| 25 | NotifyRootUser(formatNotifyType(channelError.ChannelId, common.ChannelStatusAutoDisabled), subject, content) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func EnableChannel(channelId int, usingKey string, channelName string) { |
| 30 | success := model.UpdateChannelStatus(channelId, usingKey, common.ChannelStatusEnabled, "") |
no test coverage detected