wangdong 75079c05d3 Initial commit: One API with custom Server Configuration UI
- Added Server Configuration settings page (backend + frontend)
- Added .env config download/import API
- Runtime config updates via UI
- Support for all 3 themes (default, air, berry)
- i18n support (zh/en)
2026-07-28 01:25:29 +08:00

23 lines
480 B
Go

package message
import (
"fmt"
"github.com/songquanpeng/one-api/common/config"
)
const (
ByAll = "all"
ByEmail = "email"
ByMessagePusher = "message_pusher"
)
func Notify(by string, title string, description string, content string) error {
if by == ByEmail {
return SendEmail(title, config.RootUserEmail, content)
}
if by == ByMessagePusher {
return SendMessage(title, description, content)
}
return fmt.Errorf("unknown notify method: %s", by)
}