package com.whyc.controller;
|
|
import com.whyc.dto.Response;
|
import com.whyc.pojo.Experiment;
|
import com.whyc.pojo.ExperimentWindingStep1;
|
import com.whyc.pojo.ExperimentWindingStep2;
|
import com.whyc.pojo.Project;
|
import com.whyc.service.WindingExperimentService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
@RestController
|
@RequestMapping("windingExperiment")
|
@Api(tags = "绕组试验")
|
public class WindingExperimentController {
|
|
/**
|
* 绕组试验
|
* winding
|
* 电流 电压
|
* Current
|
* 电阻
|
*
|
* 温度
|
*/
|
@Autowired
|
private WindingExperimentService service;
|
|
@GetMapping("getProjectName")
|
@ApiOperation(value = "获取实验项目名")
|
public Response<List<Project>> getProjectName(){
|
|
return service.getProjectName();
|
}
|
|
@PostMapping("")
|
@ApiOperation(value = "开始实验")
|
public Response addWindingExperiment(@RequestBody Experiment experiment){
|
|
return service.addWindingExperiment(experiment);
|
}
|
@PostMapping("addWindingStep1")
|
@ApiOperation(value = "实验步骤1",notes = "[\n" +
|
" {\n" +
|
" \"winding\": \"绕组1\",\n" +
|
" \"electricCurrent\": 10.0,\n" +
|
" \"vol\": 10.0,\n" +
|
" \"resistance\": 20.0,\n" +
|
" \"temperature\": 10.0,\n" +
|
" \"saveTime\": \"2021-05-19 08:16:20\",\n" +
|
" \"experimentId\": \"RZ_20210518132332\",\n" +
|
" \"status\": 0\n" +
|
" },\n" +
|
" {\n" +
|
" \"winding\": \"绕组2\",\n" +
|
" \"electricCurrent\": 10.0,\n" +
|
" \"vol\": 10.0,\n" +
|
" \"resistance\": 20.0,\n" +
|
" \"temperature\": 10.0,\n" +
|
" \"saveTime\": \"2021-05-19 08:16:20\",\n" +
|
" \"experimentId\": \"RZ_20210518132332\",\n" +
|
" \"status\": 0\n" +
|
" }\n" +
|
"]")
|
public Response addExperimentWindingStep1(@RequestBody List<ExperimentWindingStep1> windingStep1s){
|
|
return service.addExperimentWindingStep1(windingStep1s);
|
}
|
@PostMapping("addWindingStep2")
|
@ApiOperation(value = "实验步骤2",notes = "[\n" +
|
" {\n" +
|
" \"winding\": \"绕组\",\n" +
|
" \"electricCurrent\": 10.0,\n" +
|
" \"vol\": 10.0,\n" +
|
" \"resistance\": 20.0,\n" +
|
" \"temperature\": 10.0,\n" +
|
" \"saveTime\": \"2021-05-18 08:16:20\",\n" +
|
" \"experimentId\": \"RZ_20210518132332\",\n" +
|
" \"status\": 0\n" +
|
" }\n" +
|
"]")
|
public Response addExperimentWindingStep2(@RequestBody List<ExperimentWindingStep2> windingStep2s){
|
|
return service.addExperimentWindingStep2(windingStep2s);
|
}
|
|
}
|