forked from dyf/fys-Multi-tenant
80 lines
2.2 KiB
Java
80 lines
2.2 KiB
Java
package com.fuyuanshen.app.controller;
|
|
|
|
import com.fuyuanshen.app.domain.dto.APPReNameDTO;
|
|
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
|
|
import com.fuyuanshen.app.service.equipment.APPDeviceService;
|
|
import com.fuyuanshen.common.core.domain.R;
|
|
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
|
import com.fuyuanshen.common.web.core.BaseController;
|
|
import com.fuyuanshen.equipment.domain.dto.AppDeviceBo;
|
|
import com.fuyuanshen.equipment.domain.query.DeviceQueryCriteria;
|
|
import com.fuyuanshen.equipment.domain.vo.AppDeviceVo;
|
|
import com.fuyuanshen.equipment.service.DeviceService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* APP 设备信息管理
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/app/device")
|
|
public class AppDeviceController extends BaseController {
|
|
|
|
private final DeviceService deviceService;
|
|
|
|
|
|
private final APPDeviceService appDeviceService;
|
|
|
|
/**
|
|
* 查询文件列表
|
|
*/
|
|
@GetMapping("/list")
|
|
public TableDataInfo<AppDeviceVo> list(DeviceQueryCriteria bo, PageQuery pageQuery) {
|
|
|
|
return deviceService.queryAppDeviceList(bo,pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 绑定设备
|
|
*/
|
|
@PostMapping("/bind")
|
|
public R<Void> bind(@RequestBody AppDeviceBo bo) {
|
|
return toAjax(deviceService.bindDevice(bo));
|
|
}
|
|
|
|
|
|
/**
|
|
* 解绑设备
|
|
*/
|
|
@DeleteMapping("/unBind")
|
|
public R<Void> unBind(Long id) {
|
|
return toAjax(deviceService.unBindDevice(id));
|
|
}
|
|
|
|
/**
|
|
* 查询设备类型列表
|
|
*/
|
|
@GetMapping(value = "/typeList")
|
|
public R<List<APPDeviceTypeVo>> getTypeList() {
|
|
List<APPDeviceTypeVo> typeList = appDeviceService.getTypeList();
|
|
return R.ok(typeList);
|
|
}
|
|
|
|
/**
|
|
* 重命名设备
|
|
* @param reNameDTO
|
|
* @return
|
|
*/
|
|
@PostMapping(value = "/reName")
|
|
public R<String> reName(@Validated @RequestBody APPReNameDTO reNameDTO) {
|
|
appDeviceService.reName(reNameDTO);
|
|
return R.ok("重命名成功!!!");
|
|
}
|
|
}
|