package com.liangjian.dataplatform.member.service.impl;

import com.liangjian.dataplatform.member.dao.tertiary.DataDictoryRepository;
import com.liangjian.dataplatform.member.entity.po.tertiary.DataDictory;
import com.liangjian.dataplatform.member.service.IDataDictoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: 黄树文
 * @Date: 2019/11/29 11:43
 */
@Service
public class DataDictoryService implements IDataDictoryService {

    @Autowired
    DataDictoryRepository dataDictoryRepository;


    @Override
    public ArrayList<Map<String, Object>> findAllOriginType() {


        List<DataDictory> dataDictories = dataDictoryRepository.findAllOriginType();

        ArrayList<Map<String, Object>> originTypeMaps = new ArrayList<>();
        for (DataDictory dataDictory: dataDictories) {
            HashMap<String, Object> originTypeMap = new HashMap<>();
            originTypeMap.put("label",dataDictory.getText());
            originTypeMap.put("value",dataDictory.getText());
            originTypeMaps.add(originTypeMap);
        }


        return originTypeMaps;
    }

}
