feat: impl rest oncallback in export.go
This commit is contained in:
parent
eb65affba5
commit
0f78ceedd1
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"stdio.h": "c",
|
"ostream": "cpp",
|
||||||
"c_wrapper.h": "c"
|
"chrono": "cpp",
|
||||||
}
|
"thread": "cpp"
|
||||||
|
},
|
||||||
|
"C_Cpp.errorSquiggles": "disabled"
|
||||||
}
|
}
|
28
.vscode/tasks.json
vendored
Normal file
28
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "cppbuild",
|
||||||
|
"label": "C/C++: g++ build active file",
|
||||||
|
"command": "/usr/bin/g++",
|
||||||
|
"args": [
|
||||||
|
"-fdiagnostics-color=always",
|
||||||
|
"-g",
|
||||||
|
"${file}",
|
||||||
|
"-o",
|
||||||
|
"${fileDirname}/${fileBasenameNoExtension}"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${fileDirname}"
|
||||||
|
},
|
||||||
|
"problemMatcher": [
|
||||||
|
"$gcc"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"detail": "Task generated by Debugger."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2.0.0"
|
||||||
|
}
|
9
c_cpp_wrapper/build_so.sh
Executable file
9
c_cpp_wrapper/build_so.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rm ./openimsdk.so ./openimsdk.h
|
||||||
|
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o openimsdk.so export.go constant.go protocol.go tools.go
|
||||||
|
|
||||||
|
|
||||||
|
# build cpp sdk
|
||||||
|
# rm ./openimsdkcc.so
|
||||||
|
# g++ -fPIC -shared -o openimsdkcc.so openimsdkcc.cc ./openimsdk.so
|
@ -159,8 +159,7 @@ func (b BatchMessageCallback) OnRecvNewMessages(messageList string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b BatchMessageCallback) OnRecvOfflineNewMessages(messageList string) {
|
func (b BatchMessageCallback) OnRecvOfflineNewMessages(messageList string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(b.cCallback, RECV_OFFLINE_NEW_MESSAGES, C.CString(messageList))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBatchMessageCallback(cCallback C.CB_I_S) *BatchMessageCallback {
|
func NewBatchMessageCallback(cCallback C.CB_I_S) *BatchMessageCallback {
|
||||||
@ -172,48 +171,39 @@ type FriendCallback struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnFriendApplicationAdded(friendApplication string) {
|
func (f FriendCallback) OnFriendApplicationAdded(friendApplication string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, FRIEND_APPLICATION_ADDED, C.CString(friendApplication))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnFriendApplicationDeleted(friendApplication string) {
|
func (f FriendCallback) OnFriendApplicationDeleted(friendApplication string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, FRIEND_APPLICATION_DELETED, C.CString(friendApplication))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnFriendApplicationAccepted(friendApplication string) {
|
func (f FriendCallback) OnFriendApplicationAccepted(friendApplication string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, FRIEND_APPLICATION_ACCEPTED, C.CString(friendApplication))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnFriendApplicationRejected(friendApplication string) {
|
func (f FriendCallback) OnFriendApplicationRejected(friendApplication string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, FRIEND_APPLICATION_REJECTED, C.CString(friendApplication))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnFriendAdded(friendInfo string) {
|
func (f FriendCallback) OnFriendAdded(friendInfo string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, FRIEND_ADDED, C.CString(friendInfo))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnFriendDeleted(friendInfo string) {
|
func (f FriendCallback) OnFriendDeleted(friendInfo string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, FRIEND_DELETED, C.CString(friendInfo))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnFriendInfoChanged(friendInfo string) {
|
func (f FriendCallback) OnFriendInfoChanged(friendInfo string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, FRIEND_INFO_CHANGED, C.CString(friendInfo))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnBlackAdded(blackInfo string) {
|
func (f FriendCallback) OnBlackAdded(blackInfo string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, BLACK_ADDED, C.CString(blackInfo))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FriendCallback) OnBlackDeleted(blackInfo string) {
|
func (f FriendCallback) OnBlackDeleted(blackInfo string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(f.cCallback, BLACK_DELETED, C.CString(blackInfo))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewFriendCallback(cCallback C.CB_I_S) *FriendCallback {
|
func NewFriendCallback(cCallback C.CB_I_S) *FriendCallback {
|
||||||
@ -230,7 +220,6 @@ func NewGroupCallback(cCallback C.CB_I_S) *GroupCallback {
|
|||||||
|
|
||||||
func (g GroupCallback) OnJoinedGroupAdded(groupInfo string) {
|
func (g GroupCallback) OnJoinedGroupAdded(groupInfo string) {
|
||||||
C.Call_CB_I_S(g.cCallback, JOINED_GROUP_ADDED, C.CString(groupInfo))
|
C.Call_CB_I_S(g.cCallback, JOINED_GROUP_ADDED, C.CString(groupInfo))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g GroupCallback) OnJoinedGroupDeleted(groupInfo string) {
|
func (g GroupCallback) OnJoinedGroupDeleted(groupInfo string) {
|
||||||
@ -278,8 +267,7 @@ type CustomBusinessCallback struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c CustomBusinessCallback) OnRecvCustomBusinessMessage(businessMessage string) {
|
func (c CustomBusinessCallback) OnRecvCustomBusinessMessage(businessMessage string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(c.cCallback, RECV_CUSTOM_BUSINESS_MESSAGE, C.CString(businessMessage))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCustomBusinessCallback(cCallback C.CB_I_S) *CustomBusinessCallback {
|
func NewCustomBusinessCallback(cCallback C.CB_I_S) *CustomBusinessCallback {
|
||||||
@ -291,13 +279,11 @@ type UserCallback struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u UserCallback) OnSelfInfoUpdated(userInfo string) {
|
func (u UserCallback) OnSelfInfoUpdated(userInfo string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(u.cCallback, SELF_INFO_UPDATED, C.CString(userInfo))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u UserCallback) OnUserStatusChanged(statusMap string) {
|
func (u UserCallback) OnUserStatusChanged(statusMap string) {
|
||||||
//TODO implement me
|
C.Call_CB_I_S(u.cCallback, USER_STATUS_CHANGED, C.CString(statusMap))
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserCallback(cCallback C.CB_I_S) *UserCallback {
|
func NewUserCallback(cCallback C.CB_I_S) *UserCallback {
|
283
c_cpp_wrapper/openimsdk.h
Normal file
283
c_cpp_wrapper/openimsdk.h
Normal file
@ -0,0 +1,283 @@
|
|||||||
|
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
||||||
|
|
||||||
|
/* package command-line-arguments */
|
||||||
|
|
||||||
|
|
||||||
|
#line 1 "cgo-builtin-export-prolog"
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
||||||
|
#define GO_CGO_EXPORT_PROLOGUE_H
|
||||||
|
|
||||||
|
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
||||||
|
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Start of preamble from import "C" comments. */
|
||||||
|
|
||||||
|
|
||||||
|
#line 3 "export.go"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
typedef void (*CB_S)(char *);
|
||||||
|
typedef void (*CB_I_S)(int,char *);
|
||||||
|
typedef void (*CB_S_I_S_S)(char *,int,char *,char *);
|
||||||
|
typedef void (*CB_S_I_S_S_I)(char *,int,char *,char *,int);
|
||||||
|
extern void Call_CB_S(CB_S func,char* data);
|
||||||
|
extern void Call_CB_I_S(CB_I_S func,int event,char* data);
|
||||||
|
extern void Call_CB_S_I_S_S(CB_S_I_S_S func,char *,int errCode,char* errMsg,char* data);
|
||||||
|
extern void Call_CB_S_I_S_S_I(CB_S_I_S_S_I func,char *,int errCode,char* errMsg,char* data,int progress);
|
||||||
|
extern CB_S DebugPrint;
|
||||||
|
|
||||||
|
|
||||||
|
#line 1 "cgo-generated-wrapper"
|
||||||
|
|
||||||
|
|
||||||
|
/* End of preamble from import "C" comments. */
|
||||||
|
|
||||||
|
|
||||||
|
/* Start of boilerplate cgo prologue. */
|
||||||
|
#line 1 "cgo-gcc-export-header-prolog"
|
||||||
|
|
||||||
|
#ifndef GO_CGO_PROLOGUE_H
|
||||||
|
#define GO_CGO_PROLOGUE_H
|
||||||
|
|
||||||
|
typedef signed char GoInt8;
|
||||||
|
typedef unsigned char GoUint8;
|
||||||
|
typedef short GoInt16;
|
||||||
|
typedef unsigned short GoUint16;
|
||||||
|
typedef int GoInt32;
|
||||||
|
typedef unsigned int GoUint32;
|
||||||
|
typedef long long GoInt64;
|
||||||
|
typedef unsigned long long GoUint64;
|
||||||
|
typedef GoInt64 GoInt;
|
||||||
|
typedef GoUint64 GoUint;
|
||||||
|
typedef size_t GoUintptr;
|
||||||
|
typedef float GoFloat32;
|
||||||
|
typedef double GoFloat64;
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#include <complex.h>
|
||||||
|
typedef _Fcomplex GoComplex64;
|
||||||
|
typedef _Dcomplex GoComplex128;
|
||||||
|
#else
|
||||||
|
typedef float _Complex GoComplex64;
|
||||||
|
typedef double _Complex GoComplex128;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
static assertion to make sure the file is being used on architecture
|
||||||
|
at least with matching size of GoInt.
|
||||||
|
*/
|
||||||
|
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
||||||
|
|
||||||
|
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
||||||
|
typedef _GoString_ GoString;
|
||||||
|
#endif
|
||||||
|
typedef void *GoMap;
|
||||||
|
typedef void *GoChan;
|
||||||
|
typedef struct { void *t; void *v; } GoInterface;
|
||||||
|
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* End of boilerplate cgo prologue. */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern void set_print(CB_S print);
|
||||||
|
extern void set_group_listener(CB_I_S cCallback);
|
||||||
|
extern void set_conversation_listener(CB_I_S cCallback);
|
||||||
|
extern void set_advanced_msg_listener(CB_I_S cCallback);
|
||||||
|
extern void set_batch_msg_listener(CB_I_S cCallback);
|
||||||
|
extern void set_user_listener(CB_I_S cCallback);
|
||||||
|
extern void set_friend_listener(CB_I_S cCallback);
|
||||||
|
extern void set_custom_business_listener(CB_I_S cCallback);
|
||||||
|
extern GoUint8 init_sdk(CB_I_S cCallback, char* operationID, char* config);
|
||||||
|
extern void un_init_sdk(char* operationID);
|
||||||
|
extern void login(CB_S_I_S_S cCallback, char* operationID, char* uid, char* token);
|
||||||
|
extern void logout(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern void network_status_changed(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern GoInt get_login_status(char* operationID);
|
||||||
|
extern char* get_login_user();
|
||||||
|
extern char* create_text_message(char* operationID, char* text);
|
||||||
|
extern char* create_advanced_text_message(char* operationID, char* text, char* messageEntityList);
|
||||||
|
extern char* create_text_at_message(char* operationID, char* text, char* atUserList, char* atUsersInfo, char* message);
|
||||||
|
extern char* create_location_message(char* operationID, char* description, double longitude, double latitude);
|
||||||
|
extern char* create_custom_message(char* operationID, char* data, char* extension, char* description);
|
||||||
|
extern char* create_quote_message(char* operationID, char* text, char* message);
|
||||||
|
extern char* create_advanced_quote_message(char* operationID, char* text, char* message, char* messageEntityList);
|
||||||
|
extern char* create_card_message(char* operationID, char* cardInfo);
|
||||||
|
extern char* create_video_message_from_full_path(char* operationID, char* videoFullPath, char* videoType, long long int duration, char* snapshotFullPath);
|
||||||
|
extern char* create_image_message_from_full_path(char* operationID, char* imageFullPath);
|
||||||
|
extern char* create_sound_message_from_full_path(char* operationID, char* soundPath, long long int duration);
|
||||||
|
extern char* create_file_message_from_full_path(char* operationID, char* fileFullPath, char* fileName);
|
||||||
|
extern char* create_image_message(char* operationID, char* imagePath);
|
||||||
|
extern char* create_image_message_by_url(char* operationID, char* sourcePicture, char* bigPicture, char* snapshotPicture);
|
||||||
|
extern char* create_sound_message_by_url(char* operationID, char* soundBaseInfo);
|
||||||
|
extern char* create_sound_message(char* operationID, char* soundPath, long long int duration);
|
||||||
|
extern char* create_video_message_by_url(char* operationID, char* videoBaseInfo);
|
||||||
|
extern char* create_video_message(char* operationID, char* videoPath, char* videoType, long long int duration, char* snapshotPath);
|
||||||
|
extern char* create_file_message_by_url(char* operationID, char* fileBaseInfo);
|
||||||
|
extern char* create_file_message(char* operationID, char* filePath, char* fileName);
|
||||||
|
extern char* create_merger_message(char* operationID, char* messageList, char* title, char* summaryList);
|
||||||
|
extern char* create_face_message(char* operationID, int index, char* data);
|
||||||
|
extern char* create_forward_message(char* operationID, char* m);
|
||||||
|
extern void get_all_conversation_list(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern void get_advanced_history_message_list(CB_S_I_S_S cCallback, char* operationID, char* getMessageOptions);
|
||||||
|
extern void send_message(CB_S_I_S_S_I cCallback, char* operationID, char* message, char* recvID, char* groupID, char* offlinePushInfo);
|
||||||
|
|
||||||
|
// =====================================================user===============================================
|
||||||
|
//
|
||||||
|
extern void get_users_info(CB_S_I_S_S cCallback, char* operationID, char* userIDs);
|
||||||
|
extern void get_users_info_from_srv(CB_S_I_S_S cCallback, char* operationID, char* userIDs);
|
||||||
|
extern void set_self_info(CB_S_I_S_S cCallback, char* operationID, char* userInfo);
|
||||||
|
extern void get_self_user_info(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern void update_msg_sender_info(CB_S_I_S_S cCallback, char* operationID, char* nickname, char* faceURL);
|
||||||
|
extern void subscribe_users_status(CB_S_I_S_S cCallback, char* operationID, char* userIDs);
|
||||||
|
extern void unsubscribe_users_status(CB_S_I_S_S cCallback, char* operationID, char* userIDs);
|
||||||
|
extern void get_subscribe_users_status(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern void get_user_status(CB_S_I_S_S cCallback, char* operationID, char* userIDs);
|
||||||
|
|
||||||
|
// =====================================================friend===============================================
|
||||||
|
//
|
||||||
|
extern void get_specified_friends_info(CB_S_I_S_S cCallback, char* operationID, char* userIDList);
|
||||||
|
extern void get_friend_list(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern void get_friend_list_page(CB_S_I_S_S cCallback, char* operationID, int offset, int count);
|
||||||
|
extern void search_friends(CB_S_I_S_S cCallback, char* operationID, char* searchParam);
|
||||||
|
extern void check_friend(CB_S_I_S_S cCallback, char* operationID, char* userIDList);
|
||||||
|
extern void add_friend(CB_S_I_S_S cCallback, char* operationID, char* userIDReqMsg);
|
||||||
|
extern void set_friend_remark(CB_S_I_S_S cCallback, char* operationID, char* userIDRemark);
|
||||||
|
extern void delete_friend(CB_S_I_S_S cCallback, char* operationID, char* friendUserID);
|
||||||
|
extern void get_friend_application_list_as_recipient(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern void get_friend_application_list_as_applicant(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern void accept_friend_application(CB_S_I_S_S cCallback, char* operationID, char* userIDHandleMsg);
|
||||||
|
extern void refuse_friend_application(CB_S_I_S_S cCallback, char* operationID, char* userIDHandleMsg);
|
||||||
|
extern void add_black(CB_S_I_S_S cCallback, char* operationID, char* blackUserID);
|
||||||
|
extern void get_black_list(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
extern void remove_black(CB_S_I_S_S cCallback, char* operationID, char* removeUserID);
|
||||||
|
|
||||||
|
// =====================================================group===============================================
|
||||||
|
// CreateGroup creates a group
|
||||||
|
//
|
||||||
|
extern void create_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupReqInfo);
|
||||||
|
|
||||||
|
// JoinGroup joins a group
|
||||||
|
//
|
||||||
|
extern void join_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cReqMsg, int cJoinSource);
|
||||||
|
|
||||||
|
// QuitGroup quits a group
|
||||||
|
//
|
||||||
|
extern void quit_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID);
|
||||||
|
|
||||||
|
// DismissGroup dismisses a group
|
||||||
|
//
|
||||||
|
extern void dismiss_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID);
|
||||||
|
|
||||||
|
// ChangeGroupMute changes the mute status of a group
|
||||||
|
//
|
||||||
|
extern void change_group_mute(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cIsMute);
|
||||||
|
|
||||||
|
// ChangeGroupMemberMute changes the mute status of a group member
|
||||||
|
//
|
||||||
|
extern void change_group_member_mute(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cUserID, int cMutedSeconds);
|
||||||
|
|
||||||
|
// SetGroupMemberRoleLevel sets the role level of a group member
|
||||||
|
//
|
||||||
|
extern void set_group_member_role_level(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cUserID, int cRoleLevel);
|
||||||
|
|
||||||
|
// SetGroupMemberInfo sets the information of a group member
|
||||||
|
//
|
||||||
|
extern void set_group_member_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupMemberInfo);
|
||||||
|
|
||||||
|
// GetJoinedGroupList retrieves the list of joined groups
|
||||||
|
//
|
||||||
|
extern void get_joined_group_list(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
|
||||||
|
// GetSpecifiedGroupsInfo retrieves the information of specified groups
|
||||||
|
//
|
||||||
|
extern void get_specified_groups_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupIDList);
|
||||||
|
|
||||||
|
// SearchGroups searches for groups
|
||||||
|
//
|
||||||
|
extern void search_groups(CB_S_I_S_S cCallback, char* operationID, char* cSearchParam);
|
||||||
|
|
||||||
|
// SetGroupInfo sets the information of a group
|
||||||
|
//
|
||||||
|
extern void set_group_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupInfo);
|
||||||
|
|
||||||
|
// SetGroupVerification sets the verification mode of a group
|
||||||
|
//
|
||||||
|
extern void set_group_verification(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cVerification);
|
||||||
|
|
||||||
|
// SetGroupLookMemberInfo sets the member information visibility of a group
|
||||||
|
//
|
||||||
|
extern void set_group_look_member_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cRule);
|
||||||
|
|
||||||
|
// SetGroupApplyMemberFriend sets the friend rule for group applicants
|
||||||
|
//
|
||||||
|
extern void set_group_apply_member_friend(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cRule);
|
||||||
|
|
||||||
|
// GetGroupMemberList retrieves the list of group members
|
||||||
|
//
|
||||||
|
extern void get_group_member_list(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cFilter, int cOffset, int cCount);
|
||||||
|
|
||||||
|
// GetGroupMemberOwnerAndAdmin retrieves the owner and admin members of a group
|
||||||
|
//
|
||||||
|
extern void get_group_member_owner_and_admin(CB_S_I_S_S cCallback, char* operationID, char* cGroupID);
|
||||||
|
|
||||||
|
// GetGroupMemberListByJoinTimeFilter retrieves the list of group members filtered by join time
|
||||||
|
//
|
||||||
|
extern void get_group_member_list_by_join_time_filter(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cOffset, int cCount, long long int cJoinTimeBegin, long long int cJoinTimeEnd, char* cFilterUserIDList);
|
||||||
|
|
||||||
|
// GetSpecifiedGroupMembersInfo retrieves the information of specified group members
|
||||||
|
//
|
||||||
|
extern void get_specified_group_members_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cUserIDList);
|
||||||
|
|
||||||
|
// KickGroupMember kicks group members
|
||||||
|
//
|
||||||
|
extern void kick_group_member(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cReason, char* cUserIDList);
|
||||||
|
|
||||||
|
// TransferGroupOwner transfers the ownership of a group
|
||||||
|
//
|
||||||
|
extern void transfer_group_owner(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cNewOwnerUserID);
|
||||||
|
|
||||||
|
// InviteUserToGroup invites users to a group
|
||||||
|
//
|
||||||
|
extern void invite_user_to_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cReason, char* cUserIDList);
|
||||||
|
|
||||||
|
// GetGroupApplicationListAsRecipient retrieves the group application list as a recipient
|
||||||
|
//
|
||||||
|
extern void get_group_application_list_as_recipient(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
|
||||||
|
// GetGroupApplicationListAsApplicant retrieves the group application list as an applicant
|
||||||
|
//
|
||||||
|
extern void get_group_application_list_as_applicant(CB_S_I_S_S cCallback, char* operationID);
|
||||||
|
|
||||||
|
// AcceptGroupApplication accepts a group application
|
||||||
|
//
|
||||||
|
extern void accept_group_application(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cFromUserID, char* cHandleMsg);
|
||||||
|
|
||||||
|
// RefuseGroupApplication refuses a group application
|
||||||
|
//
|
||||||
|
extern void refuse_group_application(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cFromUserID, char* cHandleMsg);
|
||||||
|
|
||||||
|
// SetGroupMemberNickname sets the nickname of a group member
|
||||||
|
//
|
||||||
|
extern void set_group_member_nickname(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cUserID, char* cGroupMemberNickname);
|
||||||
|
|
||||||
|
// SearchGroupMembers searches for group members
|
||||||
|
//
|
||||||
|
extern void search_group_members(CB_S_I_S_S cCallback, char* operationID, char* cSearchParam);
|
||||||
|
|
||||||
|
// IsJoinGroup checks if the user has joined a group
|
||||||
|
//
|
||||||
|
extern void is_join_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
18
c_cpp_wrapper/run_test.sh
Executable file
18
c_cpp_wrapper/run_test.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
# if arg 1 is c,or is none,means test c sdk
|
||||||
|
# if arg 1 is cc,means test cpp sdk
|
||||||
|
|
||||||
|
rm ./test
|
||||||
|
if [ "$1" == "c" ] || [ "$1" == "" ]; then
|
||||||
|
echo "test c sdk"
|
||||||
|
gcc -o test ./test.c ./openimsdk.so
|
||||||
|
./test
|
||||||
|
exit 0
|
||||||
|
elif [ "$1" == "cc" ]; then
|
||||||
|
echo "test cpp sdk"
|
||||||
|
g++ -o test ./test.cc ./openimsdk.so ./openimsdkcc.so
|
||||||
|
./test
|
||||||
|
exit 0
|
||||||
|
fi
|
@ -38,11 +38,11 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
char operationID[] = "12345";
|
char operationID[] = "12345";
|
||||||
// char uid[] = "6959062403";
|
// char uid[] = "6959062403";
|
||||||
char uid[] = "4365007572";
|
char uid[] = "openIM123";
|
||||||
// char token[] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiI2OTU5MDYyNDAzIiwiUGxhdGZvcm1JRCI6MywiZXhwIjoxNzAwNzIwOTg0LCJuYmYiOjE2OTI5NDQ2ODQsImlhdCI6MTY5Mjk0NDk4NH0.8otKTFrOCs8_ueV10rNOD-rzHrCT_EN0obKS9q79bIc";
|
// char token[] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiI2OTU5MDYyNDAzIiwiUGxhdGZvcm1JRCI6MywiZXhwIjoxNzAwNzIwOTg0LCJuYmYiOjE2OTI5NDQ2ODQsImlhdCI6MTY5Mjk0NDk4NH0.8otKTFrOCs8_ueV10rNOD-rzHrCT_EN0obKS9q79bIc";
|
||||||
char token[] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiI0MzY1MDA3NTcyIiwiUGxhdGZvcm1JRCI6MiwiZXhwIjoxNzAyNjk4NTkzLCJuYmYiOjE2OTQ5MjIyOTMsImlhdCI6MTY5NDkyMjU5M30.2Bp8lMgIWXZdPp4J_BWGqJ14gQqiHxGiICxfxrgAq-A";
|
char token[] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySUQiOiJvcGVuSU0xMjMiLCJQbGF0Zm9ybUlEIjo2LCJleHAiOjE3MDkxMjQ2NzYsIm5iZiI6MTcwMTM0ODM3NiwiaWF0IjoxNzAxMzQ4Njc2fQ.EqlV5TlpiElYhUOHCEcSrZOWi9ldrUMR1L4q0blvxs0";
|
||||||
|
|
||||||
char *jsonString = "{\"platformID\": 2, \"apiAddr\": \"http://125.124.195.201:10002\", \"wsAddr\":\"ws://125.124.195.201:10001\",\"dataDir\": \"./\", \"logLevel\": 5, \"isLogStandardOutput\": true, \"logFilePath\": \"./\", \"isExternalExtensions\": true}";
|
char *jsonString = "{\"platformID\": 2, \"apiAddr\": \"http://14.29.168.56:10002\", \"wsAddr\":\"ws://14.29.168.56:10001\",\"dataDir\": \"./\", \"logLevel\": 5, \"isLogStandardOutput\": true, \"logFilePath\": \"./\", \"isExternalExtensions\": true}";
|
||||||
|
|
||||||
GoUint8 init_result;
|
GoUint8 init_result;
|
||||||
init_result = init_sdk(c_conn_callback,operationID, jsonString);
|
init_result = init_sdk(c_conn_callback,operationID, jsonString);
|
@ -13,10 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func parseBool(b int) bool {
|
func parseBool(b int) bool {
|
||||||
if b == 1 {
|
return !(b == 0)
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func StructToJsonString(param interface{}) string {
|
func StructToJsonString(param interface{}) string {
|
Loading…
x
Reference in New Issue
Block a user