Commit 49ecc9f4 by Shadow

fixed bug

parent 571c0cb2
......@@ -178,7 +178,7 @@ public class ImClientController extends BaseController {
@PostMapping("/registerClient")
@ApiOperation(value = "注册客户端")
ApiResult<RegisterClientResponse> registerClient(@RequestBody RegisterClientParam param) {
ApiResult<RegisterClientResponse> registerClient(@Validated @RequestBody RegisterClientParam param) {
Long clientId = imClientService.registerClient(param);
RegisterClientResponse response = new RegisterClientResponse();
response.setUserId(clientId);
......
......@@ -3,6 +3,7 @@ package com.wecloud.im.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
......@@ -17,9 +18,9 @@ public class RegisterClientParam {
/**
* app 用户id
*/
@NotNull(message = "用户id 不能为空")
@NotBlank(message = "用户id 不能为空")
@ApiModelProperty("用户id")
private Long userId;
private String userId;
/**
* 头像
......
......@@ -62,7 +62,7 @@ public class WecloudImUserOperation extends WecloudImOperation {
assertParameterNotNull(userId, "userId");
// 校验通过 构建参数
Map<String, Object> param = new HashMap<>();
param.put("clientId", registerClientRequest.getUserId() + "");
param.put("userId", registerClientRequest.getUserId() + "");
param.put("headPortrait", Optional.ofNullable(registerClientRequest.getHeadPortrait()).orElse(""));
param.put("nickname", Optional.ofNullable(registerClientRequest.getNickname()).orElse(""));
// 发送请求
......
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