package com.energy.manage.service.controller.wavedatatransfer;

import com.energy.manage.common.base.Page;
import com.energy.manage.common.po.wavedatatransfer.WaveDataTransferPo;
import com.energy.manage.common.reponse.ResultResp;
import com.energy.manage.service.controller.base.BaseServiceController;
import com.energy.manage.service.domain.dto.wavedatatransfer.WaveDataTransferDto;
import com.energy.manage.service.domain.vo.wavedatatransfer.WaveDataTransferVo;
import com.energy.manage.service.service.wavedatatransfer.WaveDatatransferServce;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author chy
 * @date 2024/11/7 16:08
 * @desc
 */
@Api(value = "WaveDatatransferController", tags = "振动数据转换")
@RestController
@RequestMapping("/waveDataTransfer")
public class WaveDatatransferController extends BaseServiceController {

    @Autowired
    private WaveDatatransferServce waveDatatransferServce;


    @ApiOperation(value = "振动/激光数据转换查询列表")
    @GetMapping("/queryDataTransfer")
    public ResultResp<Page<WaveDataTransferVo>> queryDataTransfer(WaveDataTransferDto waveDatatransferDto) {
        return pageResult(waveDatatransferServce.queryDataTransfer(waveDatatransferDto), waveDatatransferDto);
    }

    @Deprecated
    @ApiOperation(value = "新增振动/激光数据转换查重")
    @GetMapping("/beforAddDataTransferQuery")
    public ResultResp beforAddDataTransferQuery(WaveDataTransferDto waveDatatransferDto) {
        return success(waveDatatransferServce.beforAddDataTransferQuery(waveDatatransferDto));
    }

    @ApiOperation(value = "新增振动/激光数据转换")
    @PostMapping("/addDataTransfer")
    public ResultResp addDataTransfer(@RequestBody WaveDataTransferPo waveDatatransferPo) {
        return success(waveDatatransferServce.addDataTransfer(waveDatatransferPo, getUserId()));
    }

    @Deprecated
    @ApiOperation(value = "编辑振动数据转换")
    @PostMapping("/editDataTransfer")
    public ResultResp editDataTransfer(@RequestBody WaveDataTransferPo waveDatatransferPo) {
        return success(waveDatatransferServce.editDataTransfer(waveDatatransferPo, getUserId()));
    }

    @ApiOperation(value = "转换/重新转换")
    @PostMapping("/dataTransfer")
    public ResultResp dataTransfer(@RequestBody WaveDataTransferDto waveDatatransferDto) {
        return success(waveDatatransferServce.dataTransfer(waveDatatransferDto));
    }
}
