processor_factory.go 700 B

123456789101112131415161718192021222324252627
  1. package area_graph
  2. import (
  3. "eta/eta_mobile/models/data_manage"
  4. "fmt"
  5. )
  6. type NullDealStrategy interface {
  7. Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*data_manage.ChartEdbInfoMapping, standardIndexMap map[string]*data_manage.EdbDataList, startDate string, endDate string) (err error)
  8. }
  9. func CreateStrategy(dealWay int) (NullDealStrategy, error) {
  10. switch dealWay {
  11. case 1:
  12. return &InterpolateStrategy{}, nil
  13. case 2:
  14. return &FillWithPreviousStrategy{}, nil
  15. case 3:
  16. return &FillWithNextStrategy{}, nil
  17. case 4:
  18. return &SetToZeroStrategy{}, nil
  19. case 5:
  20. return &DeleteDateStrategy{}, nil
  21. default:
  22. return nil, fmt.Errorf("未知的空值处理类型: %d", dealWay)
  23. }
  24. }