package com.css.simulation.resource.server.adapter.controller.job_manage;

import api.common.pojo.common.ResponseBodyVO;
import api.common.pojo.param.map.SimulationMapParam;
import api.common.pojo.param.project.*;
import api.common.pojo.vo.map.SimulationMapVO;
import api.common.pojo.vo.project.*;
import api.common.util.StringUtil;
import com.css.simulation.resource.server.app.service.ClusterService;
import com.css.simulation.resource.server.app.service.job_manage.MultiSimulationProjectService;
import com.css.simulation.resource.server.app.service.job_manage.SimulationMapService;
import com.css.simulation.resource.server.app.service.job_manage.SimulationProjectService;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

/**
 * 工作台模块--项目运行
 */
@RestController
@RequestMapping("/simulationMap")
public class SimulationMapController {

  @Resource
  private SimulationProjectService simulationProjectService;
  @Resource
  private ClusterService clusterService;

  @Resource
  private SimulationMapService mapService;

  //* -------------------------------- 项目运行 --------------------------------

  @RequestMapping("/selectAllSimulationMapList")
  public ResponseBodyVO<List<SimulationMapVO>> selectAllSimulationMapList(@RequestBody SimulationMapParam param) {
    return mapService.selectAllSimulationMapList(param);
  }

  @RequestMapping("/selectSimulationMapList")
  public ResponseBodyVO<PageInfo<SimulationMapVO>> selectSimulationMapList(@RequestBody SimulationMapParam param) {
    return mapService.selectMultiSimulationMap(param);
  }

  @RequestMapping("/getSimulationMap")
  public ResponseBodyVO<SimulationMapVO> getSimulationMap(@RequestBody SimulationMapParam param) {
    return mapService.getSimulationMap(param);
  }

  @RequestMapping("/updateSimulationMap")
  public ResponseBodyVO updateSimulationMap(@RequestBody SimulationMapParam param) {
    return mapService.updateSimulationMap(param);
  }
  @RequestMapping("/deleteSimulationMap")
  public ResponseBodyVO deleteSimulationMap(@RequestBody SimulationMapParam param) {
    return mapService.deleteSimulationMap(param);
  }

  @RequestMapping("/uploadSimulationMap")
  public ResponseBodyVO<SimulationMapVO> uploadSimulationMap(@RequestParam("fileJson") MultipartFile fileJson,@RequestParam("fileOsgb") MultipartFile fileOsgb, @RequestParam("fileDriver") MultipartFile fileDriver, @RequestPart("content") SimulationMapParam param) {
    return mapService.uploadSimulationMap(fileJson, fileOsgb, fileDriver, param);
  }

}
