Commit 3b87b4a3 authored by xiaozhe.chen's avatar xiaozhe.chen

客服系统对接中台接口,用户修改、修改密码、修改账户状态

parent d26e35ce
......@@ -35,4 +35,18 @@ public interface IUserService extends UserDetailsService {
JsonResult findUserCombination(UserCombinationParam userCombinationParam);
/**
* 重置用户密码
* @param phoneNo
* @return
*/
String passwordRest(String phoneNo);
/**
* 注销账户
* @param userId
* @return
*/
String modifyAccountStatusDisable(Long userId);
}
......@@ -57,6 +57,10 @@ public class UserServiceImpl implements IUserService {
@Value("${passportapi2.http}")
private String userSysUrl;
@Value("${sidecar.http}")
private String sidecarUrl;
private final UserRepo userRepo;
private final IHttpService httpService;
......@@ -567,4 +571,38 @@ public class UserServiceImpl implements IUserService {
}
@Override
public String passwordRest(String phoneNo) {
String url = sidecarUrl + "/middle_office/middle_office/kefu/password/reset";
try {
Map<String, String> header = Maps.newHashMap();
header.put("Content-type", "application/x-www-form-urlencoded");
Map param = Maps.newHashMap();
param.put("phoneNo", phoneNo);
String result = httpService.post(url, header, param);
log.info("[user][passwordRest] 请求业务系统返回值:{}", result);
return result;
} catch (Exception e) {
log.error("[user][passwordRest] 网络通讯异常,phoneNo:{},ex:{}", phoneNo, ExceptionUtils.getStackTrace(e));
throw new BusinessException(ErrorCodeEnum.NET_ERROR);
}
}
@Override
public String modifyAccountStatusDisable(Long userId) {
String url = sidecarUrl + "/middle_office/middle_office/kefu/user/disable";
try {
Map<String, String> header = Maps.newHashMap();
header.put("Content-type", "application/x-www-form-urlencoded");
Map param = Maps.newHashMap();
param.put("userId", userId);
String result = httpService.post(url, header, param);
log.info("[user][modifyAccountStatus] 请求业务系统返回值:{}", result);
return result;
} catch (Exception e) {
log.error("[user][modifyAccountStatus] 网络通讯异常,userId:{},ex:{}", userId, ExceptionUtils.getStackTrace(e));
throw new BusinessException(ErrorCodeEnum.NET_ERROR);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment