package com.ruoyi.device.external.controller;
|
|
import java.util.List;
|
import javax.servlet.http.HttpServletResponse;
|
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.device.external.domain.ArdEquipExternal;
|
import com.ruoyi.device.external.service.IArdEquipExternalService;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
/**
|
* externalController
|
*
|
* @author zj
|
* @date 2023-03-13
|
*/
|
@RestController
|
@RequestMapping("/device/external")
|
@Api(tags = "外联设备管理接口")
|
public class ArdEquipExternalController extends BaseController
|
{
|
@Autowired
|
private IArdEquipExternalService ardEquipExternalService;
|
|
/**
|
* 查询external列表
|
*/
|
@ApiOperation(value = "查询外联设备管理列表")
|
@PreAuthorize("@ss.hasPermi('device:external:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(ArdEquipExternal ardEquipExternal)
|
{
|
startPage();
|
List<ArdEquipExternal> list = ardEquipExternalService.selectArdEquipExternalList(ardEquipExternal);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出external列表
|
*/
|
@ApiOperation(value = "导出外联设备管理列表")
|
@PreAuthorize("@ss.hasPermi('device:external:export')")
|
@Log(title = "external", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, ArdEquipExternal ardEquipExternal)
|
{
|
List<ArdEquipExternal> list = ardEquipExternalService.selectArdEquipExternalList(ardEquipExternal);
|
ExcelUtil<ArdEquipExternal> util = new ExcelUtil<ArdEquipExternal>(ArdEquipExternal.class);
|
util.exportExcel(response, list, "external数据");
|
}
|
|
/**
|
* 获取external详细信息
|
*/
|
@ApiOperation(value = "获取外联设备详细信息")
|
@PreAuthorize("@ss.hasPermi('device:external:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
{
|
return success(ardEquipExternalService.selectArdEquipExternalById(id));
|
}
|
|
/**
|
* 新增external
|
*/
|
@ApiOperation(value = "新增外联设备")
|
@PreAuthorize("@ss.hasPermi('device:external:add')")
|
@Log(title = "external", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody ArdEquipExternal ardEquipExternal)
|
{
|
return toAjax(ardEquipExternalService.insertArdEquipExternal(ardEquipExternal));
|
}
|
|
/**
|
* 修改external
|
*/
|
@ApiOperation(value = "修改外联设备")
|
@PreAuthorize("@ss.hasPermi('device:external:edit')")
|
@Log(title = "external", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody ArdEquipExternal ardEquipExternal)
|
{
|
return toAjax(ardEquipExternalService.updateArdEquipExternal(ardEquipExternal));
|
}
|
|
/**
|
* 删除external
|
*/
|
@ApiOperation(value = "删除外联设备")
|
@PreAuthorize("@ss.hasPermi('device:external:remove')")
|
@Log(title = "external", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable String[] ids)
|
{
|
return toAjax(ardEquipExternalService.deleteArdEquipExternalByIds(ids));
|
}
|
}
|