Skip to content

The Java SDK for OpenIM is a Java-based development kit designed to provide a convenient way to integrate OpenIM. OpenIM is an open source instant messaging solution that provides developers with a complete instant messaging development solution, covering both the server and the client.

License

Notifications You must be signed in to change notification settings

openim-sigs/openim-java-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openim-sdk

openim api java调用sdk 无spring版

目的:

  • 实现一套openim的java版sdk,方便java快速集成开发

参考

使用

  • 1 maven引入依赖包
<dependency>
    <groupId>cn.org.opendfl</groupId>
    <artifactId>openim-java-sdk</artifactId>
    <version>0.7-nospring</version>
</dependency>
  • 2 openim配置
openim:
  api: http://openim-web.host.fit
#  下面可以不配置,默认按以下规则生成
#  apiApi: http://openim-web.host.fit/api
#  apiChat: http://openim-web.host.fit/chat
#  apiAdmin: http://openim-web.host.fit/complete_admin
  secret: openIM123
  adminAccount: openIMAdmin
  adminPwd: openIMAdmin
  #预留功能,支持每个请求,自动带个header authKey参数
  authKey: authKey
  #是否校验请求参数
  requestParamValid: true
  • 3 调用示例
private OpenImService openImService = new OpenImService();
public void login(){
    String operationId = IdUtil.fastUUID();
    LoginReq loginReq = new LoginReq();
    loginReq.setAccount("openIMAdmin");
    loginReq.setPassword("de84e3477e4fcddc54c9bfbeac4aca2d");
    OpenImResult<AdminLoginResp> result = openImService.admin().user().login(loginReq, operationId);
}

public void getClientConfig() {
    OpenImResult<GetClientConfigResp> result = openImService.admin().clientConfig().getClientConfig(openImToken);
    System.out.println(JSONUtil.toJsonStr(result));
    TestCase.assertTrue(result.getErrMsg(), result.isOk());
}

About

The Java SDK for OpenIM is a Java-based development kit designed to provide a convenient way to integrate OpenIM. OpenIM is an open source instant messaging solution that provides developers with a complete instant messaging development solution, covering both the server and the client.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages