qmj 1 неделя назад
Родитель
Сommit
9e4ba9b81b

+ 8 - 0
ruoyi-admin/src/main/java/com/ruoyi/app/user/InfoUserController.java

@@ -292,6 +292,7 @@ public class InfoUserController extends BaseController {
         user.setMycode(uuid.get8UUID());
         user.setStatus("0");
         user.setCid(userDTO.getCid());
+        user.setCidType(userDTO.getCidType());
         user.setDeviceToken(userDTO.getDeviceToken());
         user.setVoIPToken(userDTO.getVoIPToken());
         int result = infoUserService.insertInfoUser(user);
@@ -346,6 +347,7 @@ public class InfoUserController extends BaseController {
         user.setMycode(uuid.get8UUID());
         user.setStatus("0");
         user.setCid(userDTO.getCid());
+        user.setCidType(userDTO.getCidType());
         user.setDeviceToken(userDTO.getDeviceToken());
         user.setVoIPToken(userDTO.getVoIPToken());
         int result = infoUserService.insertInfoUser(user);
@@ -381,10 +383,12 @@ public class InfoUserController extends BaseController {
                     InfoUser info = new InfoUser();
                     info.setUserId(user.getUserId());
                     info.setCid(userDTO.getCid());
+                    info.setCidType(userDTO.getCidType());
                     info.setDeviceToken(userDTO.getDeviceToken());
                     info.setVoIPToken(userDTO.getVoIPToken());
                     infoUserService.saveOrUpdate(info);
                     user.setCid(userDTO.getCid());
+                    user.setCidType(userDTO.getCidType());
                     user.setDeviceToken(userDTO.getDeviceToken());
                     user.setVoIPToken(userDTO.getVoIPToken());
                 }
@@ -441,6 +445,7 @@ public class InfoUserController extends BaseController {
                 InfoUser info = new InfoUser();
                 info.setUserId(user.getUserId());
                 info.setCid(userDTO.getCid());
+                info.setCidType(userDTO.getCidType());
                 info.setDeviceToken(userDTO.getDeviceToken());
                 info.setVoIPToken(userDTO.getVoIPToken());
                 info.setOffline("0");
@@ -667,6 +672,7 @@ public class InfoUserController extends BaseController {
         user.setUserId(Long.valueOf(id));
         user.setUserType(infoUser.getUserType());
         user.setCid(infoUser.getCid());
+        user.setCidType(infoUser.getCidType());
         user.setDeviceToken(infoUser.getDeviceToken());
         user.setVoIPToken(infoUser.getVoIPToken());
         user.setNickName(infoUser.getNickName());
@@ -817,6 +823,7 @@ public class InfoUserController extends BaseController {
         info.setPhone(userDTO.getPhone());
         info.setNickName(userDTO.getPhone());
         info.setCid(userDTO.getCid());
+        info.setCidType(userDTO.getCidType());
         info.setDeviceToken(userDTO.getDeviceToken());
         info.setVoIPToken(userDTO.getVoIPToken());
         info.setUserType("0");
@@ -851,6 +858,7 @@ public class InfoUserController extends BaseController {
             throw new ServiceException(MessageUtils.message("no.user.not.exist"));
         }
         user.setCid(userDTO.getCid());
+        user.setCidType(userDTO.getCidType());
         user.setDeviceToken(userDTO.getDeviceToken());
         user.setVoIPToken(userDTO.getVoIPToken());
         infoUserService.saveOrUpdate(user);

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/InfoUser.java

@@ -84,6 +84,9 @@ public class InfoUser
     @Excel(name = "用户唯一标识")
     private String cid;
 
+    /** 设备类型(如 ios/android),区分设备类型 */
+    private String cidType;
+
     /** 我的邀请码 */
     @Excel(name = "我的邀请码")
     private String mycode;

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/UserDTO.java

@@ -11,6 +11,8 @@ public class UserDTO {
     private String newpassword;
     private String code;
     private String cid;
+    /** 设备类型(如 ios/android) */
+    private String cidType;
     /** 设备推送 token(普通推送):Android FCM / iOS APNs */
     private String deviceToken;
     /** iOS VoIP 来电推送 token */

+ 4 - 0
ruoyi-system/src/main/resources/mapper/infouser/InfoUserMapper.xml

@@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="status"    column="status"    />
         <result property="delFlag"    column="del_flag"    />
         <result property="cid"    column="cid"    />
+        <result property="cidType"    column="cid_type"    />
         <result property="mycode"    column="mycode"    />
         <result property="thiscode"    column="thiscode"    />
         <result property="commission"    column="commission"    />
@@ -95,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null and status != ''">status,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="cid != null">cid,</if>
+            <if test="cidType != null">cid_type,</if>
             <if test="mycode != null">mycode,</if>
             <if test="thiscode != null">thiscode,</if>
             <if test="commission != null">commission,</if>
@@ -128,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null and status != ''">#{status},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="cid != null">#{cid},</if>
+            <if test="cidType != null">#{cidType},</if>
             <if test="mycode != null">#{mycode},</if>
             <if test="thiscode != null">#{thiscode},</if>
             <if test="commission != null">#{commission},</if>
@@ -165,6 +168,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null and status != ''">status = #{status},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="cid != null">cid = #{cid},</if>
+            <if test="cidType != null">cid_type = #{cidType},</if>
             <if test="mycode != null">mycode = #{mycode},</if>
             <if test="thiscode != null">thiscode = #{thiscode},</if>
             <if test="commission != null">commission = #{commission},</if>

+ 6 - 0
updatesql/sql.md

@@ -339,3 +339,9 @@ ALTER TABLE info_user ADD COLUMN im_user_id BIGINT DEFAULT NULL COMMENT 'IM平
 ALTER TABLE info_user ADD COLUMN device_token VARCHAR(255) DEFAULT NULL COMMENT '设备推送token(普通推送:Android FCM / iOS APNs device token)';
 ALTER TABLE info_user ADD COLUMN voip_token VARCHAR(255) DEFAULT NULL COMMENT 'iOS VoIP推送token(PushKit,语音/视频来电推送)';
 ```
+
+```sql
+-- 2026-07-02 info_user 新增设备类型字段 cid_type(区分设备类型,如 ios/android,登录/注册时由客户端传入)
+ALTER TABLE info_user ADD COLUMN cid_type VARCHAR(32) DEFAULT NULL COMMENT '设备类型(ios/android等,区分设备类型)';
+```
+