Files
fys-Multi-tenant/fys-admin/src/main/java/com/fuyuanshen/app/controller/AppDeviceController.java

108 lines
3.0 KiB
Java
Raw Normal View History

2025-07-08 09:00:14 +08:00
package com.fuyuanshen.app.controller;
2025-07-19 09:36:35 +08:00
import com.fuyuanshen.app.domain.bo.AppPersonnelInfoBo;
2025-07-09 13:41:08 +08:00
import com.fuyuanshen.app.domain.dto.APPReNameDTO;
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
2025-07-19 09:36:35 +08:00
import com.fuyuanshen.app.domain.vo.AppDeviceDetailVo;
import com.fuyuanshen.app.service.AppDeviceBizService;
2025-07-08 09:00:14 +08:00
import com.fuyuanshen.common.core.domain.R;
2025-07-19 09:36:35 +08:00
import com.fuyuanshen.common.core.validate.AddGroup;
2025-07-08 09:00:14 +08:00
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;
2025-07-19 09:36:35 +08:00
import jakarta.validation.constraints.NotNull;
2025-07-08 09:00:14 +08:00
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
2025-07-09 13:41:08 +08:00
import java.util.List;
2025-07-08 09:00:14 +08:00
/**
2025-07-19 09:36:35 +08:00
* APP设备信息管理
2025-07-08 09:00:14 +08:00
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/device")
public class AppDeviceController extends BaseController {
2025-07-19 09:36:35 +08:00
private final AppDeviceBizService appDeviceService;
2025-07-08 09:00:14 +08:00
2025-07-09 13:41:08 +08:00
2025-07-08 09:00:14 +08:00
/**
2025-07-10 08:57:36 +08:00
* 查询设备列表
2025-07-08 09:00:14 +08:00
*/
@GetMapping("/list")
public TableDataInfo<AppDeviceVo> list(DeviceQueryCriteria bo, PageQuery pageQuery) {
2025-07-19 09:36:35 +08:00
return appDeviceService.queryAppDeviceList(bo,pageQuery);
2025-07-08 09:00:14 +08:00
}
/**
* 绑定设备
*/
@PostMapping("/bind")
public R<Void> bind(@RequestBody AppDeviceBo bo) {
2025-07-19 09:36:35 +08:00
return toAjax(appDeviceService.bindDevice(bo));
2025-07-08 09:00:14 +08:00
}
/**
* 解绑设备
*/
2025-07-09 13:41:08 +08:00
@DeleteMapping("/unBind")
2025-07-08 09:00:14 +08:00
public R<Void> unBind(Long id) {
2025-07-19 09:36:35 +08:00
return toAjax(appDeviceService.unBindDevice(id));
2025-07-08 09:00:14 +08:00
}
2025-07-09 13:41:08 +08:00
/**
* 查询设备类型列表
*/
@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("重命名成功!!!");
}
2025-07-19 09:36:35 +08:00
/**
* 获取设备详细信息
*
* @param id 主键
*/
@GetMapping("/{id}")
public R<AppDeviceDetailVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(appDeviceService.getInfo(id));
}
/**
* 人员信息登记
*/
@PostMapping(value = "/registerPersonInfo")
public R<Void> registerPersonInfo(@Validated(AddGroup.class) @RequestBody AppPersonnelInfoBo bo) {
return toAjax(appDeviceService.registerPersonInfo(bo));
}
/**
* 发送信息
*/
@PostMapping(value = "/sendMessage")
public R<Void> sendMessage(@RequestBody AppDeviceBo bo) {
return toAjax(appDeviceService.sendMessage(bo));
}
2025-07-08 09:00:14 +08:00
}