package area_graph

import (
	"eta/eta_mobile/models/data_manage"
	"fmt"
)

type NullDealStrategy interface {
	Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*data_manage.ChartEdbInfoMapping, standardIndexMap map[string]*data_manage.EdbDataList, startDate string, endDate string) (err error)
}

func CreateStrategy(dealWay int) (NullDealStrategy, error) {
	switch dealWay {
	case 1:
		return &InterpolateStrategy{}, nil
	case 2:
		return &FillWithPreviousStrategy{}, nil
	case 3:
		return &FillWithNextStrategy{}, nil
	case 4:
		return &SetToZeroStrategy{}, nil
	case 5:
		return &DeleteDateStrategy{}, nil
	default:
		return nil, fmt.Errorf("未知的空值处理类型: %d", dealWay)
	}
}
