package storeLink

import (
	"context"
	"errors"
	"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/schedulers/option"
	"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/collector"
	"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/inference"
	"mime/multipart"
)

// Template P端元数据信息模板
type Template struct {
	participantId int64
	host          string
	userName      string
	accessToken   string
}

// NewTemplate 构建新模板
func NewTemplate(host string, id int64, name string, token string) *Template {
	return &Template{
		host:          host,
		participantId: id,
		userName:      name,
		accessToken:   token,
	}
}

// Execute 执行任务
func (o Template) Execute(ctx context.Context, option *option.AiOption, mode int) (interface{}, error) {
	return nil, errors.New("failed to implement")
}

// GetClusterInferUrl 获取推理Url
func (o Template) GetClusterInferUrl(ctx context.Context, option *option.InferOption) (*inference.ClusterInferUrl, error) {
	return nil, errors.New("failed to implement")
}

// GetInferDeployInstanceList 获取推理实例列表
func (o Template) GetInferDeployInstanceList(ctx context.Context) ([]*inference.DeployInstance, error) {
	return nil, errors.New("failed to implement")
}

// StartInferDeployInstance 启动推理实例
func (o Template) StartInferDeployInstance(ctx context.Context, id string) bool {
	return false
}

// StopInferDeployInstance 停止推理实例
func (o Template) StopInferDeployInstance(ctx context.Context, id string) bool {
	return false
}

// GetInferDeployInstance  获取推理信息
func (o Template) GetInferDeployInstance(ctx context.Context, id string) (*inference.DeployInstance, error) {
	return nil, errors.New("failed to implement")
}

// CreateInferDeployInstance  创建推理实例
func (o Template) CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) {
	return "", errors.New("failed to implement")
}

// CheckModelExistence  查看Model是否存在
func (o Template) CheckModelExistence(ctx context.Context, modelName string, modelType string) bool {
	return false
}

// GetImageInferResult 获取镜像推理结果
func (o Template) GetImageInferResult(ctx context.Context, url string, file multipart.File, fileName string) (string, error) {
	return "", errors.New("failed to implement")
}

// GetResourceStats 获取资源数据
func (o Template) GetResourceStats(ctx context.Context) (*collector.ResourceStats, error) {
	return nil, errors.New("failed to implement")
}

// GetDatasetsSpecs 获取数据集信息
func (o Template) GetDatasetsSpecs(ctx context.Context) ([]*collector.DatasetsSpecs, error) {
	return nil, errors.New("failed to implement")
}

// GetAlgorithms 获取算法列表
func (o Template) GetAlgorithms(ctx context.Context) ([]*collector.Algorithm, error) {
	return nil, errors.New("failed to implement")
}

// GetTrainingTaskLog 获取训练任务日志
func (o Template) GetTrainingTaskLog(ctx context.Context, taskId string, instanceNum string) (string, error) {
	return "", errors.New("failed to implement")
}

// GetTrainingTask 获取训练任务信息
func (o Template) GetTrainingTask(ctx context.Context, taskId string) (*collector.Task, error) {
	return nil, errors.New("failed to implement")
}

// DownloadAlgorithmCode 下载算法源码
func (o Template) DownloadAlgorithmCode(ctx context.Context, resourceType string, card string, taskType string, dataset string, algorithm string) (string, error) {
	return "", errors.New("failed to implement")
}

// UploadAlgorithmCode 更新算法源码
func (o Template) UploadAlgorithmCode(ctx context.Context, resourceType string, card string, taskType string, dataset string, algorithm string, code string) error {
	return errors.New("failed to implement")
}

// GetComputeCards 获取算力卡信息
func (o Template) GetComputeCards(ctx context.Context) ([]string, error) {
	return nil, errors.New("failed to implement")
}

// GetUserBalance 查询用户余额
func (o Template) GetUserBalance(ctx context.Context) (float64, error) {
	return 0, errors.New("failed to implement")
}

// GetResourceSpecs 查询资源规格
func (o Template) GetResourceSpecs(ctx context.Context, resrcType string) (*collector.ResourceSpec, error) {
	return nil, errors.New("failed to implement")
}
