From 1566e4c7604d85737ea67fe6757e71b8185fa48e Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期二, 18 十一月 2025 16:52:42 +0800
Subject: [PATCH] 添加设备管理页面,添加测试设备任务监控页面
---
mes-processes/mes-plcSend/src/main/java/com/mes/device/controller/DeviceGroupController.java | 50 +++++++++++++++++++++++++-------------------------
1 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/mes-processes/mes-plcSend/src/main/java/com/mes/device/controller/DeviceGroupController.java b/mes-processes/mes-plcSend/src/main/java/com/mes/device/controller/DeviceGroupController.java
index 88e657c..37ea229 100644
--- a/mes-processes/mes-plcSend/src/main/java/com/mes/device/controller/DeviceGroupController.java
+++ b/mes-processes/mes-plcSend/src/main/java/com/mes/device/controller/DeviceGroupController.java
@@ -8,8 +8,8 @@
import com.mes.device.vo.DeviceGroupVO;
import com.mes.device.vo.StatisticsVO;
import com.mes.vo.Result;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -29,7 +29,7 @@
@Slf4j
@RestController
@RequestMapping("device/group")
-@Tag(name = "璁惧缁勭鐞�", description = "璁惧缁勭鐞嗙浉鍏虫帴鍙�")
+@Api(tags = "璁惧缁勭鐞�")
public class DeviceGroupController {
@Resource
@@ -42,7 +42,7 @@
* 鍒涘缓璁惧缁�
*/
@PostMapping("/create")
- @Operation(summary = "鍒涘缓璁惧缁�", description = "鍒涘缓璁惧缁勪俊鎭�")
+ @ApiOperation("鍒涘缓璁惧缁�")
public Result<DeviceGroupConfig> createGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -65,7 +65,7 @@
* 鏇存柊璁惧缁勯厤缃�
*/
@PostMapping("/update")
- @Operation(summary = "鏇存柊璁惧缁勯厤缃�", description = "鏇存柊鎸囧畾ID鐨勮澶囩粍閰嶇疆")
+ @ApiOperation("鏇存柊璁惧缁勯厤缃�")
public Result<DeviceGroupConfig> updateGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -89,7 +89,7 @@
* 鍒犻櫎璁惧缁勯厤缃�
*/
@PostMapping("/delete")
- @Operation(summary = "鍒犻櫎璁惧缁勯厤缃�", description = "鍒犻櫎鎸囧畾ID鐨勮澶囩粍閰嶇疆")
+ @ApiOperation("鍒犻櫎璁惧缁勯厤缃�")
public Result<Void> deleteGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -105,7 +105,7 @@
* 鏍规嵁ID鑾峰彇璁惧缁勯厤缃�
*/
@PostMapping("/detail")
- @Operation(summary = "鑾峰彇璁惧缁勯厤缃鎯�", description = "鏍规嵁ID鑾峰彇璁惧缁勯厤缃殑璇︾粏淇℃伅")
+ @ApiOperation("鑾峰彇璁惧缁勯厤缃鎯�")
public Result<DeviceGroupConfig> getGroupById(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -121,7 +121,7 @@
* 鍒嗛〉鏌ヨ璁惧缁勫垪琛�
*/
@PostMapping("/list")
- @Operation(summary = "鍒嗛〉鏌ヨ璁惧缁勫垪琛�", description = "鍒嗛〉鏌ヨ璁惧缁勫垪琛�")
+ @ApiOperation("鍒嗛〉鏌ヨ璁惧缁勫垪琛�")
public Result<Page<DeviceGroupVO.GroupInfo>> getGroupList(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -146,7 +146,7 @@
* 鍚敤璁惧缁�
*/
@PostMapping("/enable")
- @Operation(summary = "鍚敤璁惧缁�", description = "鍚敤鎸囧畾璁惧缁�")
+ @ApiOperation("鍚敤璁惧缁�")
public Result<Void> enableGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -162,7 +162,7 @@
* 绂佺敤璁惧缁�
*/
@PostMapping("/disable")
- @Operation(summary = "绂佺敤璁惧缁�", description = "绂佺敤鎸囧畾璁惧缁�")
+ @ApiOperation("绂佺敤璁惧缁�")
public Result<Void> disableGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -178,7 +178,7 @@
* 鎵归噺鍚敤璁惧缁�
*/
@PostMapping("/batch-enable")
- @Operation(summary = "鎵归噺鍚敤璁惧缁�", description = "鎵归噺鍚敤鎸囧畾ID鍒楄〃鐨勮澶囩粍")
+ @ApiOperation("鎵归噺鍚敤璁惧缁�")
public Result<Void> batchEnableGroups(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -194,7 +194,7 @@
* 鎵归噺绂佺敤璁惧缁�
*/
@PostMapping("/batch-disable")
- @Operation(summary = "鎵归噺绂佺敤璁惧缁�", description = "鎵归噺绂佺敤鎸囧畾ID鍒楄〃鐨勮澶囩粍")
+ @ApiOperation("鎵归噺绂佺敤璁惧缁�")
public Result<Void> batchDisableGroups(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -210,7 +210,7 @@
* 鑾峰彇璁惧缁勭粺璁′俊鎭�
*/
@PostMapping("/statistics/groups")
- @Operation(summary = "鑾峰彇璁惧缁勭粺璁′俊鎭�", description = "鑾峰彇璁惧缁勭浉鍏崇殑缁熻淇℃伅")
+ @ApiOperation("鑾峰彇璁惧缁勭粺璁′俊鎭�")
public Result<StatisticsVO.GroupStatistics> getGroupStatistics(
@RequestBody(required = false) Map<String, Object> request) {
try {
@@ -227,7 +227,7 @@
* 妫�鏌ヨ澶囩粍缂栫爜鏄惁宸插瓨鍦�
*/
@PostMapping("/check-code")
- @Operation(summary = "妫�鏌ヨ澶囩粍缂栫爜", description = "妫�鏌ヨ澶囩粍缂栫爜鏄惁宸插瓨鍦�")
+ @ApiOperation("妫�鏌ヨ澶囩粍缂栫爜")
public Result<Boolean> checkGroupCodeExists(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -247,7 +247,7 @@
* 鑾峰彇璁惧缁勭被鍨嬪垪琛�
*/
@PostMapping("/types")
- @Operation(summary = "鑾峰彇璁惧缁勭被鍨嬪垪琛�", description = "鑾峰彇鎵�鏈夊彲鐢ㄧ殑璁惧缁勭被鍨�")
+ @ApiOperation("鑾峰彇璁惧缁勭被鍨嬪垪琛�")
public Result<List<String>> getGroupTypes() {
try {
List<String> groupTypes = deviceGroupConfigService.getAllGroupTypes();
@@ -262,7 +262,7 @@
* 鑾峰彇璁惧缁勭姸鎬佸垪琛�
*/
@PostMapping("/statuses")
- @Operation(summary = "鑾峰彇璁惧缁勭姸鎬佸垪琛�", description = "鑾峰彇鎵�鏈夊彲鐢ㄧ殑璁惧缁勭姸鎬�")
+ @ApiOperation("鑾峰彇璁惧缁勭姸鎬佸垪琛�")
public Result<List<String>> getGroupStatuses() {
try {
List<String> groupStatuses = deviceGroupConfigService.getAllGroupStatuses();
@@ -277,7 +277,7 @@
* 娣诲姞璁惧鍒拌澶囩粍
*/
@PostMapping("/devices")
- @Operation(summary = "娣诲姞璁惧鍒拌澶囩粍", description = "灏嗘寚瀹氳澶囨坊鍔犲埌璁惧缁勪腑")
+ @ApiOperation("娣诲姞璁惧鍒拌澶囩粍")
public Result<Void> addDeviceToGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -294,7 +294,7 @@
* 浠庤澶囩粍绉婚櫎璁惧
*/
@PostMapping("/devices/remove")
- @Operation(summary = "浠庤澶囩粍绉婚櫎璁惧", description = "浠庤澶囩粍涓Щ闄ゆ寚瀹氳澶�")
+ @ApiOperation("浠庤澶囩粍绉婚櫎璁惧")
public Result<Void> removeDeviceFromGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -310,7 +310,7 @@
* 鏇存柊璁惧瑙掕壊
*/
@PostMapping("/devices/role")
- @Operation(summary = "鏇存柊璁惧瑙掕壊", description = "鏇存柊璁惧鍦ㄨ澶囩粍涓殑瑙掕壊")
+ @ApiOperation("鏇存柊璁惧瑙掕壊")
public Result<Void> updateDeviceRole(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -327,7 +327,7 @@
* 鑾峰彇璁惧缁勮澶囧垪琛�
*/
@PostMapping("/devices/list")
- @Operation(summary = "鑾峰彇璁惧缁勮澶囧垪琛�", description = "鑾峰彇鎸囧畾璁惧缁勪笅鐨勬墍鏈夎澶�")
+ @ApiOperation("鑾峰彇璁惧缁勮澶囧垪琛�")
public Result<List<DeviceGroupVO.DeviceInfo>> getGroupDevices(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -343,7 +343,7 @@
* 鑾峰彇璁惧璁惧缁勫垪琛�
*/
@PostMapping("/devices/groups")
- @Operation(summary = "鑾峰彇璁惧璁惧缁勫垪琛�", description = "鑾峰彇鎸囧畾璁惧鎵�灞炵殑鎵�鏈夎澶囩粍")
+ @ApiOperation("鑾峰彇璁惧璁惧缁勫垪琛�")
public Result<List<DeviceGroupVO.GroupInfo>> getDeviceGroups(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -359,7 +359,7 @@
* 鎵归噺娣诲姞璁惧鍒拌澶囩粍
*/
@PostMapping("/batch-add-devices")
- @Operation(summary = "鎵归噺娣诲姞璁惧鍒拌澶囩粍", description = "鎵归噺灏嗘寚瀹氳澶囧垪琛ㄦ坊鍔犲埌璁惧缁勪腑")
+ @ApiOperation("鎵归噺娣诲姞璁惧鍒拌澶囩粍")
public Result<Void> batchAddDevicesToGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -375,7 +375,7 @@
* 鎵归噺浠庤澶囩粍绉婚櫎璁惧
*/
@PostMapping("/devices/batch-remove")
- @Operation(summary = "鎵归噺浠庤澶囩粍绉婚櫎璁惧", description = "鎵归噺浠庤澶囩粍涓Щ闄ゆ寚瀹氳澶囧垪琛�")
+ @ApiOperation("鎵归噺浠庤澶囩粍绉婚櫎璁惧")
public Result<Void> batchRemoveDevicesFromGroup(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -391,7 +391,7 @@
* 璁惧缁勫仴搴锋鏌�
*/
@PostMapping("/health-check")
- @Operation(summary = "璁惧缁勫仴搴锋鏌�", description = "瀵规寚瀹氳澶囩粍杩涜鍋ュ悍妫�鏌�")
+ @ApiOperation("璁惧缁勫仴搴锋鏌�")
public Result<DeviceGroupVO.HealthCheckResult> performGroupHealthCheck(
@Valid @RequestBody DeviceGroupRequest request) {
try {
@@ -407,7 +407,7 @@
* 鑾峰彇璁惧缁勬�ц兘缁熻
*/
@PostMapping("/performance")
- @Operation(summary = "鑾峰彇璁惧缁勬�ц兘缁熻", description = "鑾峰彇鎸囧畾璁惧缁勭殑鎬ц兘缁熻淇℃伅")
+ @ApiOperation("鑾峰彇璁惧缁勬�ц兘缁熻")
public Result<DeviceGroupVO.PerformanceStats> getGroupPerformance(
@Valid @RequestBody DeviceGroupRequest request) {
try {
--
Gitblit v1.8.0