package com.whyc.controller;
|
|
import com.whyc.dto.Response;
|
import com.whyc.pojo.DeviceMaintain;
|
import com.whyc.service.DeviceMaintainService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
@RestController
|
@RequestMapping("deviceMaintain")
|
@Api(tags = "设备维保")
|
public class DeviceMaintainController {
|
|
@Autowired
|
private DeviceMaintainService service;
|
|
@GetMapping
|
@ApiOperation(value = "查询")
|
public Response get(@RequestParam Integer deviceId){
|
return service.get(deviceId);
|
}
|
|
@PostMapping
|
@ApiOperation(value = "创建")
|
public Response add(@RequestBody DeviceMaintain deviceMaintain){
|
return service.add(deviceMaintain);
|
}
|
|
@PutMapping
|
@ApiOperation(value = "修改")
|
public Response update(@RequestBody DeviceMaintain deviceMaintain){
|
return service.update(deviceMaintain);
|
}
|
|
@PutMapping("confirm")
|
@ApiOperation(value = "确认记录",notes = "传入deviceId(设备id),actualTime(实际维护日期),actualOwner2(实际维护人员),content(主要维护内容)")
|
public Response confirm(@RequestBody DeviceMaintain deviceMaintain){
|
return service.confirm(deviceMaintain);
|
}
|
|
@GetMapping("record")
|
@ApiOperation(value = "查询维保记录")
|
public Response getRecord(@RequestParam Integer deviceId){
|
return service.getRecord(deviceId);
|
}
|
|
|
}
|