package org.jeecg.modules.dnc.controller;
|
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.modules.dnc.entity.DeviceType;
|
import org.jeecg.modules.dnc.service.IDeviceTypeService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@Slf4j
|
@Api(tags = "设备类信息")
|
@RestController
|
@RequestMapping("/nc/deviceType")
|
public class DeviceTypeController extends JeecgController<DeviceType, IDeviceTypeService> {
|
@Autowired
|
private IDeviceTypeService deviceTypeService;
|
|
/**
|
* 根据业务id查询设备类列表
|
* @param businessId
|
* @param type
|
* @return
|
*/
|
@AutoLog(value = "设备类信息-根据业务id查询设备类列表")
|
@ApiOperation(value = "设备类信息-根据业务id查询设备类列表", notes = "设备类信息-根据业务id查询设备类列表")
|
@GetMapping("/getByBusinessId")
|
public Result<?> getByBusinessId(String businessId,String type){
|
return deviceTypeService.getByBusinessId(businessId,type);
|
}
|
|
/**
|
* 新增设备类
|
* @param deviceType
|
* @return
|
*/
|
@AutoLog(value = "设备类信息-新增设备类")
|
@ApiOperation(value = "设备类信息-新增设备类", notes = "设备类信息-新增设备类")
|
@GetMapping("/add")
|
public Result<?> add(DeviceType deviceType){
|
return Result.OK(deviceTypeService.add(deviceType));
|
}
|
|
/**
|
* 编辑设备类
|
* @param deviceType
|
* @return
|
*/
|
@AutoLog(value = "设备类信息-编辑设备类")
|
@ApiOperation(value = "设备类信息-编辑设备类", notes = "设备类信息-编辑设备类")
|
@GetMapping("/edit")
|
public Result<?> edit(DeviceType deviceType){
|
return Result.OK(deviceTypeService.edit(deviceType));
|
}
|
|
/**
|
* 根据id删除设备类
|
* @param id
|
* @return
|
*/
|
@AutoLog(value = "设备类信息-根据id删除设备类")
|
@ApiOperation(value = "设备类信息-根据id删除设备类", notes = "设备类信息-根据id删除设备类")
|
@GetMapping("/delete")
|
public Result<?> delete(@RequestBody String id){
|
return Result.OK(deviceTypeService.delete(id));
|
}
|
}
|