123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- package com.gyee.sampleimpala.controller;
- import com.alibaba.fastjson.JSONObject;
- import com.gyee.sampleimpala.common.result.JsonResult;
- import com.gyee.sampleimpala.common.result.ResultCode;
- import com.gyee.sampleimpala.model.kudu.Caseperformance;
- import com.gyee.sampleimpala.service.custom.GoldenService;
- import com.gyee.sampleimpala.service.kudu.CaseperformanceService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * 性能样本
- *
- * @author w
- * @since 2021-11-17
- import org.springframework.web.bind.annotation.CrossOrigin;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- /**
- * 性能下降样本库
- */
- @CrossOrigin
- @RestController
- @RequestMapping("/case")
- public class CaseperformanceController {
- @Autowired
- private CaseperformanceService caseperformanceService;
- @Autowired
- private GoldenService goldenService;
- /**
- * 获取样本数据
- *
- * @param station 场站
- * @param model 风机模型
- * @param tag 样本类型
- * @param st 开始时间
- * @param et 结束时间
- * @return
- */
- @GetMapping("/performance/list")
- public JSONObject getPerformanceList(String station, String[] model, Integer tag,
- String st, String et) {
- List<Caseperformance> list = caseperformanceService.getPerformanceList(station, model, tag, st, et);
- return JsonResult.successData(ResultCode.SUCCESS, list);
- }
- /**
- * 新增样本
- *
- * @param performance 样本对象
- * @return
- */
- @PostMapping("/performance/add")
- public JSONObject addPerformance(@RequestBody Caseperformance performance) {
- boolean flag = caseperformanceService.addPerformance(performance);
- if (flag) {
- return JsonResult.success(ResultCode.SUCCESS);
- }
- return JsonResult.error(ResultCode.ERROR);
- }
- /**
- * 编辑样本
- *
- * @param performance 样本对象
- * @return
- */
- @PostMapping("/performance/edit")
- public JSONObject editPerformance(@RequestBody Caseperformance performance) {
- boolean flag = caseperformanceService.editPerformance(performance);
- if (flag) {
- return JsonResult.success(ResultCode.SUCCESS);
- }
- return JsonResult.error(ResultCode.ERROR);
- }
- /**
- * 删除样本
- *
- * @param id 样本id
- * @return
- */
- @PostMapping("/performance/remove")
- public JSONObject removePerformance(Integer id) {
- boolean flag = caseperformanceService.removePerformance(id);
- if (flag) {
- return JsonResult.success(ResultCode.SUCCESS);
- }
- return JsonResult.error(ResultCode.ERROR);
- }
- /**
- *
- * @param id 样本id(数组)
- * @param interval 数据时间间隔
- * @return
- */
- public JSONObject getCurve(
- @RequestParam(value = "id",required = false) Integer[] id,
- @RequestParam(value = "interval",required = false) Integer interval
- ) {
- return null;
- }
- }
|