package notify

import (
	"context"

	"github.com/gogf/gf/v2/errors/gerror"
	"github.com/gogf/gf/v2/os/glog"

	"kami/utility/config"
)

type Notification interface {
	SendMessage(ctx context.Context, title, message string) error
	SendMessageWithImage(ctx context.Context, title, message, imagePath string) error
	SendImage(ctx context.Context, imagePath string) error
}

var client *Notification

func NewClient(ctx context.Context) *Notification {
	cfg := config.NewConfig(ctx)
	model, err := cfg.GetNotification()
	if err != nil {
		panic(gerror.Wrap(err, "初始化通知失败"))
	}
	switch model.Platform {
	//case "feishu":
	//	client = notify.Feishu{}
	default:
		glog.Error(ctx, "不支持的平台")
	}
	return client
}
