package com.yuanchu.mom.controller;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.yuanchu.mom.annotation.ValueAuth;
|
import com.yuanchu.mom.pojo.Device;
|
import com.yuanchu.mom.service.DeviceService;
|
import com.yuanchu.mom.utils.JackSonUtil;
|
import com.yuanchu.mom.vo.Result;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Map;
|
|
/**
|
* 设备(DeviceController)表控制层
|
*/
|
@Api(tags = "设备")
|
@AllArgsConstructor
|
@RestController
|
@RequestMapping("/deviceScope")
|
public class DeviceController {
|
|
private DeviceService deviceService;
|
|
@ApiOperation(value = "查询设备详情列表")
|
@PostMapping("/selectDeviceParameter")
|
public Result selectDeviceParameter(@RequestBody Map<String, Object> data) throws Exception {
|
Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
|
Device itemParameter = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Device.class);
|
return Result.success(deviceService.selectDeviceParameter(page, itemParameter));
|
}
|
|
@ApiOperation(value = "添加设备详情参数")
|
@PostMapping("/addDeviceParameter")
|
public Result addDeviceParameter(@RequestBody Device itemParameter) {
|
return Result.success(deviceService.addDeviceParameter(itemParameter));
|
}
|
|
@ApiOperation(value = "删除设备详情参数")
|
@PostMapping("/delDeviceParameter")
|
public Result<?> delDeviceParameter(Integer id) {
|
return Result.success(deviceService.delDeviceParameter(id));
|
}
|
|
@ApiOperation(value = "修改设备详情参数")
|
@PostMapping("/upDeviceParameter")
|
public Result<?> upDeviceParameter(@RequestBody Device itemParameter) {
|
return Result.success(deviceService.upDeviceParameter(itemParameter));
|
}
|
|
@ApiOperation(value = "获取设备总览")
|
@GetMapping("/selectEquipmentOverview")
|
@ValueAuth
|
public Result selectEquipmentOverview() {
|
return Result.success(deviceService.selectEquipmentOverview());
|
}
|
|
@ApiOperation(value = "获取被授权人")
|
@GetMapping("/authorizedPerson")
|
@ValueAuth
|
public Result authorizedPerson() {
|
return Result.success(deviceService.authorizedPerson());
|
}
|
|
@ApiOperation(value = "搜索")
|
@GetMapping("/search")
|
@ValueAuth
|
public Result search(Integer status, String deviceName, String specificationModel, String largeCategory) {
|
return Result.success(deviceService.search(status, deviceName, specificationModel, largeCategory));
|
}
|
|
}
|