Browse Source

修改来源地址

master
[yxf] 4 weeks ago
parent
commit
67500769c7
  1. 18
      im-platform/src/main/java/com/bx/implatform/entity/PlatformConfiguration.java
  2. 4
      im-platform/src/main/java/com/bx/implatform/entity/QuickReply.java
  3. 10
      im-platform/src/main/java/com/bx/implatform/mapper/PlatformConfigurationMapper.java
  4. 12
      im-platform/src/main/java/com/bx/implatform/service/PlatformConfigurationService.java
  5. 34
      im-platform/src/main/java/com/bx/implatform/service/impl/PlatformConfigurationServiceImpl.java
  6. 8
      im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java
  7. 2
      im-platform/src/main/java/com/bx/implatform/vo/UserVO.java
  8. 2
      im-web/src/components/chat/ChatBox.vue

18
im-platform/src/main/java/com/bx/implatform/entity/PlatformConfiguration.java

@ -0,0 +1,18 @@
package com.bx.implatform.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;
@Data
@TableName("im_platform_configuration")
public class PlatformConfiguration {
@TableId(type = IdType.AUTO)
private Long id;
private String platformName;
private String uniqueToken;
private String domainName;
}

4
im-platform/src/main/java/com/bx/implatform/entity/QuickReply.java

@ -17,8 +17,8 @@ public class QuickReply {
private String replyTitle; private String replyTitle;
private String replyContent; private String replyContent;
private String remark; private String remark;
private LocalDateTime createdTime; private Data createdTime;
private LocalDateTime updatedTime; private Data updatedTime;
private Long creatorId; private Long creatorId;
private Long updaterId; private Long updaterId;
} }

10
im-platform/src/main/java/com/bx/implatform/mapper/PlatformConfigurationMapper.java

@ -0,0 +1,10 @@
package com.bx.implatform.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bx.implatform.entity.PlatformConfiguration;
import com.bx.implatform.entity.QuickReply;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PlatformConfigurationMapper extends BaseMapper<PlatformConfiguration> {
}

12
im-platform/src/main/java/com/bx/implatform/service/PlatformConfigurationService.java

@ -0,0 +1,12 @@
package com.bx.implatform.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bx.implatform.entity.PlatformConfiguration;
public interface PlatformConfigurationService extends IService<PlatformConfiguration> {
/**
* 根据 sourceUrl 获取平台名称
*/
String getPlatformNameBySourceUrl(String sourceUrl);
}

34
im-platform/src/main/java/com/bx/implatform/service/impl/PlatformConfigurationServiceImpl.java

@ -0,0 +1,34 @@
package com.bx.implatform.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bx.implatform.entity.PlatformConfiguration;
import com.bx.implatform.mapper.PlatformConfigurationMapper;
import com.bx.implatform.service.PlatformConfigurationService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service
@RequiredArgsConstructor
public class PlatformConfigurationServiceImpl extends ServiceImpl<PlatformConfigurationMapper, PlatformConfiguration> implements PlatformConfigurationService {
@Override
public String getPlatformNameBySourceUrl(String sourceUrl) {
if (!StringUtils.hasText(sourceUrl)) {
return null;
}
LambdaQueryWrapper<PlatformConfiguration> wrapper = Wrappers.lambdaQuery();
wrapper.eq(PlatformConfiguration::getDomainName, sourceUrl);
PlatformConfiguration config = this.getOne(wrapper);
log.info("【测试】前端传的uniqueToken:{}",config );
return config != null ? config.getPlatformName() : null;
}
}

8
im-platform/src/main/java/com/bx/implatform/service/impl/UserServiceImpl.java

@ -58,6 +58,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
private final UserLabelService userLabelService; private final UserLabelService userLabelService;
private final PlatformConfigurationService PlatformConfigurationService;
private final ImAgentService imAgentService; private final ImAgentService imAgentService;
// @Override // @Override
@ -477,6 +479,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
vo.setGroupNames(groupNames); vo.setGroupNames(groupNames);
} }
if (StringUtils.hasText(user.getSourceUrl())) {
String platformName = PlatformConfigurationService.getPlatformNameBySourceUrl(user.getSourceUrl());
log.info("用户信息更新,用户:{}}", platformName);
vo.setPlatformName(platformName);
}
return vo; return vo;
} }

2
im-platform/src/main/java/com/bx/implatform/vo/UserVO.java

@ -78,4 +78,6 @@ public class UserVO {
// 修改为完整的UserGroup列表 // 修改为完整的UserGroup列表
private List<UserLabelVO> labelList; // 完整的分组信息列表 private List<UserLabelVO> labelList; // 完整的分组信息列表
private String platformName; // 新增:平台名称
} }

2
im-web/src/components/chat/ChatBox.vue

@ -73,7 +73,7 @@
</div> </div>
<div class="info-item"> <div class="info-item">
<div class="info-label">来源地址</div> <div class="info-label">来源地址</div>
<div class="info-value">{{ userInfo.sourceUrl }}</div> <div class="info-value">{{ userInfo.platformName }}</div>
</div> </div>
<div class="info-item"> <div class="info-item">
<div class="info-label">标签</div> <div class="info-label">标签</div>

Loading…
Cancel
Save