package com.pack.modeler.service;

import com.pack.modeler.model.ActivityData;
import com.pack.modeler.model.DiagramData;
import com.pack.modeler.repository.ActivityDataRepo;
import com.pack.modeler.repository.DiagramDataRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
public class ModelService {

    @Autowired
    DiagramDataRepo diagramDataRepo;

    @Autowired
    ActivityDataRepo activityDataRepo;

    public List<DiagramData> fetchResult(String token) {
        return new ArrayList<>(diagramDataRepo.findAllByToken(token));
    }

    public List<ActivityData> fetchActStats(String token) {
        return new ArrayList<>(activityDataRepo.findAllByToken(token));
    }
}
