Explorar o código

接口测试修改

hxd hai 4 meses
pai
achega
144816e626
Modificáronse 23 ficheiros con 246 adicións e 151 borrados
  1. 6 6
      portal-service-application/src/main/java/com/hfln/portal/application/controller/wap/DeviceController.java
  2. 3 3
      portal-service-application/src/main/java/com/hfln/portal/application/controller/wap/EventController.java
  3. 6 5
      portal-service-application/src/main/java/com/hfln/portal/application/controller/wap/GroupController.java
  4. 2 2
      portal-service-application/src/main/java/com/hfln/portal/application/controller/wap/ShareController.java
  5. 11 10
      portal-service-application/src/test/java/com/hfln/portal/application/controller/wap/DeviceControllerTest.java
  6. 2 2
      portal-service-application/src/test/java/com/hfln/portal/application/controller/wap/EventControllerTest.java
  7. 48 13
      portal-service-application/src/test/java/com/hfln/portal/application/controller/wap/GroupControllerTest.java
  8. 2 2
      portal-service-common/src/main/java/com/hfln/portal/common/dto/data/device/DeviceDTO.java
  9. 1 1
      portal-service-common/src/main/java/com/hfln/portal/common/request/device/DeviceBandingParams.java
  10. 2 1
      portal-service-common/src/main/java/com/hfln/portal/common/request/device/DeviceListParams.java
  11. 4 6
      portal-service-common/src/main/java/com/hfln/portal/common/request/device/DeviceLocationParams.java
  12. 1 1
      portal-service-common/src/main/java/com/hfln/portal/common/request/event/EventListParams.java
  13. 0 21
      portal-service-common/src/main/java/com/hfln/portal/common/request/group/GroupListParams.java
  14. 5 3
      portal-service-common/src/main/java/com/hfln/portal/common/request/group/GroupShareConfirmParams.java
  15. 10 3
      portal-service-common/src/main/java/com/hfln/portal/common/request/group/GroupShareHandleParams.java
  16. 2 0
      portal-service-domain/src/main/java/com/hfln/portal/domain/exception/ErrorEnum.java
  17. 3 3
      portal-service-domain/src/main/java/com/hfln/portal/domain/gateway/DeviceGateway.java
  18. 2 2
      portal-service-domain/src/main/java/com/hfln/portal/domain/gateway/GroupGateway.java
  19. 28 11
      portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/DeviceGatewayImpl.java
  20. 102 52
      portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/GroupGatewayImpl.java
  21. 4 2
      portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/UserGatewayImpl.java
  22. 1 1
      portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/po/GroupShare.java
  23. 1 1
      portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/service/impl/DevInfoServiceImpl.java

+ 6 - 6
portal-service-application/src/main/java/com/hfln/portal/application/controller/wap/DeviceController.java

@@ -39,8 +39,8 @@ public class DeviceController {
 
     @GetMapping("/deviceUnBind")
     @ApiOperation(value = "解绑设备")
-    public ApiResult<Boolean> deviceUnBind(@RequestParam("userId") Long userId, @RequestParam("clientId") String clientId) {
-        return ApiResult.success(deviceGateway.deviceUnBind(userId, clientId));
+    public ApiResult<Boolean> deviceUnBind(@RequestParam("userId") Long userId, @RequestParam("devId") String devId) {
+        return ApiResult.success(deviceGateway.deviceUnBind(userId, devId));
     }
 
     @PostMapping("/deviceBinding")
@@ -50,10 +50,10 @@ public class DeviceController {
     }
 
 
-    @GetMapping("/queryDeviceInfoById/{deviceId}")
+    @GetMapping("/queryDeviceInfoById/{devId}")
     @ApiOperation(value = "设备详情")
-    public ApiResult<DeviceDTO> queryDeviceInfoById(@PathVariable("deviceId") String deviceId) {
-        return ApiResult.success(deviceGateway.queryDeviceById(deviceId));
+    public ApiResult<DeviceDTO> queryDeviceInfoById(@PathVariable("devId") String devId) {
+        return ApiResult.success(deviceGateway.queryDeviceById(devId));
     }
 
     @GetMapping("/deviceRelations")
@@ -71,7 +71,7 @@ public class DeviceController {
     }
 
 
-    @GetMapping("/updateDeviceLocation")
+    @PostMapping("/updateDeviceLocation")
     @ApiOperation(value = "更新设备位置")
     public ApiResult<Boolean> updateDeviceLocation(@RequestBody @Valid DeviceLocationParams params) {
         return ApiResult.success(deviceGateway.updateDeviceLocation(params));

+ 3 - 3
portal-service-application/src/main/java/com/hfln/portal/application/controller/wap/EventController.java

@@ -31,10 +31,10 @@ public class EventController {
         return ApiResult.success(deviceGateway.queryEventByPage(request));
     }
 
-    @GetMapping("/handleEvent/{eventId}")
+    @GetMapping("/handleEvent/{eventListId}")
     @ApiOperation(value = "处理设备事件")
-    public ApiResult<Boolean> handleEvent(@PathVariable("eventId") Long eventId){
-        return ApiResult.success(deviceGateway.handleEvent(eventId));
+    public ApiResult<Boolean> handleEvent(@PathVariable("eventListId") Long eventListId){
+        return ApiResult.success(deviceGateway.handleEvent(eventListId));
     }
 
 

+ 6 - 5
portal-service-application/src/main/java/com/hfln/portal/application/controller/wap/GroupController.java

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
 import java.util.List;
 
 @RestController
@@ -33,7 +34,7 @@ public class GroupController {
     }
 
 
-    @DeleteMapping("/deleteGroup")
+    @PostMapping("/deleteGroup")
     @ApiOperation(value = "删除群组")
     public ApiResult<Boolean> deleteGroup(@RequestParam("group_id") Long groupId){
         return ApiResult.success(groupGateway.deleteGroup(groupId));
@@ -47,11 +48,11 @@ public class GroupController {
 
     @GetMapping("/groupLits")
     @ApiOperation(value = "获取群组列表")
-    public ApiResult<List<GroupDTO>> GroupList(@RequestBody @Valid GroupListParams request){
-        return ApiResult.success(groupGateway.queryGroupList(request));
+    public ApiResult<List<GroupDTO>> GroupList(@RequestParam(value = "user_id", required = true) @NotNull(message = "用户Id不能为空!") Long userId) {
+        return ApiResult.success(groupGateway.queryGroupList(userId));
     }
 
-    @GetMapping("/queryGroupById")
+    @GetMapping("/queryGroupDeviceInfoById")
     @ApiOperation(value = "获取群组设备列表")
     public ApiResult<List<DeviceDTO>> queryGroupById(@RequestParam("group_id") Long groupId){
         return ApiResult.success(groupGateway.queryGroupDeviceInfoById(groupId));
@@ -64,7 +65,7 @@ public class GroupController {
         return ApiResult.success(groupGateway.addDeviceToGroup(request));
     }
 
-    @DeleteMapping("/deleteDeviceFromGroup")
+    @PostMapping("/deleteDeviceFromGroup")
     @ApiOperation(value = "删除设备从群组")
     public ApiResult<Boolean> deleteDeviceFromGroup(@RequestBody @Valid DeleteDeviceFromGroupParams request){
         return ApiResult.success(groupGateway.deleteDeviceFromGroup(request));

+ 2 - 2
portal-service-application/src/main/java/com/hfln/portal/application/controller/wap/ShareController.java

@@ -32,7 +32,7 @@ public class ShareController {
         return ApiResult.success(deviceGateway.devShare(shareParam));
     }
 
-    @GetMapping("/shareByUrl")
+    @PostMapping("/shareByUrl")
     @ApiOperation(value = "通过链接分享设备")
     public ApiResult<Void> shareByUrl(@Valid @RequestBody ShareParam shareParam) {
         deviceGateway.shareByUrl(shareParam);
@@ -45,7 +45,7 @@ public class ShareController {
         return ApiResult.success(deviceGateway.queryDevShare(userId));
     }
 
-    @GetMapping("/shareConfirm")
+    @PostMapping("/shareConfirm")
     @ApiOperation(value = "设备分享确认")
     public ApiResult<Void> shareConfirm(@Valid @RequestBody ShareConfirmParam shareConfirmParam) {
         deviceGateway.shareConfirm(shareConfirmParam);

+ 11 - 10
portal-service-application/src/test/java/com/hfln/portal/application/controller/wap/DeviceControllerTest.java

@@ -30,6 +30,7 @@ class DeviceControllerTest {
     private static final String TEST_CLIENT_ID = "test_client_id";
     private static final String TEST_DEVICE_ID = "123456";
     private static final Long TEST_USER_ID = 1L;
+    private static final Long TEST_DEV_ID = 2L;
     
     @Mock
     private DeviceGateway deviceGateway;
@@ -47,7 +48,7 @@ class DeviceControllerTest {
         
         List<DeviceDTO> expectedDevices = new ArrayList<>();
         DeviceDTO device = new DeviceDTO();
-        device.setDevId(TEST_DEVICE_ID);
+        device.setDevId(TEST_DEV_ID);
         device.setUserId(TEST_USER_ID);
         expectedDevices.add(device);
         
@@ -132,7 +133,7 @@ class DeviceControllerTest {
         // 准备测试数据
         DeviceBandingParams request = new DeviceBandingParams();
         request.setUserId(TEST_USER_ID);
-        request.setDevId(TEST_CLIENT_ID);
+        request.setClientId(TEST_CLIENT_ID);
         request.setDevName("测试设备");
         
         // 模拟Gateway行为
@@ -154,7 +155,7 @@ class DeviceControllerTest {
         // 准备测试数据
         DeviceBandingParams request = new DeviceBandingParams();
         request.setUserId(TEST_USER_ID);
-        request.setDevId(TEST_CLIENT_ID);
+        request.setClientId(TEST_CLIENT_ID);
         request.setDevName("测试设备");
         
         // 模拟Gateway行为
@@ -176,7 +177,7 @@ class DeviceControllerTest {
         // 准备测试数据
         String deviceId = TEST_DEVICE_ID;
         DeviceDTO expectedDevice = new DeviceDTO();
-        expectedDevice.setDevId(deviceId);
+        expectedDevice.setDevId(TEST_DEV_ID);
         expectedDevice.setDevName("测试设备");
         expectedDevice.setUserId(TEST_USER_ID);
         
@@ -228,7 +229,7 @@ class DeviceControllerTest {
         // 准备测试数据
         DeviceBandingParams request = new DeviceBandingParams();
         request.setUserId(TEST_USER_ID);
-        request.setDevId(TEST_CLIENT_ID);
+        request.setClientId(TEST_CLIENT_ID);
         request.setDevName("更新后的设备名称");
         
         // 模拟Gateway行为
@@ -250,7 +251,7 @@ class DeviceControllerTest {
         // 准备测试数据
         DeviceBandingParams request = new DeviceBandingParams();
         request.setUserId(TEST_USER_ID);
-        request.setDevId(TEST_CLIENT_ID);
+        request.setClientId(TEST_CLIENT_ID);
         request.setDevName("更新后的设备名称");
         
         // 模拟Gateway行为
@@ -271,9 +272,9 @@ class DeviceControllerTest {
     void updateDeviceLocation_Success() {
         // 准备测试数据
         DeviceLocationParams params = new DeviceLocationParams();
-        params.setDevId(TEST_DEVICE_ID);
+        params.setDevId(TEST_DEV_ID);
         params.setXValue(new BigDecimal("100.5"));
-        params.setYValue(200L);
+        params.setYValue(new BigDecimal("109.5"));
         
         // 模拟Gateway行为
         when(deviceGateway.updateDeviceLocation(params)).thenReturn(true);
@@ -293,9 +294,9 @@ class DeviceControllerTest {
     void updateDeviceLocation_Failed() {
         // 准备测试数据
         DeviceLocationParams params = new DeviceLocationParams();
-        params.setDevId(TEST_DEVICE_ID);
+        params.setDevId(TEST_DEV_ID);
         params.setXValue(new BigDecimal("100.5"));
-        params.setYValue(200L);
+        params.setYValue(new BigDecimal("109.5"));
         
         // 模拟Gateway行为
         when(deviceGateway.updateDeviceLocation(params)).thenReturn(false);

+ 2 - 2
portal-service-application/src/test/java/com/hfln/portal/application/controller/wap/EventControllerTest.java

@@ -37,7 +37,7 @@ class EventControllerTest {
     void deviceEventList_Success() {
         // 准备测试数据
         EventListParams request = new EventListParams();
-        request.setDeviceId(TEST_DEVICE_ID);
+        request.setDevId(TEST_DEVICE_ID);
         request.setStartTime(new Date());
         request.setEndTime(new Date());
         
@@ -76,7 +76,7 @@ class EventControllerTest {
     void deviceEventList_EmptyResult() {
         // 准备测试数据
         EventListParams request = new EventListParams();
-        request.setDeviceId(TEST_DEVICE_ID);
+        request.setDevId(TEST_DEVICE_ID);
         request.setStartTime(new Date());
         request.setEndTime(new Date());
         

+ 48 - 13
portal-service-application/src/test/java/com/hfln/portal/application/controller/wap/GroupControllerTest.java

@@ -19,8 +19,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.*;
 import static org.mockito.Mockito.*;
 
 @ExtendWith(MockitoExtension.class)
@@ -207,8 +206,7 @@ class GroupControllerTest {
     @Test
     void groupList_Success() {
         // 准备测试数据
-        GroupListParams request = new GroupListParams();
-        request.setUserId(TEST_USER_ID);
+        Long userId = TEST_USER_ID;
         
         List<GroupDTO> expectedGroups = new ArrayList<>();
         GroupDTO group = new GroupDTO();
@@ -221,13 +219,13 @@ class GroupControllerTest {
         expectedGroups.add(group);
         
         // 模拟Gateway行为
-        when(groupGateway.queryGroupList(request)).thenReturn(expectedGroups);
+        when(groupGateway.queryGroupList(userId)).thenReturn(expectedGroups);
         
         // 执行测试
-        ApiResult<List<GroupDTO>> result = groupController.GroupList(request);
+        ApiResult<List<GroupDTO>> result = groupController.GroupList(userId);
         
         // 验证交互
-        verify(groupGateway, times(1)).queryGroupList(request);
+        verify(groupGateway, times(1)).queryGroupList(userId);
         
         // 验证结果
         assertEquals(SUCCESS_CODE, ReflectionTestUtils.getField(result, "code"));
@@ -237,17 +235,32 @@ class GroupControllerTest {
     @Test
     void groupList_EmptyResult() {
         // 准备测试数据
-        GroupListParams request = new GroupListParams();
-        request.setUserId(TEST_USER_ID);
+        Long userId = TEST_USER_ID;
         
         // 模拟Gateway行为 - 返回空列表
-        when(groupGateway.queryGroupList(request)).thenReturn(Collections.emptyList());
+        when(groupGateway.queryGroupList(userId)).thenReturn(Collections.emptyList());
         
         // 执行测试
-        ApiResult<List<GroupDTO>> result = groupController.GroupList(request);
+        ApiResult<List<GroupDTO>> result = groupController.GroupList(userId);
         
         // 验证交互
-        verify(groupGateway, times(1)).queryGroupList(request);
+        verify(groupGateway, times(1)).queryGroupList(userId);
+        
+        // 验证结果
+        assertEquals(SUCCESS_CODE, ReflectionTestUtils.getField(result, "code"));
+        assertEquals(Collections.emptyList(), ReflectionTestUtils.getField(result, "data"));
+    }
+
+    @Test
+    void groupList_NullUserId() {
+        // 模拟Gateway行为 - 返回空列表
+        when(groupGateway.queryGroupList(null)).thenReturn(Collections.emptyList());
+        
+        // 执行测试
+        ApiResult<List<GroupDTO>> result = groupController.GroupList(null);
+        
+        // 验证交互
+        verify(groupGateway, times(1)).queryGroupList(null);
         
         // 验证结果
         assertEquals(SUCCESS_CODE, ReflectionTestUtils.getField(result, "code"));
@@ -262,7 +275,7 @@ class GroupControllerTest {
         
         List<DeviceDTO> expectedDevices = new ArrayList<>();
         DeviceDTO device = new DeviceDTO();
-        device.setDevId("1");
+        device.setDevId(TEST_DEVICE_ID);
         device.setDevName("测试设备");
         expectedDevices.add(device);
         
@@ -528,6 +541,28 @@ class GroupControllerTest {
         verify(groupGateway, times(1)).groupShareConfirm(request);
     }
 
+    @Test
+    void groupShareConfirm_NullUserId() {
+        // 准备测试数据
+        GroupShareConfirmParams request = new GroupShareConfirmParams();
+        request.setSharedUserId(null);
+        request.setSharedPhone("13800138000");
+        request.setUuid(TEST_GROUP_UUID);
+        
+        // 模拟Gateway行为
+        when(groupGateway.groupShareConfirm(request)).thenReturn(false);
+        
+        // 执行测试
+        ApiResult<Boolean> result = groupController.GroupShareConfirm(request);
+        
+        // 验证交互
+        verify(groupGateway, times(1)).groupShareConfirm(request);
+        
+        // 验证结果
+        assertEquals(SUCCESS_CODE, ReflectionTestUtils.getField(result, "code"));
+        assertEquals(false, ReflectionTestUtils.getField(result, "data"));
+    }
+
     // ========== 群组分享处理相关测试 ==========
     @Test
     void groupShareHandle_Success() {

+ 2 - 2
portal-service-common/src/main/java/com/hfln/portal/common/dto/data/device/DeviceDTO.java

@@ -15,13 +15,13 @@ public class DeviceDTO extends BaseVO {
      * 主键ID
      */
     @ApiModelProperty("主键ID")
-    private Long devInfoId;
+    private Long devId;
 
     /**
      * 设备ID
      */
     @ApiModelProperty("设备ID")
-    private String devId;
+    private String clientId;
 
     /**
      * 用户openid

+ 1 - 1
portal-service-common/src/main/java/com/hfln/portal/common/request/device/DeviceBandingParams.java

@@ -17,7 +17,7 @@ public class DeviceBandingParams extends BaseVO {
 
     @NotEmpty(message = "设备Id不能为空")
     @ApiModelProperty(value = "设备ID",required = true)
-    private String devId;
+    private String clientId;
 
     @NotNull(message = "用户Id不能为空")
     @ApiModelProperty(value = "用户Id",required = true)

+ 2 - 1
portal-service-common/src/main/java/com/hfln/portal/common/request/device/DeviceListParams.java

@@ -7,13 +7,14 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
 
 @EqualsAndHashCode(callSuper = true)
 @Data
 @ApiModel(description = "设备列表查询")
 public class DeviceListParams extends BaseVO {
 
-    @NotEmpty(message = "用户Id不能为空!")
+    @NotNull(message = "用户Id不能为空!")
     @ApiModelProperty(value = "用户Id",required = true)
     private Long userId;
 

+ 4 - 6
portal-service-common/src/main/java/com/hfln/portal/common/request/device/DeviceLocationParams.java

@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 
 @EqualsAndHashCode(callSuper = true)
@@ -14,15 +14,13 @@ import java.math.BigDecimal;
 @ApiModel(description = "设备位置更新")
 public class DeviceLocationParams extends BaseVO {
 
-
-
-    @NotEmpty(message = "设备Id不能为空!")
+    @NotNull(message = "设备Id不能为空!")
     @ApiModelProperty(value = "设备表Id",required = true)
-    private String devId;
+    private Long devId;
 
     @ApiModelProperty(value = "X坐标")
     private BigDecimal xValue;
 
     @ApiModelProperty(value = "Y坐标")
-    private Long yValue;
+    private BigDecimal yValue;
 }

+ 1 - 1
portal-service-common/src/main/java/com/hfln/portal/common/request/event/EventListParams.java

@@ -16,7 +16,7 @@ public class EventListParams extends PageVo {
 
     @NotEmpty(message = "设备ID不能为空!")
     @ApiModelProperty(value = "设备ID",required = true)
-    private String deviceId;
+    private String devId;
 
     @ApiModelProperty(value = "开始时间",required = true)
     private Date startTime;

+ 0 - 21
portal-service-common/src/main/java/com/hfln/portal/common/request/group/GroupListParams.java

@@ -1,21 +0,0 @@
-package com.hfln.portal.common.request.group;
-
-import com.hfln.portal.common.vo.BaseVO;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import javax.validation.constraints.NotNull;
-
-@EqualsAndHashCode(callSuper = true)
-@Data
-@ApiModel(description = "群组列表查询")
-
-public class GroupListParams extends BaseVO {
-
-    @NotNull(message = "用户Id不能为空!")
-    @ApiModelProperty(value = "用户Id",required = true)
-    private Long userId;
-
-}

+ 5 - 3
portal-service-common/src/main/java/com/hfln/portal/common/request/group/GroupShareConfirmParams.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import org.springframework.validation.annotation.Validated;
 
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
@@ -12,10 +13,11 @@ import javax.validation.constraints.NotNull;
 @EqualsAndHashCode(callSuper = true)
 @Data
 @ApiModel(description = "群组分享确认")
+@Validated
 public class GroupShareConfirmParams extends BaseVO {
 
-    @NotNull(message = "被分享人userid不能为空")
-    @ApiModelProperty(value = "被分享人userid",required = true)
+    @NotNull(message = "被分享人shareUserId不能为空")
+    @ApiModelProperty(value = "被分享人shareUserId",required = true)
     private Long sharedUserId;
 
     @NotEmpty(message = "被分享人shared_phone不能为空")
@@ -25,4 +27,4 @@ public class GroupShareConfirmParams extends BaseVO {
     @NotEmpty(message = "分享群组uuid不能为空")
     @ApiModelProperty(value = "分享群组uuid",required = true)
     private String uuid;
-}
+    }

+ 10 - 3
portal-service-common/src/main/java/com/hfln/portal/common/request/group/GroupShareHandleParams.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import javax.validation.constraints.AssertTrue;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 
@@ -14,11 +15,17 @@ import javax.validation.constraints.NotNull;
 @ApiModel(description = "群组分享处理")
 public class GroupShareHandleParams extends BaseVO {
 
-    @NotNull(message = "状态标识不能为空")
-    @ApiModelProperty(value = "状态标识",required = true)
-    private Integer state;
 
     @NotEmpty(message = "共享群组uuid不能为空")
     @ApiModelProperty(value = "共享群组uuid",required = true)
     private String  uuid;
+
+    @NotNull(message = "分享状态不能为空")
+    @ApiModelProperty(value = "分享状态:0-待确认,1-已接收,2-已拒绝,3-已确认",required = true)
+    private Integer state;
+
+    @AssertTrue(message = "分享状态值无效")
+    private boolean isStateValid() {
+        return state != null && (state == 1 || state == 2 || state == 3);
+    }
 }

+ 2 - 0
portal-service-domain/src/main/java/com/hfln/portal/domain/exception/ErrorEnum.java

@@ -58,6 +58,8 @@ public enum ErrorEnum implements ErrorEnumInterface{
     GROUP_IS_NOT_EXIST("70002", "群组不存在!"),
     SHARE_IS_EXPIRED("70003", "分享已过期!"),
     SHARE_GROUP_IS_NOT_EXIST("70004", "共享群组不存在!"),
+    DEVICE_IS_NOT_EXIST_GROUP("70005", "设备未加入此群组!"),
+    SHARE_IS_HANDLED("70006", "分享已处理!"),
 
     /**
      * 设备房间相关

+ 3 - 3
portal-service-domain/src/main/java/com/hfln/portal/domain/gateway/DeviceGateway.java

@@ -27,15 +27,15 @@ public interface DeviceGateway {
 
     List<DeviceDTO> queryDeviceList(DeviceListParams request);
 
-    Boolean deviceUnBind(Long userId,String deviceId);
+    Boolean deviceUnBind(Long userId,String devId);
 
     Boolean deviceBind(DeviceBandingParams request);
 
-    DeviceDTO queryDeviceById(String deviceId);
+    DeviceDTO queryDeviceById(String devId);
 
     PageRecord<EventListDTO> queryEventByPage(EventListParams request);
 
-    Boolean handleEvent(Long eventId);
+    Boolean handleEvent(Long eventListId);
 
     Boolean updateDevice(DeviceBandingParams request);
 

+ 2 - 2
portal-service-domain/src/main/java/com/hfln/portal/domain/gateway/GroupGateway.java

@@ -10,11 +10,11 @@ public interface GroupGateway {
 
     Boolean addGroup(GroupAddParams request);
 
-    Boolean deleteGroup(Long GroupId);
+    Boolean deleteGroup(Long groupId);
 
     Boolean updateGroup(GroupUpdateParams params);
 
-    List<GroupDTO> queryGroupList(GroupListParams request);
+    List<GroupDTO> queryGroupList(Long userId);
 
     List<DeviceDTO> queryGroupDeviceInfoById(Long groupId);
 

+ 28 - 11
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/DeviceGatewayImpl.java

@@ -206,7 +206,7 @@ public class DeviceGatewayImpl implements DeviceGateway {
         // 1. 检查设备是否存在
         DevInfo devInfo = devInfoService.getOne(
                 Wrappers.<DevInfo>lambdaQuery()
-                        .eq(DevInfo::getDevId, request.getDevId())
+                        .eq(DevInfo::getClientId, request.getClientId())
         );
         if (Objects.isNull(devInfo)) {
             throw new BizException(ErrorEnum.DEVICE_IS_NOT_EXIST.getErrorCode(), ErrorEnum.DEVICE_IS_NOT_EXIST.getErrorMessage());
@@ -216,15 +216,15 @@ public class DeviceGatewayImpl implements DeviceGateway {
         }
 
         // 3. 更新设备信息
-        return devInfoService.updateDevice(devInfo.getDevId(), request);
+        return devInfoService.updateDevice(devInfo.getClientId(), request);
     }
 
 
     @Override
-    public DeviceDTO queryDeviceById(String deviceId) {
+    public DeviceDTO queryDeviceById(String devId) {
         DevInfo devInfo = devInfoService.getOne(
                 Wrappers.<DevInfo>lambdaQuery()
-                        .eq(DevInfo::getDevId, deviceId));
+                        .eq(DevInfo::getDevId, devId));
         if (Objects.isNull(devInfo)) {
             throw new BizException(ErrorEnum.DEVICE_IS_NOT_EXIST.getErrorCode(), ErrorEnum.DEVICE_IS_NOT_EXIST.getErrorMessage());
         }
@@ -240,7 +240,7 @@ public class DeviceGatewayImpl implements DeviceGateway {
         Integer pageSize = Optional.ofNullable(request.getPageNo()).orElse(10);
 
         // 执行分页查询
-        Page<EventList> eventPage = eventService.queryEventListByDevId(request.getDeviceId(),
+        Page<EventList> eventPage = eventService.queryEventListByDevId(request.getDevId(),
                 request.getStartTime(), request.getEndTime(), pageNo, pageSize);
         // 换为目标VO
         List<EventListDTO> targets = convertToTargetVO(eventPage.getRecords());
@@ -272,9 +272,9 @@ public class DeviceGatewayImpl implements DeviceGateway {
 
 
     @Override
-    public Boolean handleEvent(Long eventId) {
+    public Boolean handleEvent(Long eventListId) {
         LambdaUpdateWrapper<EventList> updateWrapper = new LambdaUpdateWrapper<>();
-        updateWrapper.eq(EventList::getEventListId, eventId)
+        updateWrapper.eq(EventList::getEventListId, eventListId)
                 .set(EventList::getIsHandle, 1);
         return this.eventService.update(updateWrapper);
     }
@@ -298,10 +298,10 @@ public class DeviceGatewayImpl implements DeviceGateway {
         setIfNull(request::getYEnd, () -> halfWidth, request::setYEnd);
 
 
-        Boolean flag = devInfoService.updateDevice(request.getDevId(), request);
+        Boolean flag = devInfoService.updateDevice(request.getClientId(), request);
         DevInfo devInfo = devInfoService.getOne(
                 Wrappers.<DevInfo>lambdaQuery()
-                        .eq(DevInfo::getDevId, request.getDevId()));
+                        .eq(DevInfo::getClientId, request.getClientId()));
 
         //检查parts.length >= 2确保数组有足够元素,提供默认值"2.0"
         String result = Optional.ofNullable(devInfo.getSoftware())
@@ -442,14 +442,30 @@ public class DeviceGatewayImpl implements DeviceGateway {
 
     @Override
     public Boolean shareByUrl(ShareParam shareParam) {
-
+        // 1. 验证是否存在未处理的分享
         DevShare notDealShare = devShareService.queryNotDeal(shareParam.getSharerUserId(), shareParam.getSharedUserId(), shareParam.getDevId());
         if (notDealShare != null) {
             throw new BizException(ErrorEnum.EXIST_NOT_DEAL_SHARE.getErrorCode(), ErrorEnum.EXIST_NOT_DEAL_SHARE.getErrorMessage());
         }
 
+        // 2. 验证是否存在已分享的记录
+        LambdaQueryWrapper<DevShare> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(DevShare::getDevId, shareParam.getDevId())
+                   .eq(DevShare::getSharerUserId, shareParam.getSharerUserId())
+                   .eq(DevShare::getSharedUserId, shareParam.getSharedUserId())
+                   .in(DevShare::getState, Arrays.asList(0, 1))
+                   .eq(DevShare::getIsDeleted, 0);
+        List<DevShare> existingShares = devShareService.list(queryWrapper);
+
+        if (existingShares != null && !existingShares.isEmpty()) {
+            throw new BizException(ErrorEnum.SHARE_IS_NOT_REPEAT.getErrorCode(), ErrorEnum.SHARE_IS_NOT_REPEAT.getErrorMessage());
+        }
+
+        // 3. 创建新的分享记录
         DevShare devShare = new DevShare();
         BeanUtils.copyProperties(shareParam, devShare);
+        
+        // 4. 如果分享人手机号为空,从用户信息中获取
         if (StringUtils.isEmpty(shareParam.getSharerPhone())) {
             UserInfo shareUser = userService.queryById(shareParam.getSharerUserId());
             if (shareUser == null) {
@@ -458,7 +474,8 @@ public class DeviceGatewayImpl implements DeviceGateway {
             devShare.setSharerPhone(shareUser.getPhone());
         }
 
-        devShare.setState(1);
+        // 5. 设置分享状态并保存
+        devShare.setState(0);
         devShareService.save(devShare);
         return true;
     }

+ 102 - 52
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/GroupGatewayImpl.java

@@ -38,12 +38,13 @@ public class GroupGatewayImpl implements GroupGateway {
 
     @Autowired
     private DevInfoService devInfoService;
-    
+
     @Autowired
     private GroupDevMapMapper groupDevMapMapper;
 
     /**
      * 添加群组
+     *
      * @param (groupName)群组名称 (userId)用户id
      * @return
      */
@@ -54,10 +55,10 @@ public class GroupGatewayImpl implements GroupGateway {
         DevGroup devGroup = new DevGroup();
         devGroup.setGroupName(request.getGroupName());
         devGroup.setUserId(request.getUserId());
-        if (Objects.isNull(request.getUserId())){
+        if (Objects.isNull(request.getUserId())) {
             throw new BizException(ErrorEnum.USER_IS_NOT_EXIST.getErrorCode(), ErrorEnum.USER_IS_NOT_EXIST.getErrorMessage());
         }
-        devGroup.setGroupUuid(UUID.randomUUID().toString());
+        devGroup.setGroupUuid(UUID.randomUUID().toString().replace("-", ""));
         devGroup.setIsDeleted(0);
         //2.把群组名称和UUID存储数据库
         // TODO mqtt消息 主题 /mps/add_group
@@ -66,29 +67,65 @@ public class GroupGatewayImpl implements GroupGateway {
     }
 
 
-
     /**
      * 删除群组
-     * @param  (groupId)  群组id
+     *
+     * @param (groupId) 群组id
      * @return
      */
     @Override
-    public Boolean deleteGroup(Long devGroupId) {
+    public Boolean deleteGroup(Long groupId) {
+        //TODO  MQTT消息  主题 /mps/delete_group
         //1.查询群组信息
-        DevGroup devGroup = devGroupService.getById(devGroupId);
-        if (Objects.isNull(devGroup)){
+        DevGroup devGroup = devGroupService.getById(groupId);
+        if (Objects.isNull(devGroup)) {
             throw new BizException(ErrorEnum.GROUP_IS_NOT_EXIST.getErrorCode(), ErrorEnum.GROUP_IS_NOT_EXIST.getErrorMessage());
         }
-        //2.删除群组信息
-        devGroup.setIsDeleted(1);
 
-        //3.TODO  MQTT消息  主题 /mps/delete_group
-        return devGroupService.updateById(devGroup);
+        try {
+            //2.删除群组信息
+            devGroup.setIsDeleted(1);
+            boolean updateGroupResult = devGroupService.updateById(devGroup);
+            if (!updateGroupResult) {
+                log.error("删除群组失败, groupID: {}", groupId);
+                throw new BizException(ErrorEnum.ERROR_BIZ_FAIL.getErrorCode(), "删除群组失败");
+            }
+
+            //3.删除群组设备映射关系
+            LambdaUpdateWrapper<GroupDevMap> devMapUpdateWrapper = Wrappers.<GroupDevMap>lambdaUpdate()
+                    .eq(GroupDevMap::getGroupId, groupId)
+                    .eq(GroupDevMap::getIsDeleted, 0) //只更新未删除记录
+                    .set(GroupDevMap::getIsDeleted, 1);
+            int devMapUpdateCount = groupDevMapMapper.update(null, devMapUpdateWrapper);
+            if (devMapUpdateCount < 0) { //MyBatis-Plus在更新失败时返回-1
+                log.error("映射关系表删除失败, groupId: {}", groupId);
+                throw new BizException(ErrorEnum.ERROR_BIZ_FAIL.getErrorCode(), "删除群组设备映射关系失败");
+            }
+
+            //4.删除群组分享记录
+            LambdaUpdateWrapper<GroupShare> shareUpdateWrapper = Wrappers.<GroupShare>lambdaUpdate()
+                    .eq(GroupShare::getGroupUuid, devGroup.getGroupUuid())
+                    .eq(GroupShare::getIsDeleted, 0)
+                    .set(GroupShare::getIsDeleted, 1);
+            boolean shareUpdateResult = groupShareService.update(shareUpdateWrapper);
+            if (!shareUpdateResult) {
+                log.error("删除群组分享记录失败, groupUuid: {}", devGroup.getGroupUuid());
+                throw new BizException(ErrorEnum.ERROR_BIZ_FAIL.getErrorCode(), "删除群组分享记录失败");
+            }
+
+            return true;
+        } catch (BizException e) {
+            throw e; //业务异常直接抛出
+        } catch (Exception e) {
+            log.error("删除群组过程中发生异常, groupId: {}, error: {}", groupId, e.getMessage(), e);
+            throw new BizException(ErrorEnum.ERROR_BIZ_FAIL.getErrorCode(), "删除群组失败");
+        }
     }
 
     /**
      * 更新群组
-     * @param (群组Uuid)groupUuid  (群组名称)groupName (长度)length     (宽度)width  (北向夹角)northAngle
+     *
+     * @param (群组Uuid)groupUuid (群组名称)groupName (长度)length     (宽度)width  (北向夹角)northAngle
      * @return
      */
     @Override
@@ -114,16 +151,16 @@ public class GroupGatewayImpl implements GroupGateway {
             updateWrapper.set(DevGroup::getLength, params.getLength());
             hasUpdate = true;
         }
-        if (Objects.nonNull(params.getWidth())){
+        if (Objects.nonNull(params.getWidth())) {
             updateWrapper.set(DevGroup::getWidth, params.getWidth());
             hasUpdate = true;
         }
-        if (Objects.nonNull(params.getNorthAngle())){
+        if (Objects.nonNull(params.getNorthAngle())) {
             updateWrapper.set(DevGroup::getNorthAngle, params.getNorthAngle());
             hasUpdate = true;
         }
         // 如果所有字段均为空,无需更新
-        if (!hasUpdate){
+        if (!hasUpdate) {
             return false;
         }
         return devGroupService.update(updateWrapper);
@@ -132,16 +169,17 @@ public class GroupGatewayImpl implements GroupGateway {
 
     /**
      * 获取群组列表
+     *
      * @param (用户id)userId
      * @return
      */
     @Override
-    public List<GroupDTO> queryGroupList(GroupListParams request) {
+    public List<GroupDTO> queryGroupList(Long userId) {
         // 1. 查询被分享群组
-        List<String> groupUUids = groupShareService.queryGroupUUidByUserId(request.getUserId());
+        List<String> groupUUids = groupShareService.queryGroupUUidByUserId(userId);
 
         // 2. 获取用户自己创建的群组和被分享的群组
-        List<DevGroup> devGroups = devGroupService.queryGroupByUserId(request.getUserId(), groupUUids);
+        List<DevGroup> devGroups = devGroupService.queryGroupByUserId(userId, groupUUids);
 
         // 3. 将群组信息转化为DTO
         List<GroupDTO> groupDTOs = new ArrayList<>();
@@ -184,6 +222,7 @@ public class GroupGatewayImpl implements GroupGateway {
 
     /**
      * 获取群组中设备列表
+     *
      * @param (群组id)groupId
      * @return
      */
@@ -201,7 +240,7 @@ public class GroupGatewayImpl implements GroupGateway {
 
         // 2. 查询设备并转换为DTO
         List<DevInfo> deviceList = queryDevicesByGroupUuid(devGroup.getGroupUuid());
-        
+
         // 3. 转换为DTO列表
         List<DeviceDTO> deviceDTOs = new ArrayList<>();
         for (DevInfo devInfo : deviceList) {
@@ -209,12 +248,13 @@ public class GroupGatewayImpl implements GroupGateway {
             BeanUtils.copyProperties(devInfo, dto);
             deviceDTOs.add(dto);
         }
-        
+
         return deviceDTOs;
     }
-    
+
     /**
      * 根据群组UUID查询设备列表(私有方法 不对外接口)
+     *
      * @param (groupUuid) 群组UUID
      * @return 设备列表
      */
@@ -222,7 +262,7 @@ public class GroupGatewayImpl implements GroupGateway {
         if (Objects.isNull(groupUuid)) {
             return Collections.emptyList();
         }
-        
+
         // 1. 查询群组设备映射表获取设备ID列表
         LambdaQueryWrapper<GroupDevMap> mapWrapper = new LambdaQueryWrapper<>();
         mapWrapper.eq(GroupDevMap::getGroupUuid, groupUuid);
@@ -246,6 +286,7 @@ public class GroupGatewayImpl implements GroupGateway {
 
     /**
      * 添加设备到群组
+     *
      * @param (设备ID)dev_id (群组ID) group_id
      * @return
      */
@@ -258,32 +299,32 @@ public class GroupGatewayImpl implements GroupGateway {
         if (Objects.isNull(devInfo)) {
             throw new BizException(ErrorEnum.DEVICE_IS_NOT_EXIST.getErrorCode(), ErrorEnum.DEVICE_IS_NOT_EXIST.getErrorMessage());
         }
-        
+
         DevGroup devGroup = devGroupService.getById(params.getGroupId());
         if (Objects.isNull(devGroup)) {
             throw new BizException(ErrorEnum.GROUP_IS_NOT_EXIST.getErrorCode(), ErrorEnum.GROUP_IS_NOT_EXIST.getErrorMessage());
         }
-        
+
         // 2. 检查设备是否已经添加到群组中
         LambdaQueryWrapper<GroupDevMap> queryWrapper = Wrappers.<GroupDevMap>lambdaQuery()
                 .eq(GroupDevMap::getDevId, devInfo.getClientId())
                 .eq(GroupDevMap::getGroupUuid, devGroup.getGroupUuid());
-        
+
         GroupDevMap groupDevMap = groupDevMapMapper.selectOne(queryWrapper);
-        
+
         // 3. 如果已存在记录
         if (Objects.nonNull(groupDevMap)) {
             // 检查是否已添加(is_delete为0)
             if (groupDevMap.getIsDeleted() == 0) {
                 throw new BizException(ErrorEnum.ERROR_BIZ_FAIL.getErrorCode(), "请勿重复添加设备");
-            } 
+            }
             // 如果是逻辑删除状态,恢复关系
             else {
                 groupDevMap.setIsDeleted(0);
                 return groupDevMapMapper.updateById(groupDevMap) > 0;
             }
         }
-        
+
         // 4. 不存在记录,创建新的映射关系
         GroupDevMap newMap = new GroupDevMap();
         newMap.setGroupId(params.getGroupId());
@@ -291,13 +332,14 @@ public class GroupGatewayImpl implements GroupGateway {
         newMap.setDevId(params.getDevId());
         newMap.setClientId(devInfo.getClientId());
         newMap.setIsDeleted(0);
-        
+
         return groupDevMapMapper.insert(newMap) > 0;
     }
 
 
     /**
      * 从群组中删除设备
+     *
      * @param (设备ID)dev_id (群组ID) group_id
      * @return
      */
@@ -308,23 +350,26 @@ public class GroupGatewayImpl implements GroupGateway {
                 .eq(GroupDevMap::getDevId, request.getDevId())
                 .eq(GroupDevMap::getGroupId, request.getGroupId())
                 .eq(GroupDevMap::getIsDeleted, 0);
-        
+
         GroupDevMap groupDevMap = groupDevMapMapper.selectOne(queryWrapper);
-        
+
         // 2. 如果关联关系不存在,返回错误
         if (Objects.isNull(groupDevMap)) {
-            throw new BizException(ErrorEnum.ERROR_BIZ_FAIL.getErrorCode(), "设备不在此群组中");
+            throw new BizException(ErrorEnum.DEVICE_IS_NOT_EXIST_GROUP.getErrorCode(), "设备未加入此群组");
         }
-        
-        // 3. 将关联关系标记为逻辑删除
-        groupDevMap.setIsDeleted(1);
-        
+
+        // 3. 创建更新条件
+        LambdaUpdateWrapper<GroupDevMap> updateWrapper = Wrappers.<GroupDevMap>lambdaUpdate()
+                .eq(GroupDevMap::getDevMapId, groupDevMap.getDevMapId())
+                .set(GroupDevMap::getIsDeleted, 1);
+
         // 4. 更新数据库并返回结果
-        return groupDevMapMapper.updateById(groupDevMap) > 0;
+        return groupDevMapMapper.update(null, updateWrapper) > 0;
     }
 
     /**
      * 分享群组
+     *
      * @param (群组uuid) groupUuid  (分享人userid)sharer  (分享人手机号)sharerPhone
      * @return 分享结果
      */
@@ -337,21 +382,24 @@ public class GroupGatewayImpl implements GroupGateway {
         if (Objects.isNull(devGroup)) {
             throw new BizException(ErrorEnum.GROUP_IS_NOT_EXIST.getErrorCode(), ErrorEnum.GROUP_IS_NOT_EXIST.getErrorMessage());
         }
-        
+
         // 2. 创建分享记录
         GroupShare groupShare = new GroupShare();
         // 设置群组UUID
         groupShare.setGroupUuid(request.getGroupUuid().toString());
         // 生成分享唯一标识
-        String shareUuid = UUID.randomUUID().toString();
+        String shareUuid = UUID.randomUUID().toString().replace("-", "");
         groupShare.setUuid(shareUuid);
         // 设置分享人信息
         groupShare.setSharerUserId(request.getSharerUserId());
         groupShare.setSharerPhone(request.getSharerPhone());
+        // 设置被分享人信息的默认值
+        groupShare.setSharedUserId(0L); // 设置默认值为0
+        groupShare.setSharedPhone(""); // 设置默认值为空字符串
         // 初始化其他字段
         groupShare.setState(0); // 初始状态为待确认
         groupShare.setIsDeleted(0); // 未删除
-        
+
         // 3. 保存分享记录
         boolean saveResult = groupShareService.save(groupShare);
         return saveResult;
@@ -359,7 +407,8 @@ public class GroupGatewayImpl implements GroupGateway {
 
     /**
      * 分享群组确认
-     * @param  (被分享人userid)shared  (被分享人shared_phone)sharedPhone
+     *
+     * @param (被分享人userid)sharedUserId (被分享人shared_phone)sharedPhone (状态)state
      * @return 确认结果
      */
     @Override
@@ -368,50 +417,51 @@ public class GroupGatewayImpl implements GroupGateway {
         LambdaQueryWrapper<GroupShare> queryWrapper = Wrappers.<GroupShare>lambdaQuery()
                 .eq(GroupShare::getUuid, request.getUuid())
                 .eq(GroupShare::getIsDeleted, 0);
-        
+
         GroupShare groupShare = groupShareService.getOne(queryWrapper);
-        
+
         // 如果记录不存在,返回异常
         if (Objects.isNull(groupShare)) {
             throw new BizException(ErrorEnum.SHARE_IS_EXPIRED.getErrorCode(), ErrorEnum.SHARE_IS_EXPIRED.getErrorMessage());
         }
-        
+
         // 2. 检查分享状态
         if (groupShare.getState() != 0) {
             throw new BizException(ErrorEnum.SHARE_IS_EXPIRED.getErrorCode(), ErrorEnum.SHARE_IS_EXPIRED.getErrorMessage());
         }
-        
+
         // 3. 更新分享记录
         groupShare.setState(3); // 更新状态为已确认
         groupShare.setSharedUserId(request.getSharedUserId()); // 设置被分享人ID
         groupShare.setSharedPhone(request.getSharedPhone()); // 设置被分享人手机号
-        
+
         // 4. 保存更新
         return groupShareService.updateById(groupShare);
     }
 
     /**
      * 群组分享处理
+     *
      * @param request 群组分享处理参数
      * @return 处理结果
      */
     @Override
-    public Boolean groupShareHandle(GroupShareHandleParams request){
+    public Boolean groupShareHandle(GroupShareHandleParams request) {
         // 1. 根据uuid查询分享记录
         LambdaQueryWrapper<GroupShare> queryWrapper = Wrappers.<GroupShare>lambdaQuery()
                 .eq(GroupShare::getUuid, request.getUuid())
                 .eq(GroupShare::getIsDeleted, 0);
-        
+
         GroupShare groupShare = groupShareService.getOne(queryWrapper);
-        
+
         // 如果记录不存在,返回异常
         if (Objects.isNull(groupShare)) {
             throw new BizException(ErrorEnum.SHARE_GROUP_IS_NOT_EXIST.getErrorCode(), ErrorEnum.SHARE_GROUP_IS_NOT_EXIST.getErrorMessage());
         }
-        
+
         // 2. 更新分享状态
         groupShare.setState(request.getState());
-        
+
         // 3. 保存更新
         return groupShareService.updateById(groupShare);
     }

+ 4 - 2
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/UserGatewayImpl.java

@@ -311,8 +311,10 @@ public class UserGatewayImpl implements UserGateway {
         }
         UserInfo info = new UserInfo();
         info.setUserId(request.getUserId());
-        info.setPassword(request.getNewPassword());
-        userService.updateById(userInfo);
+        // 使用 PasswordUtil.encrypt() 加密新密码
+        String encryptedPassword = PasswordUtil.encrypt(request.getNewPassword());
+        info.setPassword(encryptedPassword);
+        userService.updateById(info);
     }
 
     @Override

+ 1 - 1
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/po/GroupShare.java

@@ -52,7 +52,7 @@ public class GroupShare extends BasePO {
     /**
      * 被分享人手机号
      */
-    @TableField("share_phone")
+    @TableField("shared_phone")
     private String sharedPhone;
 
     /**

+ 1 - 1
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/service/impl/DevInfoServiceImpl.java

@@ -88,7 +88,7 @@ public class DevInfoServiceImpl extends ServiceImpl<DevInfoMapper, DevInfo> impl
 
         // 构建更新条件
         UpdateWrapperBuilder<DevInfo> builder = UpdateWrapperBuilder.<DevInfo>create()
-                .setIfNotNull(DevInfo::getDevId, request.getDevId())
+                .setIfNotNull(DevInfo::getClientId, request.getClientId())
                 .setIfNotNull(DevInfo::getUserId, request.getUserId())
                 .setIfNotBlank(DevInfo::getDevName, request.getDevName())
                 .setIfNotNull(DevInfo::getLength, request.getLength())