update
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.wildfirechat.sdk;
|
||||
|
||||
import cn.wildfirechat.pojos.*;
|
||||
import cn.wildfirechat.sdk.model.*;
|
||||
|
||||
public class ChatAdmin {
|
||||
@@ -7,19 +8,20 @@ public class ChatAdmin {
|
||||
HttpUtils.init(url, secret);
|
||||
}
|
||||
|
||||
public static IMResult<User> getUserByName(String mobile) throws Exception {
|
||||
public static IMResult<InputOutputUserInfo> getUserByName(String mobile) throws Exception {
|
||||
String path = "/admin/user/info";
|
||||
UserName name = new UserName(mobile);
|
||||
return HttpUtils.httpJsonPost(path, name, User.class);
|
||||
InputGetUserInfo getUserInfo = new InputGetUserInfo(null, mobile);
|
||||
return HttpUtils.httpJsonPost(path, getUserInfo, InputOutputUserInfo.class);
|
||||
}
|
||||
|
||||
public static IMResult<UserId> createUser(User user) throws Exception {
|
||||
public static IMResult<OutputCreateUser> createUser(InputOutputUserInfo user) throws Exception {
|
||||
String path = "/admin/user/create";
|
||||
return HttpUtils.httpJsonPost(path, user, UserId.class);
|
||||
return HttpUtils.httpJsonPost(path, user, OutputCreateUser.class);
|
||||
}
|
||||
|
||||
public static IMResult<Token> getUserToken(String userId, String clientId) throws Exception {
|
||||
public static IMResult<OutputGetIMTokenData> getUserToken(String userId, String clientId) throws Exception {
|
||||
String path = "/admin/user/token";
|
||||
return HttpUtils.httpJsonPost(path, new GetTokenRequest(userId, clientId), Token.class);
|
||||
InputGetToken getToken = new InputGetToken(userId, clientId);
|
||||
return HttpUtils.httpJsonPost(path, getToken, OutputGetIMTokenData.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package cn.wildfirechat.sdk.model;
|
||||
|
||||
public class GetTokenRequest {
|
||||
private String userId;
|
||||
private String clientId;
|
||||
|
||||
public GetTokenRequest(String userId, String clientId) {
|
||||
this.userId = userId;
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.wildfirechat.sdk.model;
|
||||
|
||||
import common.cn.wildfirechat.ErrorCode;
|
||||
import cn.wildfirechat.common.ErrorCode;
|
||||
|
||||
public class IMResult<T> {
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package cn.wildfirechat.sdk.model;
|
||||
|
||||
public class Token {
|
||||
private String token;
|
||||
private String userId;
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
package cn.wildfirechat.sdk.model;
|
||||
|
||||
public class User {
|
||||
private String userId;
|
||||
private String name;
|
||||
private String password;
|
||||
private String displayName;
|
||||
private String portrait;
|
||||
private int gender;
|
||||
private String mobile;
|
||||
private String email;
|
||||
private String address;
|
||||
private String company;
|
||||
private String social;
|
||||
private String extra;
|
||||
private long updateDt;
|
||||
|
||||
public String getSocial() {
|
||||
return social;
|
||||
}
|
||||
|
||||
public void setSocial(String social) {
|
||||
this.social = social;
|
||||
}
|
||||
|
||||
public long getUpdateDt() {
|
||||
return updateDt;
|
||||
}
|
||||
|
||||
public void setUpdateDt(long updateDt) {
|
||||
this.updateDt = updateDt;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getPortrait() {
|
||||
return portrait;
|
||||
}
|
||||
|
||||
public void setPortrait(String portrait) {
|
||||
this.portrait = portrait;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getExtra() {
|
||||
return extra;
|
||||
}
|
||||
|
||||
public void setExtra(String extra) {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
public int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(int gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package cn.wildfirechat.sdk.model;
|
||||
|
||||
public class UserId {
|
||||
private String userId;
|
||||
|
||||
public UserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package cn.wildfirechat.sdk.model;
|
||||
|
||||
public class UserName {
|
||||
private String name;
|
||||
|
||||
public UserName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user