| | |
| | | package com.ruoyi.im.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.netease.nim.server.sdk.core.BizName; |
| | | import com.netease.nim.server.sdk.core.YunxinApiHttpClient; |
| | |
| | | UpdateUserInfoRequest requestBody = new UpdateUserInfoRequest(dto.getAvatar(), |
| | | dto.getName(),dto.getSign(),dto.getEmail(),dto.getMobile()); |
| | | String jsonBody = objectMapper.writeValueAsString(requestBody); |
| | | // String jsonBody = objectMapper.writeValueAsString(body); |
| | | httpPatch.setEntity(new StringEntity(jsonBody, StandardCharsets.UTF_8)); |
| | | |
| | | // 执行请求 |
| | |
| | | if (StringUtils.isNotBlank(vo.getSignature())) { |
| | | userAccount.setSignature(vo.getSignature()); |
| | | } |
| | | userAccount.setStatus(vo.getStatus()); |
| | | userAccount.setUpdateTime(new Date()); |
| | | userAccountService.updateById(userAccount); |
| | | }else{ |
| | |
| | | |
| | | // 创建构建器实例 |
| | | DynamicRequestBodyBuilder builder = new DynamicRequestBodyBuilder(); |
| | | if(null != vo.getStatus() && vo.getStatus() == 0){ |
| | | if(null != vo.getStatus() && vo.getStatus() == 1){ |
| | | builder.setEnabled(false); |
| | | builder.setNeedKick(true); |
| | | } |
| | | if(StringUtils.isNotEmpty(vo.getPassword())){ |
| | | }else if(StringUtils.isNotEmpty(vo.getPassword())){ |
| | | builder.setToken(vo.getPassword()); |
| | | } |
| | | // 只设置需要的字段 |
| | | String body = builder.build(); |
| | | String jsonBody = objectMapper.writeValueAsString(body); |
| | | String jsonBody = builder.build(); |
| | | httpPatch.setEntity(new StringEntity(jsonBody, StandardCharsets.UTF_8)); |
| | | |
| | | // 执行请求 |