package io.renren.modules.dataSet.controller;


import io.renren.common.utils.MinIoUtils;
import io.renren.common.utils.R;
import io.renren.datasource.annotation.DataSource;
import io.renren.modules.dataSet.service.StaticSystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController


@RequestMapping("/dataset/static")
public class StaticSystemController {

    @Autowired
    StaticSystemService staticSystemService;
    // 点击运行图标，制作动态数据集
    @RequestMapping("makeStaticDataSet")
    public  R makeDyDataSet(@RequestBody Map map){
;
        final String s = staticSystemService.runStaticSave(map);
        return R.ok().put("info",s);
    }
    @Transactional
    @RequestMapping("stSubmit")
    public R dySubmit(@RequestBody Map map){
//        System.out.println(map);
        Boolean s = staticSystemService.stSubmit(map);
        if(s){
            return R.ok();
        }else {
            return R.error("数据集创建失败，请联系管理员");
        }
    }
}
