package com.drops.poc;

import com.drops.entity.ControllersFactory;
import com.drops.ui.MainController;
import com.drops.utils.HTTPUtils;
import com.drops.utils.ReUtil;
import com.drops.utils.Utils;

import java.util.HashMap;

/**
 * @ClassName: SpringBootEnvInfo
 * @Description: TODO
 * @Author: Summer
 * @Date: 2021/7/28 16:34
 * @Version: v1.0.0
 * @Description:
 **/
public class SpringBootEnvInfo {
    HashMap resultMap = new HashMap();
    MainController mainController ;

    public SpringBootEnvInfo(HashMap resultMap, MainController mainController) {
        this.resultMap = resultMap;
        this.mainController = (MainController) ControllersFactory.controllers.get(MainController.class.getSimpleName());
    }


    private  void EnvInfo(String target){
        String result = HTTPUtils.getRequest(target).body();
        if (result.contains("spring-boot-starter-actuator")){
            this.mainController.logTextArea.appendText(Utils.log("存在依赖：spring-boot-starter-actuator"));
//            mainController.logTextArea.appendText(Utils.log());
            String re = ReUtil.hasVersion(result,result);
            if (!re.isEmpty()){
                this.mainController.logTextArea.appendText(Utils.log("存在依赖： " + re));
            }else {

            }
            this.mainController.logTextArea.appendText(Utils.log(result));
        }

    }





}
