├── .gitignore
├── LICENSE
├── README.md
├── RongCloud.cs
├── RongCloudServerSDK.sln
├── ServerSDK.csproj
├── app.config
├── example
├── chatroom
│ ├── BanExample.cs
│ ├── BlockExample.cs
│ ├── ChatroomExample.cs
│ ├── DemotionExample.cs
│ ├── DistributeExample.cs
│ ├── GagExample.cs
│ ├── KeepaliveExample.cs
│ └── whitelist
│ │ ├── MessageExample.cs
│ │ └── UserExample.cs
├── conversation
│ └── ConversationExample.cs
├── group
│ ├── GagExample.cs
│ └── GroupExample.cs
├── messages
│ └── MessageExample.cs
├── push
│ └── PushExample.cs
├── sensitive
│ └── SensitiveExample.cs
└── user
│ ├── BlackListExample.cs
│ ├── BlockExample.cs
│ └── UserExample.cs
├── exception
├── Error.cs
├── ParamError.cs
├── ParamException.cs
└── RcloudException.cs
├── jsonsource
├── PushMessage.json
├── TemplateMessage.json
├── UserTag.json
├── broadcast
│ ├── api.json
│ └── verify.json
├── chatroom
│ ├── api.json
│ ├── block
│ │ └── api.json
│ ├── demotion
│ │ └── api.json
│ ├── distribute
│ │ └── api.json
│ ├── global-gag
│ │ └── api.json
│ ├── keepalive
│ │ └── api.json
│ ├── member-gag
│ │ └── api.json
│ ├── verify.json
│ └── whitelist
│ │ ├── message
│ │ └── api.json
│ │ └── user
│ │ └── api.json
├── conversation
│ ├── api.json
│ └── verify.json
├── group
│ ├── api.json
│ ├── gag
│ │ └── api.json
│ └── verify.json
├── message
│ ├── TemplateMessage.json
│ ├── _private
│ │ └── api.json
│ ├── api.json
│ ├── chatroom
│ │ └── api.json
│ ├── discussion
│ │ └── api.json
│ ├── group
│ │ └── api.json
│ ├── history
│ │ └── api.json
│ ├── recall
│ │ └── api.json
│ ├── system
│ │ └── api.json
│ └── verify.json
├── push
│ ├── api.json
│ └── verify.json
├── sensitiveword
│ ├── api.json
│ └── verify.json
└── user
│ ├── api.json
│ ├── blacklist
│ └── api.json
│ ├── block
│ └── api.json
│ ├── online-status
│ └── api.json
│ ├── tag
│ └── api.json
│ └── verify.json
├── messages
├── BaseMessage.cs
├── CmdMsgMessage.cs
├── CmdNtfMessage.cs
├── ContactNtfMessage.cs
├── CustomTxtMessage.cs
├── ImgMessage.cs
├── ImgTextMessage.cs
├── InfoNtfMessage.cs
├── LBSMessage.cs
├── ProfileNtfMessage.cs
├── TxtMessage.cs
└── VoiceMessage.cs
├── methods
├── chatroom
│ ├── Chatroom.cs
│ ├── ban
│ │ └── Ban.cs
│ ├── block
│ │ └── Block.cs
│ ├── demotion
│ │ └── Demotion.cs
│ ├── distribute
│ │ └── Distribute.cs
│ ├── gag
│ │ └── Gag.cs
│ ├── keepalive
│ │ └── Keepalive.cs
│ └── whitelist
│ │ ├── Messages.cs
│ │ ├── User.cs
│ │ └── Whitelist.cs
├── conversation
│ └── Conversation.cs
├── group
│ ├── Group.cs
│ └── gag
│ │ └── Gag.cs
├── message
│ ├── Message.cs
│ ├── _private
│ │ └── Private.cs
│ ├── chatroom
│ │ └── Chatroom.cs
│ ├── discussion
│ │ └── Discussion.cs
│ ├── group
│ │ └── Group.cs
│ ├── history
│ │ └── History.cs
│ └── system
│ │ └── MsgSystem.cs
├── push
│ ├── Broadcast.cs
│ └── Push.cs
├── sensitive
│ ├── SensitiveWord.cs
│ └── Wordfilter.cs
└── user
│ ├── User.cs
│ ├── blacklist
│ └── Blacklist.cs
│ ├── block
│ └── Block.cs
│ ├── onlineStatus
│ └── OnlineStatus.cs
│ └── tag
│ └── Tag.cs
├── models
├── BlockUsers.cs
├── CheckMethod.cs
├── Result.cs
├── Templates.cs
├── chatroom
│ ├── ChatroomMember.cs
│ └── ChatroomModel.cs
├── conversation
│ └── ConversationModel.cs
├── group
│ ├── GroupMember.cs
│ ├── GroupModel.cs
│ └── UserGroup.cs
├── message
│ ├── BroadcastMessage.cs
│ ├── ChatroomMessage.cs
│ ├── DiscussionMessage.cs
│ ├── GroupMessage.cs
│ ├── MentionMessage.cs
│ ├── MentionMessageContent.cs
│ ├── MentionedInfo.cs
│ ├── MessageModel.cs
│ ├── PrivateMessage.cs
│ ├── RecallMessage.cs
│ ├── SystemMessage.cs
│ └── TemplateMessage.cs
├── push
│ ├── Audience.cs
│ ├── BroadcastModel.cs
│ ├── BroadcastPushPublicPart.cs
│ ├── Message.cs
│ ├── Notification.cs
│ ├── PlatformNotification.cs
│ └── PushModel.cs
├── response
│ ├── BlackListResult.cs
│ ├── BlockUserList.cs
│ ├── BlockUserResult.cs
│ ├── ChatroomDemotionMsgResult.cs
│ ├── ChatroomKeepaliveResult.cs
│ ├── ChatroomQueryResult.cs
│ ├── ChatroomUserQueryResult.cs
│ ├── ChatroomWhitelistMsgResult.cs
│ ├── CheckChatRoomUserResult.cs
│ ├── CheckOnlineResult.cs
│ ├── GagGroupUser.cs
│ ├── GroupUser.cs
│ ├── GroupUserQueryResult.cs
│ ├── HistoryMessageResult.cs
│ ├── ListBlockChatroomUserResult.cs
│ ├── ListGagChatroomUserResult.cs
│ ├── ListGagGroupUserResult.cs
│ ├── ListWordfilterResult.cs
│ ├── PushResult.cs
│ ├── ResponseResult.cs
│ ├── TagListResult.cs
│ ├── TokenResult.cs
│ ├── UserList.cs
│ └── WhiteListResult.cs
├── sensitiveword
│ └── SensitiveWordModel.cs
└── user
│ ├── BlockUser.cs
│ ├── UserModel.cs
│ └── tag
│ └── TagModel.cs
├── packages.config
├── packages
└── Newtonsoft.Json.9.0.1
│ ├── Newtonsoft.Json.9.0.1.nupkg
│ ├── lib
│ ├── net20
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net35
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net40
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── net45
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── netstandard1.0
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ ├── portable-net40+sl5+wp80+win8+wpa81
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ └── portable-net45+wp80+win8+wpa81
│ │ ├── Newtonsoft.Json.dll
│ │ └── Newtonsoft.Json.xml
│ └── tools
│ └── install.ps1
└── util
├── CodeUtil.cs
├── CommonUtil.cs
├── HostType.cs
├── RongHttpClient.cs
└── RongJsonUtil.cs
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 融云 Rong Cloud
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | server-sdk-dotnet
2 | =================
3 |
4 | Rong Cloud Server SDK in dotnet.
5 |
6 | 本项目已暂停维护,如您仍需使用,相关文档请查阅我们的官网。
7 |
8 | [融云官网](http://rongcloud.cn/downloads)
9 | ### 比你想象的更强大, 敬请期待更多精彩!
10 |
--------------------------------------------------------------------------------
/RongCloudServerSDK.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.106
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerSDK", "ServerSDK.csproj", "{8BCCEE67-2A37-4952-8D9B-9E413DA7A54A}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {8BCCEE67-2A37-4952-8D9B-9E413DA7A54A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {8BCCEE67-2A37-4952-8D9B-9E413DA7A54A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {8BCCEE67-2A37-4952-8D9B-9E413DA7A54A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {8BCCEE67-2A37-4952-8D9B-9E413DA7A54A}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {6911D6A1-5396-4C50-9C16-B6CD3309C6A1}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/example/chatroom/BanExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.response;
2 | using io.rong.methods.chatroom;
3 | using io.rong.methods.chatroom.ban;
4 | using io.rong.models.chatroom;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using Newtonsoft.Json;
12 | using io.rong.models.conversation;
13 |
14 | namespace io.rong.example.chatroom
15 | {
16 | public class BanExample
17 |
18 | {
19 | /**
20 | * 此处替换成您的appKey
21 | * */
22 | private static readonly String appKey = "kj7swf8okyqt2";
23 | /**
24 | * 此处替换成您的appSecret
25 | * */
26 | private static readonly String appSecret = "mFe3U1UClx4gx";
27 | /**
28 | * 自定义api地址C:\Users\rc\Downloads\server-sdk-dotnet-master\example\chatroom\BanExample.cs
29 | * */
30 | private static readonly String api = "http://api.cn.ronghub.com";
31 |
32 | static void Main(String[] args)
33 | {
34 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
35 | //自定义 api地址方式
36 | //RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
37 |
38 | Ban ban = rongCloud.Chatroom.ban;
39 |
40 | /**
41 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/ban.html#add
42 | * 添加聊天室全局禁言
43 | * */
44 | ChatroomMember[] members = {
45 | new ChatroomMember(){
46 | Id = "qawr34h"
47 | }, new ChatroomMember() {
48 | Id = "qawr35h"
49 | } };
50 | ChatroomModel chatroom = new ChatroomModel()
51 | {
52 | Members = members,
53 | Minute = 5
54 | };
55 |
56 | ResponseResult result = ban.Add(chatroom);
57 | Console.WriteLine("addGagUser: " + result.ToString());
58 |
59 | /**
60 | *
61 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/ban.html#getList
62 | * 获取聊天时全局禁言列表
63 | */
64 |
65 | ListGagChatroomUserResult chatroomListGagUserResult = ban.GetList();
66 | Console.WriteLine("ListGagUser: " + chatroomListGagUserResult.ToString());
67 |
68 | /**
69 | *
70 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/ban.html#remove
71 | * 删除聊天时全局禁言
72 | */
73 | chatroom = new ChatroomModel()
74 | {
75 | Members = members
76 | };
77 | ResponseResult removeResult = ban.Remove(chatroom);
78 | Console.WriteLine("removeBanUser: " + removeResult.ToString());
79 | Console.ReadLine();
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/example/chatroom/BlockExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.response;
2 | using io.rong.methods.chatroom;
3 | using io.rong.methods.chatroom.block;
4 | using io.rong.models.chatroom;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using Newtonsoft.Json;
12 | using io.rong.models.conversation;
13 |
14 | namespace io.rong.example.chatroom
15 | {
16 | public class BlockExample
17 |
18 | {
19 | /**
20 | * 此处替换成您的appKey
21 | * */
22 | private static readonly String appKey = "kj7swf8okyqt2";
23 | /**
24 | * 此处替换成您的appSecret
25 | * */
26 | private static readonly String appSecret = "mFe3U1UClx4gx";
27 | /**
28 | * 自定义api地址
29 | * */
30 | private static readonly String api = "http://api.cn.ronghub.com";
31 |
32 |
33 | static void Main(String[] args)
34 | {
35 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
36 | //自定义 api地址方式
37 | //RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
38 |
39 | Block block = rongCloud.Chatroom.block;
40 |
41 | ChatroomMember[] members = {
42 | new ChatroomMember(){ Id = "qawr34h"},new ChatroomMember(){ Id = "qawr35h"}
43 | };
44 | /**
45 | *API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/block.html#add
46 | *
47 | * 添加封禁聊天室成员方法
48 | */
49 |
50 |
51 | ChatroomModel chatroom = new ChatroomModel()
52 | {
53 | Id = "d7ec7a8b8d8546c98b0973417209a548",
54 | Members = members,
55 | Minute = 5
56 | };
57 |
58 | ResponseResult result = block.Add(chatroom);
59 | Console.WriteLine("addBlockUser: " + result.ToString());
60 |
61 |
62 | /**
63 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/block.html#remove
64 | *
65 | * 移除封禁聊天室成员方法
66 | */
67 | chatroom = new ChatroomModel()
68 | {
69 | Id = "d7ec7a8b8d8546c98b0973417209a548",
70 | Members = members
71 | };
72 |
73 | //ResponseResult removeResult = block.remove(chatroom);
74 | //Console.WriteLine("removeResult: " + removeResult.ToString());
75 |
76 | /**
77 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/block.html#getList
78 | *
79 | * 查询被封禁聊天室成员方法
80 | */
81 | ListBlockChatroomUserResult getResult = block.GetList("d7ec7a8b8d8546c98b0973417209a548");
82 | Console.WriteLine("getListBlockUser: " + getResult.ToString());
83 | Console.ReadLine();
84 | }
85 |
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/example/chatroom/DemotionExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.response;
2 | using io.rong.methods.chatroom;
3 | using io.rong.methods.chatroom.demotion;
4 | using io.rong.models.chatroom;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using Newtonsoft.Json;
12 | using io.rong.models.conversation;
13 |
14 | namespace io.rong.example.chatroom
15 | {
16 | public class DemotionExample
17 |
18 | {
19 | /**
20 | * 此处替换成您的appKey
21 | * */
22 | private static readonly String appKey = "kj7swf8okyqt2";
23 | /**
24 | * 此处替换成您的appSecret
25 | * */
26 | private static readonly String appSecret = "mFe3U1UClx4gx";
27 |
28 | /**
29 | * 自定义api地址
30 | * */
31 | private static readonly String api = "http://api.cn.ronghub.com";
32 |
33 |
34 | static void Main(String[] args)
35 | {
36 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
37 | //自定义 api地址方式
38 | //RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
39 |
40 | Demotion demotion = rongCloud.Chatroom.demotion;
41 |
42 | /**
43 | *
44 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/demotion.html#add
45 | * 添加应用内聊天室降级消息
46 | *
47 | * */
48 | String[] messageType = { "RC:VcMsg", "RC:ImgTextMsg", "RC:ImgMsg" };
49 | ResponseResult addResult = demotion.Add(messageType);
50 | Console.WriteLine("add demotion: " + addResult.ToString());
51 |
52 | /**
53 | *
54 | *API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/demotion.html#remove
55 | * 移除应用内聊天室降级消息
56 | *
57 | * */
58 | ResponseResult removeResult = demotion.Remove(messageType);
59 | Console.WriteLine("remove demotion: " + removeResult.ToString());
60 |
61 |
62 | /**
63 | *
64 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/demotion.html#getList
65 | * 添加聊天室消息优先级demo
66 | *
67 | * */
68 | ChatroomDemotionMsgResult demotionMsgResult = demotion.GetList();
69 | Console.WriteLine("get demotion: " + demotionMsgResult.ToString());
70 |
71 | Console.ReadLine();
72 |
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/example/chatroom/DistributeExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.response;
2 | using io.rong.methods.chatroom;
3 | using io.rong.methods.chatroom.distribute;
4 | using io.rong.models.chatroom;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using Newtonsoft.Json;
12 | using io.rong.models.conversation;
13 |
14 | namespace io.rong.example.chatroom
15 | {
16 | public class DistributeExample
17 |
18 | {
19 | /**
20 | * 此处替换成您的appKey
21 | * */
22 | private static readonly String appKey = "kj7swf8okyqt2";
23 | /**
24 | * 此处替换成您的appSecret
25 | * */
26 | private static readonly String appSecret = "mFe3U1UClx4gx";
27 |
28 | /**
29 | * 自定义api地址
30 | * */
31 | private static readonly String api = "http://api.cn.ronghub.com";
32 |
33 |
34 | static void Main(String[] args)
35 | {
36 |
37 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
38 | //自定义 api地址方式
39 | //RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
40 |
41 | Distribute distribute = rongCloud.Chatroom.distribute;
42 |
43 | /**
44 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/distribute.html#stop
45 | *
46 | * 聊天室消息停止分发
47 | *
48 | */
49 | ChatroomModel chatroomModel = new ChatroomModel()
50 | {
51 | Id = "d7ec7a8b8d8546c98b0973417209a548"
52 | };
53 | ResponseResult result = distribute.Stop(chatroomModel);
54 |
55 | Console.WriteLine("stopDistributionMessage: " + result.ToString());
56 |
57 | /**
58 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/distribute.html#resume
59 | *
60 | * 聊天室消息恢复分发方法(每秒钟限 100 次)
61 | */
62 | ResponseResult resumeResult = distribute.Resume(chatroomModel);
63 | Console.WriteLine("resumeDistributionMessage: " + resumeResult.ToString());
64 | Console.ReadLine();
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/example/chatroom/GagExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.response;
2 | using io.rong.methods.chatroom;
3 | using io.rong.methods.chatroom.gag;
4 | using io.rong.models.chatroom;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using Newtonsoft.Json;
12 | using io.rong.models.conversation;
13 |
14 | namespace io.rong.example.chatroom
15 | {
16 | public class GagExample
17 |
18 | {
19 | /**
20 | * 此处替换成您的appKey
21 | * */
22 | private static readonly String appKey = "appKey";
23 | /**
24 | * 此处替换成您的appSecret
25 | * */
26 | private static readonly String appSecret = "appSecret";
27 | /**
28 | * 自定义api地址
29 | * */
30 | private static readonly String api = "http://api.cn.ronghub.com";
31 |
32 |
33 | static void main(String[] args)
34 | {
35 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
36 | //自定义 api地址方式
37 | //RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
38 |
39 | Gag gag = rongCloud.Chatroom.gag;
40 |
41 | /**
42 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/gag.html#add
43 | * 添加禁言聊天室成员方法想(在 App 中如果不让某一用户在聊天室中发言时,可将此用户在聊天室中禁言,
44 | * 被禁言用户可以接收查看聊天室中用户聊天信息,但不能发送消息.)获取某用户的黑名单列表方法(每秒钟限 100 次)
45 | */
46 |
47 | ChatroomMember[] members = {
48 | new ChatroomMember() {
49 | Id = "qawr34h"
50 | },
51 | new ChatroomMember(){ Id = "qawr35h"}
52 | };
53 | ChatroomModel chatroom = new ChatroomModel()
54 | {
55 | Id = "hjhf07kk",
56 | Members = members,
57 | Minute = 5
58 | };
59 |
60 | ResponseResult result = gag.Add(chatroom);
61 | Console.WriteLine("addGagUser: " + result.ToString());
62 |
63 | /**
64 | *
65 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/gag.html#remove
66 | * 查询被禁言聊天室成员方法
67 | */
68 | chatroom = new ChatroomModel()
69 | {
70 | Id = "hjhf07kk"
71 | };
72 | ListGagChatroomUserResult chatroomListGagUserResult = gag.GetList(chatroom);
73 | Console.WriteLine("ListGagUser: " + chatroomListGagUserResult.ToString());
74 |
75 | /**
76 | *
77 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/gag.html#getList
78 | *
79 | * 移除禁言聊天室成员
80 | */
81 | chatroom = new ChatroomModel()
82 | {
83 | Id = "hjhf07kk",
84 | Members = members
85 | };
86 |
87 | ResponseResult removeResult = gag.Remove(chatroom);
88 | Console.WriteLine("rollbackGagUser: " + result.ToString());
89 |
90 | Console.ReadLine();
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/example/chatroom/KeepaliveExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.response;
2 | using io.rong.methods.chatroom;
3 | using io.rong.methods.chatroom.keepalive;
4 | using io.rong.models.chatroom;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using Newtonsoft.Json;
12 | using io.rong.models.conversation;
13 |
14 | namespace io.rong.example.chatroom
15 | {
16 | public class KeepaliveExample
17 |
18 | {
19 | /**
20 | * 此处替换成您的appKey
21 | * */
22 | private static readonly String appKey = "kj7swf8okyqt2";
23 | /**
24 | * 此处替换成您的appSecret
25 | * */
26 | private static readonly String appSecret = "mFe3U1UClx4gx";
27 | /**
28 | * 自定义api地址
29 | * */
30 | private static readonly String api = "http://api.cn.ronghub.com";
31 |
32 | static void Main(String[] args)
33 | {
34 |
35 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
36 | //自定义 api地址方式
37 | //RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
38 |
39 | Keepalive keepalive = rongCloud.Chatroom.keepalive;
40 |
41 | /**
42 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/keepalive.html#add
43 | *
44 | * 添加保活聊天室
45 | *
46 | **/
47 | ChatroomModel chatroom = new ChatroomModel()
48 | {
49 | Id = "d7ec7a8b8d8546c98b0973417209a548"
50 | };
51 | ResponseResult addResult = keepalive.Add(chatroom);
52 | Console.WriteLine("add keepalive result" + addResult.ToString());
53 |
54 | /**
55 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/keepalive.html#remove
56 | *
57 | * 删除保活聊天室
58 | *
59 | **/
60 | ResponseResult removeResult = keepalive.Remove(chatroom);
61 | Console.WriteLine("keepalive remove" + removeResult.ToString());
62 |
63 | /**
64 | *
65 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/keepalive.html#getList
66 | *
67 | * 获取保活聊天室
68 | *
69 | **/
70 | ChatroomKeepaliveResult result = keepalive.GetList();
71 |
72 | Console.WriteLine("keepalive getList" + result.ToString());
73 | Console.ReadLine();
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/example/chatroom/whitelist/MessageExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.response;
2 | using io.rong.methods.chatroom;
3 | using io.rong.methods.chatroom.whitelist;
4 | using io.rong.models.chatroom;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using Newtonsoft.Json;
12 | using io.rong.models.conversation;
13 |
14 | namespace io.rong.example.chatroom.whitelist
15 | {
16 | public class MessageExample
17 |
18 | {
19 | /**
20 | * 此处替换成您的appKey
21 | * */
22 | private static readonly String appKey = "kj7swf8okyqt2";
23 | /**
24 | * 此处替换成您的appSecret
25 | * */
26 | private static readonly String appSecret = "mFe3U1UClx4gx";
27 | /**
28 | * 自定义api地址
29 | * */
30 | private static readonly String api = "http://api.cn.ronghub.com";
31 |
32 | static void Main(String[] args)
33 | {
34 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
35 | //自定义 api地址方式
36 | //RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
37 |
38 | Whitelist whitelist = rongCloud.Chatroom.whiteList;
39 | String[] messageType = { "RC:VcMsg", "RC:ImgTextMsg", "RC:ImgMsg" };
40 |
41 | /**
42 | * API: 文档http://www.rongcloud.cn/docs/server_sdk_api/chatroom/whitelist/message.html#add
43 | * 添加聊天室全局禁言
44 | * */
45 |
46 | ResponseResult addResult = whitelist.Message.Add(messageType);
47 | Console.WriteLine("add whitelist: " + addResult.ToString());
48 | /**
49 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/whitelist/message.html#getList
50 | * 添加聊天室全局禁言
51 | * */
52 |
53 | ChatroomWhitelistMsgResult getResult = whitelist.Message.GetList();
54 | Console.WriteLine("get whitelist: " + getResult.ToString());
55 |
56 | /**
57 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/whitelist/message.html#remove
58 | * 添加聊天室全局禁言
59 | * */
60 |
61 | ResponseResult removeResult = whitelist.Message.Remove(messageType);
62 | Console.WriteLine("remove whitelist: " + addResult.ToString());
63 |
64 | Console.ReadLine();
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/example/chatroom/whitelist/UserExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.response;
2 | using io.rong.methods.chatroom;
3 | using io.rong.methods.chatroom.whitelist;
4 | using io.rong.models.chatroom;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using Newtonsoft.Json;
12 | using io.rong.models.conversation;
13 |
14 | namespace io.rong.example.chatroom.whitelist
15 | {
16 | public class UserExample
17 |
18 | {
19 | /**
20 | * 此处替换成您的appKey
21 | * */
22 | private static readonly String appKey = "kj7swf8okyqt2";
23 | /**
24 | * 此处替换成您的appSecret
25 | * */
26 | private static readonly String appSecret = "mFe3U1UClx4gx";
27 | /**
28 | * 自定义api地址
29 | * */
30 | private static readonly String api = "http://api.cn.ronghub.com";
31 |
32 | static void main(String[] args)
33 | {
34 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
35 | //自定义 api地址方式
36 | //RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
37 |
38 | Whitelist whitelist = rongCloud.Chatroom.whiteList;
39 |
40 | /**
41 | * API: 文档http://www.rongcloud.cn/docs/server_sdk_api/chatroom/whitelist/user.html#add
42 | * 添加聊天室用户白名单
43 | * */
44 | ChatroomMember[] members = {
45 | new ChatroomMember(){ Id = "qawr34h"},new ChatroomMember(){ Id = "qawr35h"}
46 | };
47 | ChatroomModel chatroom = new ChatroomModel()
48 | {
49 | Id = "d7ec7a8b8d8546c98b0973417209a548",
50 | Members = members
51 | };
52 |
53 | ResponseResult addResult = whitelist.User.Add(chatroom);
54 | Console.WriteLine("add whitelist: " + addResult.ToString());
55 |
56 | /**
57 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/whitelist/user.html#getList
58 | * 获取聊天室用户白名单
59 | * */
60 |
61 | WhiteListResult getResult = whitelist.User.GetList(chatroom);
62 | Console.WriteLine("get whitelist: " + getResult.ToString());
63 |
64 |
65 | /**
66 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/chatroom/whitelist/user.html#remove
67 | * 删除聊天室用户白名单
68 | * */
69 |
70 | ResponseResult removeResult = whitelist.User.Remove(chatroom);
71 | Console.WriteLine("remove whitelist: " + removeResult.ToString());
72 |
73 | Console.ReadLine();
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/example/conversation/ConversationExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.methods.conversation;
2 | using io.rong.models.conversation;
3 | using io.rong.models.response;
4 | using io.rong.util;
5 | using System;
6 |
7 | namespace io.rong.example.conversation
8 | {
9 | /**
10 | *
11 | * 会话示例
12 | * @author RongCloud
13 | *
14 | */
15 | public class ConversationExample
16 |
17 | {
18 | /**
19 | * 此处替换成您的appKey
20 | * */
21 | private static readonly String appKey = "appKey";
22 | /**
23 | * 此处替换成您的appSecret
24 | * */
25 | private static readonly String appSecret = "appSecret";
26 | /**
27 | * 自定义api地址
28 | * */
29 | private static readonly String api = "http://api.cn.ronghub.com";
30 |
31 | static void Main(String[] args)
32 | {
33 |
34 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
35 | //自定义 api 地址方式
36 | // RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
37 |
38 | Conversation Conversation = rongCloud.Conversation;
39 |
40 | ConversationModel conversation = new ConversationModel()
41 | {
42 | Type = CodeUtil.ConversationType.PRIVATE.Name,
43 | UserId = "uPj70HUrRSUk-ixtt7iIGc",
44 | TargetId = "Vu-oC0_LQ6kgPqltm_zYtI"
45 | };
46 |
47 | /**
48 | *
49 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/conversation/conversation.html#mute
50 | * 设置消息免打扰
51 | *
52 | */
53 | ResponseResult muteConversationResult = Conversation.Mute(conversation);
54 |
55 | Console.WriteLine("muteConversationResult: " + muteConversationResult.ToString());
56 |
57 | /**
58 | *
59 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/conversation/conversation.html#unmute
60 | * 解除消息免打扰
61 | *
62 | * */
63 | ResponseResult unMuteConversationResult = Conversation.UnMute(conversation);
64 |
65 | Console.WriteLine("unMuteConversationResult: " + unMuteConversationResult.ToString());
66 | Console.ReadLine();
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/example/group/GagExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.methods.group;
2 | using io.rong.methods.group.gap;
3 | using io.rong.models;
4 | using io.rong.models.group;
5 | using io.rong.models.response;
6 | using System;
7 |
8 | namespace io.rong.example.group
9 | {
10 | /**
11 | *
12 | * 群组禁言例子
13 | *
14 | */
15 | public class GagExample
16 |
17 | {
18 | /**
19 | * 此处替换成您的appKey
20 | * */
21 | private static readonly String appKey = "appKey";
22 | /**
23 | * 此处替换成您的appSecret
24 | * */
25 | private static readonly String appSecret = "appSecret";
26 | /**
27 | * 自定义api地址
28 | * */
29 | private static readonly String api = "http://api.cn.ronghub.com";
30 |
31 | /**
32 | * 本地调用测试
33 | *
34 | *
35 | * @throws Exception
36 | */
37 | static void Main(String[] args)
38 | {
39 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
40 | //自定义 api 地址方式
41 | // RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
42 |
43 | Gag gag = rongCloud.Group.Gag;
44 | Group Group = rongCloud.Group;
45 |
46 | /**
47 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/group/gag.html#add
48 | * 添加禁言群成员方法
49 | */
50 |
51 | GroupMember[] members = { new GroupMember() { Id = "Vu-oC0_LQ6kgPqltm_zYtI" }, new GroupMember() { Id = "uPj70HUrRSUk-ixtt7iIGc" } };
52 |
53 | GroupModel group = new GroupModel()
54 | {
55 | Id = "goupId1.NET",
56 | Members = members,
57 | Name = "groupName",
58 | Minute = 5
59 | };
60 |
61 | Result groupCreateResult = (Result)Group.Create(group);
62 | Console.WriteLine("group create result: " + groupCreateResult.ToString());
63 | Console.WriteLine("get group users:" + Group.Get(new GroupModel() { Id = "goupId1.NET" }).ToString());
64 |
65 |
66 | Result result = gag.Add(group);
67 | Console.WriteLine("group.gag.add: " + result.ToString());
68 |
69 | /**
70 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/group/gag.html#getList
71 | * 查询被禁言群成员
72 | */
73 | ListGagGroupUserResult groupLisGagUserResult = gag.GetList("goupId1.NET");
74 | Console.WriteLine("group.gag.getList: " + groupLisGagUserResult.ToString());
75 |
76 | /**
77 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/group/gag.html#remove
78 | * 移除禁言群成员
79 | */
80 | group = new GroupModel()
81 | {
82 | Id = "goupId1.NET",
83 | Members = members
84 | };
85 |
86 |
87 | Result groupRollBackGagUserResult = gag.Remove(group);
88 | Console.WriteLine("group.gag.remove: " + groupRollBackGagUserResult.ToString());
89 | Console.ReadLine();
90 |
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/example/push/PushExample.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using io.rong.models;
6 | using io.rong.models.response;
7 | using io.rong.models.push;
8 | using io.rong.util;
9 | using System.Web;
10 |
11 | namespace io.rong.example.push
12 | {
13 | public class PushExample
14 | {
15 | /**
16 | * 此处替换成您的appKey
17 | * */
18 | private static String appKey = "appKey";
19 | /**
20 | * 此处替换成您的appSecret
21 | * */
22 | private static String appSecret = "appSecret";
23 | /**
24 | * 自定义api地址
25 | * */
26 | private static String api = "http://api-cn.ronghub.com";
27 |
28 |
29 | public static void Main(String[] args)
30 | {
31 |
32 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
33 |
34 | /**
35 | *
36 | * API 文档:
37 | * https://www.rongcloud.cn/docs/push_service.html#broadcast
38 | *
39 | * 广播消息
40 | *
41 | **/
42 | BroadcastModel broadcast = new BroadcastModel();
43 | broadcast.SetFromuserid("fromuserid");
44 | broadcast.SetPlatform(new String[] { "ios", "android" });
45 | Audience audience = new Audience();
46 | audience.SetUserid(new String[] { "userid1", "userid2" });
47 | broadcast.SetAudience(audience);
48 | Message message = new Message();
49 | message.SetContent("this is message");
50 | message.SetObjectName("RC:TxtMsg");
51 | broadcast.SetMessage(message);
52 | Notification notification = new Notification();
53 | notification.SetAlert("this is broadcast");
54 | broadcast.SetNotification(notification);
55 | PushResult result = rongCloud.Broadcast.Send(broadcast);
56 |
57 | Console.WriteLine("broadcast: " + result.ToString());
58 |
59 |
60 | /**
61 | *
62 | * API 文档:
63 | * https://www.rongcloud.cn/docs/push_service.html#push
64 | *
65 | * 推送消息
66 | *
67 | **/
68 | PushModel pushmodel = new PushModel();
69 | pushmodel.SetPlatform(new String[] { "ios", "android" });
70 | audience = new Audience();
71 | audience.SetUserid(new String[] { "userid1", "userid2" });
72 | pushmodel.SetAudience(audience);
73 | notification = new Notification();
74 | notification.SetAlert("this is push");
75 | pushmodel.SetNotification(notification);
76 | result = rongCloud.Push.Send(pushmodel);
77 |
78 | Console.WriteLine("push: " + result.ToString());
79 |
80 | Console.ReadLine();
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/example/user/BlackListExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.methods.user.blacklist;
2 | using io.rong.models;
3 | using io.rong.models.response;
4 | using io.rong.models.push;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 |
10 | namespace io.rong.example.user
11 | {
12 | public class BlackListExample
13 |
14 | {
15 | /**
16 | * 此处替换成您的appKey
17 | * */
18 | private static readonly String appKey = "pwe86ga5pwrj6";
19 | /**
20 | * 此处替换成您的appSecret
21 | * */
22 | private static readonly String appSecret = "rb8fWki1mJcK";
23 | /**
24 | * 自定义api地址
25 | * */
26 | private static readonly String api = "http://api.cn.ronghub.com";
27 |
28 | static void Main(String[] args)
29 | {
30 |
31 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
32 | //自定义 api 地址方式
33 | // RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
34 |
35 | Blacklist blackList = rongCloud.User.blackList;
36 |
37 | /**
38 | *
39 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/user/black.html#add
40 | * 添加用户到黑名单方法
41 | */
42 | UserModel blackUser = new UserModel() { Id = "hdsjGB88" };
43 | UserModel[] blacklist = { blackUser };
44 | UserModel user = new UserModel()
45 | {
46 | Id = "hdsjGB89",
47 | Blacklist = blacklist
48 | }
49 | ;
50 |
51 |
52 | Result userAddBlacklistResult = (Result)blackList.Add(user);
53 | Console.WriteLine("addBlacklist: " + userAddBlacklistResult.ToString());
54 |
55 | /**
56 | *
57 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/user/black.html#getList
58 | * 获取某用户的黑名单列表方法
59 | */
60 | UserModel user2 = new UserModel() { Id = "hdsjGB89" };
61 |
62 | BlackListResult result = blackList.GetList(user2);
63 | Console.WriteLine("query blacklist: " + result.ToString());
64 |
65 | /**
66 | *
67 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/user/black.html#remove
68 | * 从黑名单中移除用户方法
69 | */
70 | Result removeResult = blackList.Remove(user);
71 | Console.WriteLine("remove blacklist: " + removeResult.ToString());
72 |
73 | Console.ReadLine();
74 |
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/example/user/BlockExample.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models;
2 | using io.rong.models.response;
3 | using io.rong.models.push;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using io.rong.methods.user;
9 | using io.rong.methods.user.block;
10 |
11 | namespace io.rong.example.user
12 | {
13 | public class BlockExample
14 |
15 | {
16 | /**
17 | * 此处替换成您的appKey
18 | * */
19 | private static readonly String appKey = "appKey";
20 | /**
21 | * 此处替换成您的appSecret
22 | * */
23 | private static readonly String appSecret = "appSecret";
24 | /**
25 | * 自定义api地址
26 | * */
27 | private static readonly String api = "http://api.cn.ronghub.com";
28 |
29 | static void Main(String[] args)
30 | {
31 |
32 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
33 | //自定义 api 地址方式
34 | // RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
35 |
36 | Block block = rongCloud.User.block;
37 |
38 | /**
39 | *
40 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/user/block.html#add
41 | * 解除用户封禁
42 | *
43 | */
44 | UserModel user = new UserModel()
45 | {
46 | Id = "hkjo09h",
47 | Minute = 1000
48 | };
49 |
50 | Result addBlockResult = (ResponseResult)block.Add(user);
51 | Console.WriteLine("userAddBlock: " + addBlockResult.ToString());
52 |
53 | /**
54 | *
55 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/user/block.html#remove
56 | * 解除用户封禁
57 | *
58 | */
59 | ResponseResult unBlockResult = (ResponseResult)block.Remove(user.Id);
60 | Console.WriteLine("unBlock: " + unBlockResult.ToString());
61 |
62 | /**
63 | *
64 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/user/block.html#getList
65 | * 获取被封禁用户
66 | *
67 | */
68 | BlockUserResult blockResult = (BlockUserResult)block.GetList();
69 | Console.Write("queryBlock: " + blockResult.ToString());
70 |
71 | Console.ReadLine();
72 |
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/example/user/UserExample.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using io.rong.methods.user;
6 | using io.rong.methods.user.tag;
7 | using io.rong.models;
8 | using io.rong.models.response;
9 | using io.rong.models.push;
10 | using io.rong.models.push.tag;
11 |
12 |
13 | namespace io.rong.example.user
14 | {
15 | public class UserExample
16 |
17 | {
18 | /**
19 | * 此处替换成您的appKey
20 | * */
21 | private static readonly String appKey = "appKey";
22 | /**
23 | * 此处替换成您的appSecret
24 | * */
25 | private static readonly String appSecret = "appSecret";
26 | /**
27 | * 自定义api地址
28 | * */
29 | private static readonly String api = "http://api.cn.ronghub.com";
30 |
31 | static void Main(String[] args)
32 | {
33 |
34 | RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret);
35 | //自定义 api 地址方式
36 | // RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
37 | User User = rongCloud.User;
38 |
39 | /**
40 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/user/user.html#register
41 | *
42 | * 注册用户,生成用户在融云的唯一身份标识 Token
43 | */
44 | UserModel user = new UserModel
45 | {
46 | Id = "注册用户,生成用户在融云的唯一身份标识",
47 | Name = "username",
48 | Portrait = "http://www.rongcloud.cn/images/logo.png"
49 | };
50 |
51 | TokenResult result = User.Register(user);
52 | Console.WriteLine("getToken: " + result.ToString());
53 |
54 | /**
55 | *
56 | * API 文档: http://www.rongcloud.cn/docs/server_sdk_api/user/user.html#refresh
57 | *
58 | * 刷新用户信息方法
59 | */
60 | Result refreshResult = User.Update(user);
61 | Console.WriteLine("refresh: " + refreshResult.ToString());
62 |
63 | /**
64 | * 用户标签
65 | */
66 | Tag tag = User.tag;
67 | TagModel tagModel = new TagModel("111", new string[] { "一级" });
68 | ResponseResult re = tag.Set(tagModel);
69 | Console.WriteLine(re);
70 |
71 | Console.WriteLine(tag.BatchSet(new TagModel(new string[] { "111", "222" }, new string[] { "二级", "三级", "四季" })));
72 |
73 | TagListResult tags = (TagListResult)tag.Get(new string[] { "111" });
74 | Console.WriteLine(tags);
75 |
76 | Console.ReadLine();
77 |
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/exception/Error.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Web;
7 |
8 | namespace io.rong.exception
9 | {
10 | public class Error
11 |
12 | {
13 | [JsonProperty(PropertyName = "url")]
14 | private String url;
15 | [JsonProperty(PropertyName = "httpCode")]
16 | private int httpCode = 200;
17 | [JsonProperty(PropertyName = "code")]
18 | private int code;
19 | [JsonProperty(PropertyName = "errorMessage")]
20 | private String errorMessage;
21 |
22 | [JsonIgnore]
23 | public string Url { get => url; set => url = value; }
24 | [JsonIgnore]
25 | public int HttpCode { get => httpCode; set => httpCode = value; }
26 | [JsonIgnore]
27 | public int Code { get => code; set => code = value; }
28 | [JsonIgnore]
29 | public string ErrorMessage { get => errorMessage; set => errorMessage = value; }
30 |
31 | public Error(int code, int httpCode, String url, String errorMessage)
32 | {
33 | this.url = url;
34 | this.code = code;
35 | this.errorMessage = errorMessage;
36 | this.httpCode = httpCode;
37 | }
38 |
39 | public bool HasError()
40 | {
41 | return this.code != 200;
42 | }
43 |
44 | override
45 | public String ToString()
46 | {
47 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/exception/ParamError.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Web;
7 |
8 | namespace io.rong.exception
9 | {
10 | public class ParamError : Error
11 |
12 | {
13 | public ParamError(int errorCode, String apiURL, String errorMessage) : base(errorCode, errorCode, apiURL, errorMessage)
14 | {
15 | }
16 |
17 | public ParamError(int errorCode, int httpCode, String apiURL,
18 | String errorMessage) : base(errorCode, httpCode, apiURL, errorMessage)
19 | {
20 |
21 | }
22 |
23 | public ParamError(String apiURL) : base(1002, 400, apiURL, "缺少参数,请检查。")
24 | {
25 | }
26 |
27 | public ParamError(String apiURL, String message) : base(1002, 400, apiURL, message)
28 | {
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/exception/ParamException.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Web;
7 |
8 | namespace io.rong.exception
9 | {
10 |
11 | public class ParamException : RcloudException
12 |
13 | {
14 |
15 | private static readonly long serialVersionUID = -5021603276540528761L;
16 |
17 | public ParamException()
18 | {
19 | this.error = new ParamError("/");
20 | }
21 |
22 | public ParamException(String message, Exception e) : base(new ParamError("/", message).ToString(), e)
23 | {
24 | this.error = new ParamError("/", message);
25 | }
26 |
27 | public ParamException(Exception e) : base(e.Message)
28 | {
29 | this.error = new ParamError("/");
30 | }
31 |
32 | public ParamException(String message) : base(message)
33 | {
34 | this.error = new ParamError("/", message);
35 | }
36 |
37 | public ParamException(int errorCode, String apiUrl, String message) : base(new ParamError(errorCode, apiUrl, message).ToString())
38 | {
39 | this.error = new ParamError(errorCode, apiUrl, message);
40 |
41 | }
42 | }
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/exception/RcloudException.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Web;
7 |
8 | namespace io.rong.exception
9 | {
10 |
11 | public abstract class RcloudException : Exception
12 | {
13 | /**
14 | *
15 | */
16 | private static readonly long serialVersionUID = -700374663662873165L;
17 | protected Error error = null;
18 | public RcloudException()
19 | {
20 | }
21 |
22 | public RcloudException(String message, Exception e) : base(message, e)
23 | {
24 | }
25 |
26 | public RcloudException(Exception e) : base(e.Message)
27 | {
28 | }
29 |
30 | public RcloudException(String message) : base(message)
31 | {
32 | }
33 |
34 | public Error GetError()
35 | {
36 | return error;
37 | }
38 |
39 | public int GetErrorCode()
40 | {
41 | if (error == null)
42 | {
43 | return 200;
44 | }
45 | return error.Code;
46 | }
47 |
48 | public int GetHttpCode()
49 | {
50 | if (error == null)
51 | {
52 | return 200;
53 | }
54 | return error.HttpCode;
55 | }
56 |
57 | public void SetUri(String uri)
58 | {
59 | if (error == null)
60 | {
61 | return;
62 | }
63 | error.Url = uri;
64 | }
65 | }
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/jsonsource/PushMessage.json:
--------------------------------------------------------------------------------
1 | {
2 | "platform": ["ios","android"],
3 | "fromuserid": "U161142135",
4 | "audience": {
5 | "tag":["1"],
6 | "is_to_all": false
7 | },
8 | "message": {
9 | "content":"{\"content\":\"sadfsadfa\",\"extra\":\"www.baidu.com\"}",
10 | "objectName": "RC:TxtMsg"
11 | },
12 | "notification":{"alert":"this is a push"}
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/jsonsource/TemplateMessage.json:
--------------------------------------------------------------------------------
1 | {
2 | "fromUserId": "Vu-oC0_LQ6kgPqltm_zYtI",
3 | "objectName": "RC:TxtMsg",
4 | "content": "{\"content\":\"{c}{d}{e}\",\"extra\":\"bb\"}",
5 | "toUserId": [
6 | "uPj70HUrRSUk-ixtt7iIGc",
7 | "22"
8 | ],
9 | "values": [
10 | {
11 | "{c}": "1",
12 | "{d}": "2",
13 | "{e}": "3"
14 | },
15 | {
16 | "{c}": "4",
17 | "{d}": "5",
18 | "{e}": "6"
19 | }
20 | ],
21 | "pushContent": [
22 | "push{c}",
23 | "push{c}"
24 | ],
25 | "pushData": [
26 | "pushd",
27 | "pushd"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/jsonsource/UserTag.json:
--------------------------------------------------------------------------------
1 | {
2 | "userId": "31232",
3 | "tags": [
4 | "bj",
5 | "男"
6 | ]
7 | }
--------------------------------------------------------------------------------
/jsonsource/broadcast/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "send": {
3 | "docs": "http://www.rongcloud.cn/docs/server.html#message_broadcast",
4 | "url": "user/getToken",
5 | "params": {
6 | "message": {
7 | "conversationType": 1,
8 | "from": "2191",
9 | "objectName": "RC:TxtMsg",
10 | "content": {
11 | "content":"hello"
12 | },
13 | "pushContent": "this is a push",
14 | "pushData": {
15 | "pushData":"hello"
16 | },
17 | "os": "ios",
18 | "contentAvailable": 0
19 | }
20 | },
21 | "response": {
22 | "success": {
23 | "code": 200
24 | },
25 | "fail": {
26 | "20003": {
27 | "code": "1002",
28 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
29 | },
30 | "20005": {
31 | "code": "1002",
32 | "errorMessage": "{{name}} 参数为必传项"
33 | },
34 | "20001": {
35 | "code": "1501",
36 | "errorMessage": "参数类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
37 | },
38 | "1004": {
39 | "code": "1004",
40 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
41 | },
42 | "1008": {
43 | "code": "1008",
44 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
45 | }
46 | }
47 | }
48 |
49 | }
50 | }
--------------------------------------------------------------------------------
/jsonsource/broadcast/verify.json:
--------------------------------------------------------------------------------
1 | {
2 | "broadcast": {
3 | "_self": {
4 | "require": {
5 | "must": true,
6 | "invalid": "20005"
7 | },
8 | "typeof": {
9 | "type": "object",
10 | "invalid": "20001"
11 | }
12 | },
13 | "fromUserId": {
14 | "require": {
15 | "must": true,
16 | "invalid": "20005"
17 | },
18 | "length": {
19 | "max": 64,
20 | "min": 1,
21 | "invalid": "20003"
22 | }
23 | },
24 | "objectName": {
25 | "require": {
26 | "must": true,
27 | "invalid": "20005"
28 | },
29 | "length": {
30 | "max": 32,
31 | "min": 1,
32 | "invalid": "20003"
33 | }
34 | },
35 | "message": {
36 | "require": {
37 | "must": true,
38 | "invalid": "20005"
39 | }
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/jsonsource/chatroom/demotion/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "add": {
3 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_add",
4 | "url": "chatroom/message/priority/add",
5 | "params": {
6 | "message": {
7 | "type": ["RC:TxtMsg", "RC:ImgMsg"]
8 | }
9 | },
10 | "response": {
11 | "success": {
12 | "code": "200",
13 | "errorMessage": "成功返回"
14 | },
15 | "fail": {
16 | "20001": {
17 | "code": "1501",
18 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
19 | },
20 | "20002": {
21 | "code": "1502",
22 | "errorMessage": "msgs 数量超限, msgs.length >= 1 且 msgs.length <=5 "
23 | },
24 | "20005": {
25 | "code": "1002",
26 | "errorMessage": "{{name}} 参数为必传项"
27 | },
28 | "20007": {
29 | "code": "1002",
30 | "errorMessage": "protrait 不是合法地址,请检查 protrait 是否正确"
31 | },
32 | "1004": {
33 | "code": "1004",
34 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
35 | },
36 | "1008": {
37 | "code": "1008",
38 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
39 | }
40 | }
41 | }
42 | },
43 | "remove": {
44 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_remove",
45 | "url": "chatroom/message/priority/remove",
46 | "params": {
47 | "message": {
48 | "type": ["RC:TxtMsg", "RC:ImgMsg"]
49 | }
50 | },
51 | "response": {
52 | "success": {
53 | "code": "200",
54 | "errorMessage": "成功返回"
55 | },
56 | "fail": {
57 | "20001": {
58 | "code": "1501",
59 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
60 | },
61 | "20002": {
62 | "code": "1502",
63 | "errorMessage": "msgs 个数超限, msgs.length >= 1 且 msgs.length <=5 "
64 | },
65 | "20005": {
66 | "code": "1002",
67 | "errorMessage": "{{name}} 参数为必传项"
68 | },
69 | "20007": {
70 | "code": "1002",
71 | "errorMessage": "protrait 不是合法地址,请检查 protrait 是否正确"
72 | },
73 | "1004": {
74 | "code": "1004",
75 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
76 | },
77 | "1008": {
78 | "code": "1008",
79 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
80 | }
81 | }
82 | }
83 | },
84 | "getList": {
85 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_query",
86 | "url": "chatroom/message/priority/query",
87 | "params": {},
88 | "response": {
89 | "success": {
90 | "code": 200,
91 | "objectNames": ["RC:ImgMsg", "RC:ImgTextMsg", "RC:VcMsg"]
92 | },
93 | "fail": {
94 | "1004": {
95 | "code": "1004",
96 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
97 | },
98 | "1008": {
99 | "code": "1008",
100 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
101 | }
102 | }
103 | }
104 | }
105 | }
--------------------------------------------------------------------------------
/jsonsource/chatroom/distribute/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "stop": {
3 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_message_stop_distribution",
4 | "url": "chatroom/message/stopDistribution",
5 | "params": {
6 | "chatroom": {
7 | "id": "chatroom01"
8 | }
9 | },
10 | "response": {
11 | "success": {
12 | "code": "200",
13 | "errorMessage": "成功返回"
14 | },
15 | "fail": {
16 | "20003": {
17 | "code": "1002",
18 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
19 | },
20 | "20005": {
21 | "code": "1002",
22 | "errorMessage": "{{name}} 参数为必传项"
23 | },
24 | "20001": {
25 | "code": "1501",
26 | "errorMessage": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
27 | },
28 | "1004": {
29 | "code": "1004",
30 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
31 | },
32 | "1008": {
33 | "code": "1008",
34 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
35 | }
36 | }
37 | }
38 | },
39 | "resume": {
40 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_message_resume_distribution",
41 | "url": "chatroom/message/resumeDistribution",
42 | "params": {
43 | "chatroom": {
44 | "id": "chatroom01"
45 | }
46 | },
47 | "response": {
48 | "success": {
49 | "code": "200",
50 | "errorMessage": "成功返回"
51 | },
52 | "fail": {
53 | "20003": {
54 | "code": "1002",
55 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
56 | },
57 | "20005": {
58 | "code": "1002",
59 | "errorMessage": "{{name}} 参数为必传项"
60 | },
61 | "20001": {
62 | "code": "1501",
63 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
64 | },
65 | "1004": {
66 | "code": "1004",
67 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
68 | },
69 | "1008": {
70 | "code": "1008",
71 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
72 | }
73 | }
74 | }
75 | }
76 | }
--------------------------------------------------------------------------------
/jsonsource/chatroom/global-gag/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "add": {
3 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_ban_add",
4 | "url": "chatroom/user/ban/add",
5 | "params": {
6 | "chatroom": {
7 | "members": [{
8 | "id": "memberId01"
9 | }],
10 | "minute": 100
11 | }
12 | },
13 | "response": {
14 | "success": {
15 | "code": 200,
16 | "errorMessage": "成功返回"
17 | },
18 | "fail": {
19 | "20002": {
20 | "code": "1502",
21 | "errorMessage": "{{name}} 数量超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
22 | },
23 | "20003": {
24 | "code": "1002",
25 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
26 | },
27 | "20004": {
28 | "code": "1002",
29 | "errorMessage": "封禁时间 minute 不正确,minute >= 1 且 minute <= 43200 单位: 分钟"
30 | },
31 | "20005": {
32 | "code": "1002",
33 | "errorMessage": "{{name}} 参数为必传项"
34 | },
35 | "20001": {
36 | "code": "1501",
37 | "errorMessage": "参数类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
38 | },
39 | "1004": {
40 | "code": "1004",
41 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
42 | },
43 | "1008": {
44 | "code": "1008",
45 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
46 | }
47 | }
48 | }
49 | },
50 | "remove": {
51 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_ban_remove",
52 | "url": "chatroom/user/ban/remove",
53 | "params": {
54 | "chatroom": {
55 | "members": [{
56 | "id": "memberId01"
57 | }]
58 | }
59 | },
60 | "response": {
61 | "success": {
62 | "code": 200,
63 | "errorMessage": "成功返回"
64 | },
65 | "fail": {
66 | "20002": {
67 | "code": "1502",
68 | "errorMessage": "{{name}} 个数超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
69 | },
70 | "20003": {
71 | "code": "1002",
72 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
73 | },
74 | "20005": {
75 | "code": "1002",
76 | "errorMessage": "{{name}} 参数为必传项"
77 | },
78 | "20001": {
79 | "code": "1501",
80 | "errorMessage": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
81 | },
82 | "1004": {
83 | "code": "1004",
84 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
85 | },
86 | "1008": {
87 | "code": "1008",
88 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
89 | }
90 | }
91 | }
92 | },
93 | "getList": {
94 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_ban_query",
95 | "url": "chatroom/user/ban/query",
96 | "params": {},
97 | "response": {
98 | "success": {
99 | "code": "200",
100 | "members": [{
101 | "time": "2015-09-25 16:12:38",
102 | "id": "2582"
103 | }]
104 | },
105 | "fail": {
106 | "1004": {
107 | "code": "1004",
108 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
109 | },
110 | "1008": {
111 | "code": "1008",
112 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
113 | }
114 | }
115 | }
116 | }
117 | }
--------------------------------------------------------------------------------
/jsonsource/chatroom/keepalive/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "add": {
3 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_keepalive_add",
4 | "url": "chatroom/keepalive/add",
5 | "params": {
6 | "chatroom": {
7 | "id": "chatroomId01"
8 | }
9 | },
10 | "response": {
11 | "success": {
12 | "code": "200",
13 | "errorMessage": "成功返回"
14 | },
15 | "fail": {
16 | "20003": {
17 | "code": "1002",
18 | "errorMessage": "chatroomId 长度超限, chatroomId >= 1 且 chatroomId <= 64 单位: 字节"
19 | },
20 | "20005": {
21 | "code": "1002",
22 | "errorMessage": "{{name}} 参数为必传项"
23 | },
24 | "1004": {
25 | "code": "1004",
26 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
27 | },
28 | "1008": {
29 | "code": "1008",
30 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
31 | }
32 | }
33 | }
34 | },
35 | "remove": {
36 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_keepalive_remove",
37 | "url": "chatroom/keepalive/remove",
38 | "params": {
39 | "chatroom": {
40 | "id": "chatroomId01"
41 | }
42 | },
43 | "response": {
44 | "success": {
45 | "code": "200",
46 | "errorMessage": "成功返回"
47 | },
48 | "fail": {
49 | "20003": {
50 | "code": "1002",
51 | "errorMessage": "chatroomId 长度超限, chatroomId >= 1 且 chatroomId <= 64 单位: 字节"
52 | },
53 | "20005": {
54 | "code": "1002",
55 | "errorMessage": "{{name}} 参数为必传项"
56 | },
57 | "1004": {
58 | "code": "1004",
59 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
60 | },
61 | "1008": {
62 | "code": "1008",
63 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
64 | }
65 | }
66 | }
67 | },
68 | "getList": {
69 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_keepalive_query",
70 | "url": "chatroom/keepalive/query",
71 | "params": {},
72 | "response": {
73 | "success": {
74 | "code": "200",
75 | "chatrooms": ["chatroomId1", "chatroomId2"]
76 | },
77 | "fail": {
78 | "20003": {
79 | "code": "1002",
80 | "errorMessage": "chatroomId 长度超限, chatroomId >= 1 且 chatroomId <= 64 单位: 字节"
81 | },
82 | "20005": {
83 | "code": "1002",
84 | "errorMessage": "{{name}} 参数为必传项"
85 | },
86 | "1004": {
87 | "code": "1004",
88 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
89 | },
90 | "1008": {
91 | "code": "1008",
92 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
93 | }
94 | }
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/jsonsource/chatroom/member-gag/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "add": {
3 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_gag_add",
4 | "url": "chatroom/user/gag/add",
5 | "params": {
6 | "chatroom": {
7 | "id":"dsd",
8 | "members": [{"id":"akfj0a1"}, {"id":"akfj0a2"}],
9 | "minute": 100
10 | }
11 | },
12 | "response": {
13 | "success": {
14 | "code": 200,
15 | "errorMessage": "成功返回"
16 | },
17 | "fail": {
18 | "20002": {
19 | "code": "1502",
20 | "errorMessage": "{{name}} 数量超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
21 | },
22 | "20004": {
23 | "code": "1002",
24 | "errorMessage": "封禁时间 minute 不正确,minute >= 1 且 minute <= 43200 单位: 分钟"
25 | },
26 | "20005": {
27 | "code": "1002",
28 | "errorMessage": "{{name}} 参数为必传项"
29 | },
30 | "20001": {
31 | "code": "1501",
32 | "errorMessage": "参数类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
33 | },
34 | "1004": {
35 | "code": "1004",
36 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
37 | },
38 | "1008": {
39 | "code": "1008",
40 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
41 | }
42 | }
43 | }
44 | },
45 | "remove": {
46 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_gag_remove",
47 | "url": "chatroom/user/gag/remove",
48 | "params": {
49 | "chatroom": {
50 | "id":"dsd",
51 | "members": [{"id":"akfj0a1"}, {"id":"akfj0a2"}],
52 | }
53 | },
54 | "response": {
55 | "success": {
56 | "code": 200,
57 | "errorMessage": "成功返回"
58 | },
59 | "fail": {
60 | "20002": {
61 | "code": "1502",
62 | "errorMessage": "{{name}} 个数超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
63 | },
64 | "20005": {
65 | "code": "1002",
66 | "errorMessage": "{{name}} 参数为必传项"
67 | },
68 | "20001": {
69 | "code": "1501",
70 | "errorMessage": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
71 | },
72 | "1004": {
73 | "code": "1004",
74 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
75 | },
76 | "1008": {
77 | "code": "1008",
78 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
79 | }
80 | }
81 | }
82 | },
83 | "getList": {
84 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_gag_query",
85 | "url": "chatroom/user/gag/query",
86 | "params": {
87 | "chatroom": {
88 | "id": "akfj0a1"
89 | }
90 | },
91 | "response": {
92 | "success": {
93 | "code": "200",
94 | "members": [{
95 | "time": "2015-09-25 16:12:38",
96 | "id": "2582"
97 | }]
98 | },
99 | "fail": {
100 | "1004": {
101 | "code": "1004",
102 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
103 | },
104 | "1008": {
105 | "code": "1008",
106 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
107 | }
108 | }
109 | }
110 | }
111 | }
--------------------------------------------------------------------------------
/jsonsource/chatroom/verify.json:
--------------------------------------------------------------------------------
1 | {
2 | "chatroom": {
3 | "_self": {
4 | "require": {
5 | "must": true,
6 | "invalid": "20005"
7 | }
8 | },
9 | "id": {
10 | "require": {
11 | "must": true,
12 | "invalid": "20005"
13 | },
14 | "length": {
15 | "max": 32,
16 | "min": 1,
17 | "invalid": "20003"
18 | },
19 | "typeof": {
20 | "type": "string",
21 | "invalid": "20001"
22 | }
23 | },
24 | "name": {
25 | "require": {
26 | "must": true,
27 | "invalid": "20005"
28 | }
29 | },
30 | "members": {
31 | "require": {
32 | "must": true,
33 | "invalid": "20005"
34 | },
35 | "size": {
36 | "max": 20,
37 | "min": 1,
38 | "invalid": "20002"
39 | },
40 | "typeof": {
41 | "type": "array",
42 | "invalid": "20001"
43 | }
44 | },
45 | "count": {
46 | "require": {
47 | "must": true,
48 | "invalid": "20005"
49 | },
50 | "size": {
51 | "max": 500,
52 | "min": 1,
53 | "invalid": "20002"
54 | },
55 | "typeof": {
56 | "type": "number|int",
57 | "invalid": "20001"
58 | }
59 | },
60 | "order": {
61 | "require": {
62 | "must": true,
63 | "invalid": "20005"
64 | },
65 | "typeof": {
66 | "type": "string",
67 | "invalid": "20001"
68 | }
69 | },
70 | "minute": {
71 | "require": {
72 | "must": true,
73 | "invalid": "20005"
74 | },
75 | "size": {
76 | "max": 43200,
77 | "min": 1,
78 | "invalid": "20004"
79 | },
80 | "typeof": {
81 | "type": "number|int",
82 | "invalid": "20001"
83 | }
84 | }
85 | },
86 | "message": {
87 | "_self": {
88 | "require": {
89 | "must": true,
90 | "invalid": "20005"
91 | }
92 | },
93 | "type": {
94 | "require": {
95 | "must": true,
96 | "invalid": "20005"
97 | },
98 | "size": {
99 | "max": 5,
100 | "min": 1,
101 | "invalid": "20002"
102 | },
103 | "typeof": {
104 | "type": "array",
105 | "invalid": "20001"
106 | }
107 | }
108 | },
109 | "member": {
110 | "_self": {
111 | "require": {
112 | "must": true,
113 | "invalid": "20005"
114 | }
115 | },
116 | "id": {
117 | "require": {
118 | "must": true,
119 | "invalid": "20005"
120 | },
121 | "length": {
122 | "max": 64,
123 | "min": 1,
124 | "invalid": "20002"
125 | }
126 | },
127 | "chatroomId": {
128 | "require": {
129 | "must": true,
130 | "invalid": "20005"
131 | },
132 | "length": {
133 | "max": 64,
134 | "min": 1,
135 | "invalid": "20002"
136 | }
137 | },
138 | "time": {
139 | "require": {
140 | "must": true,
141 | "invalid": "20005"
142 | }
143 | }
144 | }
145 | }
--------------------------------------------------------------------------------
/jsonsource/chatroom/whitelist/message/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "add": {
3 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_whitelist_add",
4 | "url": "chatroom/user/whitelist/add",
5 | "params": {
6 | "message": {
7 | "type": ["RC:TxtMsg", "RC:ImgMsg"]
8 | }
9 | },
10 | "response": {
11 | "success": {
12 | "code": "200",
13 | "errorMessage": "成功返回"
14 | },
15 | "fail": {
16 | "20002": {
17 | "code": "1502",
18 | "errorMessage": "{{name}} 数量超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
19 | },
20 | "20003": {
21 | "code": "1002",
22 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
23 | },
24 | "20005": {
25 | "code": "1002",
26 | "errorMessage": "{{name}} 参数为必传项"
27 | },
28 | "1004": {
29 | "code": "1004",
30 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
31 | },
32 | "1008": {
33 | "code": "1008",
34 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
35 | }
36 | }
37 | }
38 | },
39 | "remove": {
40 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_remove",
41 | "url": "chatroom/message/priority/remove",
42 | "params": {
43 | "message": {
44 | "type": ["RC:TxtMsg", "RC:ImgMsg"]
45 | }
46 | },
47 | "response": {
48 | "success": {
49 | "code": "200",
50 | "errorMessage": "成功返回"
51 | },
52 | "fail": {
53 | "20002": {
54 | "code": "1502",
55 | "errorMessage": "{{name}} 个数超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
56 | },
57 | "20003": {
58 | "code": "1002",
59 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
60 | },
61 | "20005": {
62 | "code": "1002",
63 | "errorMessage": "{{name}} 参数为必传项"
64 | },
65 | "1004": {
66 | "code": "1004",
67 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
68 | },
69 | "1008": {
70 | "code": "1008",
71 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
72 | }
73 | }
74 | }
75 | },
76 | "getList": {
77 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_whitelist_query",
78 | "url": "chatroom/user/whitelist/query",
79 | "params": {},
80 | "response": {
81 | "success": {
82 | "code": "200",
83 | "members": [
84 | "member1",
85 | "member2"
86 | ]
87 | },
88 | "fail": {
89 | "20003": {
90 | "code": "1002",
91 | "errorMessage": "chatroomId 长度超限, chatroomId >= 1 且 chatroomId <= 64 单位: 字节"
92 | },
93 | "20005": {
94 | "code": "1002",
95 | "errorMessage": "{{name}} 参数为必传项"
96 | },
97 | "1004": {
98 | "code": "1004",
99 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
100 | },
101 | "1008": {
102 | "code": "1008",
103 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
104 | }
105 | }
106 | }
107 | }
108 | }
--------------------------------------------------------------------------------
/jsonsource/chatroom/whitelist/user/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "add": {
3 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_whitelist_add",
4 | "url": "chatroom/user/whitelist/add",
5 | "params": {
6 | "chatroom": {
7 | "id": "chatroomId01",
8 | "members": [{
9 | "id": "memberId01"
10 | }]
11 | }
12 | },
13 | "response": {
14 | "success": {
15 | "code": "200",
16 | "errorMessage": "成功返回"
17 | },
18 | "fail": {
19 | "20002": {
20 | "code": "1502",
21 | "errorMessage": "{{name}} 个数超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
22 | },
23 | "20005": {
24 | "code": "1002",
25 | "errorMessage": "{{name}} 参数为必传项"
26 | },
27 | "20001": {
28 | "code": "1501",
29 | "errorMessage": "参数类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
30 | },
31 | "1004": {
32 | "code": "1004",
33 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
34 | },
35 | "1008": {
36 | "code": "1008",
37 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
38 | }
39 | }
40 | }
41 | },
42 | "remove": {
43 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_remove",
44 | "url": "chatroom/message/priority/remove",
45 | "params": {
46 | "chatroom": {
47 | "id": "chatroomId01",
48 | "members": [{
49 | "id": "memberId01"
50 | }]
51 | }
52 | },
53 | "response": {
54 | "success": {
55 | "code": "200",
56 | "errorMessage": "成功返回"
57 | },
58 | "fail": {
59 | "20002": {
60 | "code": "1502",
61 | "errorMessage": "{{name}} 个数超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
62 | },
63 | "20003": {
64 | "code": "1002",
65 | "errorMessage": "chatroomId 长度超限, chatroomId >= 1 且 chatroomId <= 64 单位: 字节"
66 | },
67 | "20005": {
68 | "code": "1002",
69 | "errorMessage": "{{name}} 参数为必传项"
70 | },
71 | "20001": {
72 | "code": "1501",
73 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
74 | },
75 | "1004": {
76 | "code": "1004",
77 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
78 | },
79 | "1008": {
80 | "code": "1008",
81 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
82 | }
83 | }
84 | }
85 | },
86 | "getList": {
87 | "docs": "http://rongcloud.cn/docs/server.html#chatroom_user_whitelist_query",
88 | "url": "chatroom/user/whitelist/query",
89 | "params": {
90 | "chatroom": {
91 | "id": "chatroomId01"
92 | }
93 | },
94 | "response": {
95 | "success": {
96 | "code": "200",
97 | "members": [
98 | "member1",
99 | "member2"
100 | ]
101 | },
102 | "fail": {
103 | "20005": {
104 | "code": "1002",
105 | "errorMessage": "{{name}} 参数为必传项"
106 | },
107 | "20001": {
108 | "code": "1501",
109 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
110 | },
111 | "1004": {
112 | "code": "1004",
113 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
114 | },
115 | "1008": {
116 | "code": "1008",
117 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
118 | }
119 | }
120 | }
121 | }
122 | }
--------------------------------------------------------------------------------
/jsonsource/conversation/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "mute": {
3 | "docs": "http://rongcloud.cn/docs/server.html#conversation_notification_set",
4 | "url": "conversation/notification/set",
5 | "params": {
6 | "conversation": {
7 | "type": "1",
8 | "targetId": "UAhIaLkR0",
9 | "userId": "b5NwvIrW8"
10 | }
11 | },
12 | "response":{
13 | "success": {
14 | "code": "200",
15 | "errorMessage": "成功返回"
16 | },
17 | "fail": {
18 | "20003": {
19 | "code": "1002",
20 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
21 | },
22 | "20005": {
23 | "code": "1002",
24 | "errorMessage": "{{name}} 参数为必传项"
25 | },
26 | "20001": {
27 | "code": "1501",
28 | "errorMessage": "参数类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}} "
29 | },
30 | "1004": {
31 | "code": "1004",
32 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
33 | },
34 | "1008": {
35 | "code": "1008",
36 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
37 | }
38 | }
39 | }
40 | },
41 | "unmute": {
42 | "docs": "http://rongcloud.cn/docs/server.html#conversation_notification_set",
43 | "url": "conversation/notification/set",
44 | "params": {
45 | "conversation": {
46 | "type": "1",
47 | "targetId": "UAhIaLkR0",
48 | "userId": "b5NwvIrW8"
49 | }
50 | },
51 | "response":{
52 | "success": {
53 | "code": "200",
54 | "errorMessage": "成功返回"
55 | },
56 | "fail": {
57 | "20003": {
58 | "code": "1002",
59 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
60 | },
61 | "20005": {
62 | "code": "1002",
63 | "errorMessage": "{{name}} 参数为必传项"
64 | },
65 | "20001": {
66 | "code": "1501",
67 | "errorMessage": "参数 类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}} "
68 | },
69 | "1004": {
70 | "code": "1004",
71 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
72 | },
73 | "1008": {
74 | "code": "1008",
75 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
76 | }
77 | }
78 | }
79 | }
80 | }
--------------------------------------------------------------------------------
/jsonsource/conversation/verify.json:
--------------------------------------------------------------------------------
1 | {
2 | "conversation": {
3 | "_self": {
4 | "require": {
5 | "must": true,
6 | "invalid": "20005"
7 | },
8 | "typeof": {
9 | "type": "object",
10 | "invalid": "20001"
11 | }
12 | },
13 | "type": {
14 | "require": {
15 | "must": true,
16 | "invalid": "20005"
17 | }
18 | },
19 | "userId": {
20 | "require": {
21 | "must": true,
22 | "invalid": "20005"
23 | },
24 | "length": {
25 | "max": 64,
26 | "min": 1,
27 | "invalid": "20003"
28 | }
29 | },
30 | "targetId": {
31 | "require": {
32 | "must": true,
33 | "invalid": "20005"
34 | },
35 | "length": {
36 | "max": 64,
37 | "min": 1,
38 | "invalid": "20003"
39 | }
40 | },
41 | "name": {
42 | "require": {
43 | "must": true,
44 | "invalid": "20005"
45 | },
46 | "length": {
47 | "max": 64,
48 | "min": 1,
49 | "invalid": "20003"
50 | }
51 | },
52 | "portrait": {
53 | "require": {
54 | "must": true,
55 | "invalid": "20005"
56 | },
57 | "length": {
58 | "max": 1024,
59 | "min": 1,
60 | "invalid": "20003"
61 | },
62 | "url": {
63 | "legal": "url 正则",
64 | "invalid": "20007"
65 | }
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/jsonsource/group/verify.json:
--------------------------------------------------------------------------------
1 | {
2 | "group": {
3 | "_self": {
4 | "require": {
5 | "must": true,
6 | "invalid": "20005"
7 | },
8 | "typeof": {
9 | "type": "object",
10 | "invalid": "20001"
11 | }
12 | },
13 | "id": {
14 | "require": {
15 | "must": true,
16 | "invalid": "20005"
17 | },
18 | "length": {
19 | "max": 64,
20 | "min": 1,
21 | "invalid": "20003"
22 | }
23 | },
24 | "members": {
25 | "require": {
26 | "must": true,
27 | "invalid": "20005"
28 | },
29 | "length": {
30 | "max": 64,
31 | "min": 1,
32 | "invalid": "20003"
33 | },
34 | "typeof": {
35 | "type": "array",
36 | "invalid": "20001"
37 | }
38 | },
39 | "name": {
40 | "require": {
41 | "must": true,
42 | "invalid": "20005"
43 | },
44 | "length": {
45 | "max": 64,
46 | "min": 1,
47 | "invalid": "20003"
48 | }
49 | },
50 | "portrait": {
51 | "require": {
52 | "must": true,
53 | "invalid": "20005"
54 | },
55 | "length": {
56 | "max": 1024,
57 | "min": 1,
58 | "invalid": "20003"
59 | },
60 | "url": {
61 | "legal": "url 正则",
62 | "invalid": "20007"
63 | }
64 | },
65 | "minute": {
66 | "require": {
67 | "must": true,
68 | "invalid": "20005"
69 | },
70 | "size": {
71 | "max": 43200,
72 | "min": 1,
73 | "invalid": "20004"
74 | },
75 | "typeof": {
76 | "type": "number|int",
77 | "invalid": "20001"
78 | }
79 | },
80 | "operator": {
81 | "require": {
82 | "must": true,
83 | "invalid": "20005"
84 | },
85 | "length": {
86 | "max": 64,
87 | "min": 1,
88 | "invalid": "20003"
89 | }
90 | }
91 | },
92 | "user":{
93 | "id": {
94 | "require": {
95 | "must": true,
96 | "invalid": "20005"
97 | },
98 | "length": {
99 | "max": 64,
100 | "min": 1,
101 | "invalid": "20003"
102 | }
103 | },
104 | "groups":{
105 | "require": {
106 | "must": true,
107 | "invalid": "20005"
108 | },
109 | "typeof": {
110 | "type": "array",
111 | "invalid": "20001"
112 | }
113 | }
114 | },
115 | "minute": {
116 | "require": {
117 | "must": true,
118 | "invalid": "20005"
119 | },
120 | "size": {
121 | "max": 43200,
122 | "min": 1,
123 | "invalid": "20004"
124 | },
125 | "typeof": {
126 | "type": "number|int",
127 | "invalid": "20001"
128 | }
129 | }
130 |
131 | }
--------------------------------------------------------------------------------
/jsonsource/message/TemplateMessage.json:
--------------------------------------------------------------------------------
1 | {
2 | "senderId": "Vu-oC0_LQ6kgPqltm_zYtI",
3 | "objectName": "RC:TxtMsg",
4 | "template": {
5 | "content": ".NET{name}, 语文成绩 {score} 分 template"
6 | },
7 | "content": {
8 | "uPj70HUrRSUk-ixtt7iIGc": {
9 | "data": {
10 | "{name}": "小明",
11 | "{score}": "90"
12 | },
13 | "push": ".NET{name} 你的成绩出来了 template"
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/jsonsource/message/chatroom/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "send": {
3 | "params": {
4 | "chatroomMessage": {
5 | "senderId": "2191",
6 | "targetId": "2192",
7 | "objectName": "RC:TxtMsg",
8 | "content": {
9 | "content":"hello"
10 | }
11 | }
12 | },
13 | "response": {
14 | "success": {
15 | "code": "200",
16 | "errorMessage": "成功返回"
17 | },
18 | "fail": {
19 | "20002": {
20 | "code": "1502",
21 | "errorMessage": "{{name}} 个数超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
22 | },
23 | "20003": {
24 | "code": "1002",
25 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
26 | },
27 | "20005": {
28 | "code": "1002",
29 | "errorMessage": "{{name}} 参数为必传项"
30 | },
31 | "20001": {
32 | "code": "1501",
33 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}} "
34 | },
35 | "1004": {
36 | "code": "1004",
37 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
38 | },
39 | "1008": {
40 | "code": "1008",
41 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
42 | }
43 | }
44 | }
45 | },
46 | "broadcast": {
47 | "url": "message/chatroom/broadcast",
48 | "params": {
49 | "message": {
50 | "senderId": "2191",
51 | "objectName": "RC:TxtMsg",
52 | "content": {
53 | "content":"hello"
54 | }
55 | }
56 | },
57 | "response": {
58 | "success": {
59 | "code": "200",
60 | "errorMessage": "成功返回"
61 | },
62 | "fail": {
63 | "20002": {
64 | "code": "1502",
65 | "errorMessage": "{{name}} 数量超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
66 | },
67 | "20003": {
68 | "code": "1002",
69 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
70 | },
71 | "20005": {
72 | "code": "1002",
73 | "errorMessage": "{{name}} 参数为必传项"
74 | },
75 | "20001": {
76 | "code": "1501",
77 | "errorMessage": "{{name}} 类型不正确,请检查参数类型, 应该为 {{type}} 传入为 {{currentType}} "
78 | },
79 | "1004": {
80 | "code": "1004",
81 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
82 | },
83 | "1008": {
84 | "code": "1008",
85 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
86 | }
87 | }
88 | }
89 | }
90 | }
--------------------------------------------------------------------------------
/jsonsource/message/discussion/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "send": {
3 | "params": {
4 | "discussionMessage": {
5 | "senderId": "2191",
6 | "targetId": "2192",
7 | "objectName": "RC:TxtMsg",
8 | "content": {
9 | "content":"hello"
10 | },
11 | "pushContent": "thisisapush",
12 | "pushData": {
13 | "pushData":"hello"
14 | },
15 | "count": "4",
16 | "verifyBlacklist": 0,
17 | "isPersisted": 1,
18 | "isCounted": 1,
19 | "isIncludeSender": 0,
20 | "contentAvailable": 0
21 | }
22 | },
23 | "response": {
24 | "success": {
25 | "code": "200",
26 | "errorMessage": "成功返回"
27 | },
28 | "fail": {
29 | "20002": {
30 | "code": "1502",
31 | "errorMessage": "{{name}} 个数超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
32 | },
33 | "20003": {
34 | "code": "1002",
35 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
36 | },
37 | "1004": {
38 | "code": "1004",
39 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
40 | },
41 | "1008": {
42 | "code": "1008",
43 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
44 | }
45 | }
46 | }
47 | },
48 | "recall": {
49 | "docs": "http://rongcloud.cn/docs/server.html#message_recall",
50 | "url": "message/recall",
51 | "params": {
52 | "recallMessage": {
53 | "senderId": "fDR2cVpxxR5zSMUNh3yAwh",
54 | "targetId": "MersNRhaKwJkRV9mJR5JXY",
55 | "uId": "5FGT-7VA9-G4DD-4V5P",
56 | "sentTime": "20007778882124"
57 | }
58 | },
59 | "response": {
60 | "success": {
61 | "code": "200",
62 | "errorMessage": "成功返回"
63 | },
64 | "fail": {
65 | "20001": {
66 | "code": "1501",
67 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}} "
68 | },
69 | "20002": {
70 | "code": "1502",
71 | "errorMessage": "{{name}} 数量超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
72 | },
73 | "20003": {
74 | "code": "1002",
75 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
76 | },
77 | "20005": {
78 | "code": "1002",
79 | "errorMessage": "{{name}} 参数为必传项"
80 | },
81 | "1004": {
82 | "code": "1004",
83 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
84 | },
85 | "1008": {
86 | "code": "1008",
87 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
88 | }
89 | }
90 | }
91 | }
92 | }
--------------------------------------------------------------------------------
/jsonsource/message/history/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "get": {
3 | "docs": "http://rongcloud.cn/docs/server.html#history_message_download",
4 | "url": "message/history",
5 | "params": {
6 | "message": {
7 | "date": "2018010101"
8 | }
9 | },
10 | "response": {
11 | "success": {
12 | "code": "200",
13 | "url": "http://120.92.22.186/9/2018030119/5e398bf3-df16-4e75-9385-7e37c65db649.zip"
14 | },
15 | "fail": {
16 | "1004": {
17 | "code": "1004",
18 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
19 | },
20 | "1008": {
21 | "code": "1008",
22 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
23 | },
24 | "20005": {
25 | "code": "1002",
26 | "errorMessage": "{{name}} 参数为必传项"
27 | },
28 | "20001": {
29 | "code": "1501",
30 | "errorMessage": "{{name}} 类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}} "
31 | }
32 | }
33 | }
34 | },
35 | "remove": {
36 | "docs": "http://rongcloud.cn/docs/server.html#history_message_delete",
37 | "url": "message/delete",
38 | "params": {
39 | "message": {
40 | "date": "2017010101"
41 | }
42 | },
43 | "response": {
44 | "success": {
45 | "code": "200",
46 | },
47 | "fail": {
48 | "1004": {
49 | "code": "1004",
50 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
51 | },
52 | "1008": {
53 | "code": "1008",
54 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
55 | },
56 | "20005": {
57 | "code": "1002",
58 | "errorMessage": "{{name}} 参数为必传项"
59 | },
60 | "20001": {
61 | "code": "1501",
62 | "errorMessage": "{{name}} 类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}} "
63 | }
64 | }
65 | }
66 | }
67 | }
--------------------------------------------------------------------------------
/jsonsource/message/recall/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "recall": {
3 | "docs": "http://rongcloud.cn/docs/server.html#message_recall",
4 | "url": "message/recall",
5 | "params": {
6 | "recallMessage": {
7 | "senderId": "fDR2cVpxxR5zSMUNh3yAwh",
8 | "targetId": "MersNRhaKwJkRV9mJR5JXY",
9 | "uId": "5FGT-7VA9-G4DD-4V5P",
10 | "sentTime": "20007778882124"
11 | }
12 | },
13 | "response": {
14 | "success": {
15 | "code": "200",
16 | "errorMessage": "成功返回"
17 | },
18 | "fail": {
19 | "20002": {
20 | "code": "1502",
21 | "errorMessage": "{{name}} 数量超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
22 | },
23 | "20003": {
24 | "code": "1002",
25 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
26 | },
27 | "1004": {
28 | "code": "1004",
29 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
30 | },
31 | "1008": {
32 | "code": "1008",
33 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
34 | }
35 | }
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/jsonsource/push/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "broadcast": {
3 | "docs": "https://www.rongcloud.cn/docs/push_service.html#broadcast",
4 | "url": "push",
5 | "params": {
6 | "broadcast": {
7 | "platform": [
8 | "ios",
9 | "android"
10 | ],
11 | "fromuserid": "aFo990k",
12 | "message": {
13 | "content": "hello",
14 | "objectName": "RC:TxtMsg"
15 | },
16 | "audience": {
17 | "is_to_all": true
18 | },
19 | "notification": {
20 | "alert": "this is a push"
21 | }
22 | }
23 | },
24 | "response": {
25 | "success": {
26 | "code": 200,
27 | "id": "50whSR6kQiHb7YgFwQzXIb"
28 | },
29 | "fail": {
30 | "2007": {
31 | "code": "2007",
32 | "errorMessage": "开发环境下注册用户上限为 100 个,生产环境下注册用户不超过 100 可免费使用,超过 100 需要开通 IM 商用版"
33 | },
34 | "20003": {
35 | "code": "1002",
36 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
37 | },
38 | "20005": {
39 | "code": "1002",
40 | "errorMessage": "{{name}} 参数为必传项"
41 | },
42 | "20001": {
43 | "code": "1002",
44 | "errorMessage": "参数类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
45 | },
46 | "1004": {
47 | "code": "1004",
48 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
49 | },
50 | "1008": {
51 | "code": "1008",
52 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
53 | }
54 | }
55 | }
56 | },
57 | "push": {
58 | "docs": "https://www.rongcloud.cn/docs/push_service.html#push",
59 | "url": "push",
60 | "params": {
61 | "broadcast": {
62 | "platform": [
63 | "ios",
64 | "android"
65 | ],
66 | "audience": {
67 | "is_to_all": true
68 | },
69 | "notification": {
70 | "alert": "this is a push"
71 | }
72 | }
73 | },
74 | "response": {
75 | "success": {
76 | "code": 200,
77 | "userId": "jlk456j5",
78 | "token": "MAo+IhwqEO3+h/DdXg1w6m20V27XsDF2Dx+"
79 | },
80 | "fail": {
81 | "2007": {
82 | "code": "2007",
83 | "errorMessage": "开发环境下注册用户上限为 100 个,生产环境下注册用户不超过 100 可免费使用,超过 100 需要开通 IM 商用版"
84 | },
85 | "20003": {
86 | "code": "1002",
87 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
88 | },
89 | "20005": {
90 | "code": "1002",
91 | "errorMessage": "{{name}} 参数为必传项"
92 | },
93 | "20001": {
94 | "code": "1002",
95 | "errorMessage": "参数类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
96 | },
97 | "1004": {
98 | "code": "1004",
99 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
100 | },
101 | "1008": {
102 | "code": "1008",
103 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
104 | }
105 | }
106 | }
107 | }
108 | }
--------------------------------------------------------------------------------
/jsonsource/push/verify.json:
--------------------------------------------------------------------------------
1 | {
2 | "broadcast": {
3 | "_self": {
4 | "require": {
5 | "must": true,
6 | "invalid": "20005"
7 | },
8 | "typeof": {
9 | "type": "object",
10 | "invalid": "20001"
11 | }
12 | },
13 | "fromUserId": {
14 | "require": {
15 | "must": true,
16 | "invalid": "20005"
17 | },
18 | "length": {
19 | "max": 64,
20 | "min": 1,
21 | "invalid": "20003"
22 | }
23 | },
24 | "platform": {
25 | "require": {
26 | "must": true,
27 | "invalid": "20005"
28 | },
29 | "size": {
30 | "max": 2,
31 | "min": 1,
32 | "invalid": "20002"
33 | },
34 | "typeof": {
35 | "type": "array",
36 | "invalid": "20001"
37 | }
38 | },
39 | "message": {
40 | "require": {
41 | "must": true,
42 | "invalid": "20005"
43 | },
44 | "typeof": {
45 | "type": "object",
46 | "invalid": "20001"
47 | }
48 | },
49 | "audience": {
50 | "require": {
51 | "must": true,
52 | "invalid": "20005"
53 | },
54 | "typeof": {
55 | "type": "object",
56 | "invalid": "20001"
57 | }
58 | },
59 | "notification": {
60 | "require": {
61 | "must": true,
62 | "invalid": "20005"
63 | },
64 | "typeof": {
65 | "type": "object",
66 | "invalid": "20001"
67 | }
68 | }
69 | },
70 | "push": {
71 | "_self": {
72 | "require": {
73 | "must": true,
74 | "invalid": "20005"
75 | },
76 | "typeof": {
77 | "type": "object",
78 | "invalid": "20001"
79 | }
80 | },
81 | "platform": {
82 | "require": {
83 | "must": true,
84 | "invalid": "20005"
85 | },
86 | "size": {
87 | "max": 2,
88 | "min": 1,
89 | "invalid": "20002"
90 | },
91 | "typeof": {
92 | "type": "array",
93 | "invalid": "20001"
94 | }
95 | },
96 | "audience": {
97 | "require": {
98 | "must": true,
99 | "invalid": "20005"
100 | },
101 | "typeof": {
102 | "type": "object",
103 | "invalid": "20001"
104 | }
105 | },
106 | "notification": {
107 | "require": {
108 | "must": true,
109 | "invalid": "20005"
110 | },
111 | "typeof": {
112 | "type": "object",
113 | "invalid": "20001"
114 | }
115 | }
116 | }
117 | }
--------------------------------------------------------------------------------
/jsonsource/sensitiveword/verify.json:
--------------------------------------------------------------------------------
1 | {
2 | "rule": {
3 | "_self": {
4 | "require": {
5 | "must": true,
6 | "invalid": "20005"
7 | },
8 | "typeof": {
9 | "type": "object",
10 | "invalid": "20001"
11 | }
12 | },
13 | "keyword": {
14 | "require": {
15 | "must": true,
16 | "invalid": "20005"
17 | },
18 | "length": {
19 | "max": 64,
20 | "min": 1,
21 | "invalid": "20003"
22 | }
23 | },
24 | "replace": {
25 | "length": {
26 | "max": 64,
27 | "min": 1,
28 | "invalid": "20003"
29 | }
30 | }
31 | },
32 | "sensitive": {
33 | "_self": {
34 | "require": {
35 | "must": true,
36 | "invalid": "20005"
37 | },
38 | "typeof": {
39 | "type": "object",
40 | "invalid": "20001"
41 | }
42 | },
43 | "keyword": {
44 | "require": {
45 | "must": true,
46 | "invalid": "20005"
47 | },
48 | "length": {
49 | "max": 64,
50 | "min": 1,
51 | "invalid": "20003"
52 | }
53 | },
54 | "replace": {
55 | "length": {
56 | "max": 64,
57 | "min": 1,
58 | "invalid": "20003"
59 | }
60 | },
61 | "keywords": {
62 | "require": {
63 | "must": true,
64 | "invalid": "20005"
65 | },
66 | "size": {
67 | "max": 50,
68 | "min": 1,
69 | "invalid": "20003"
70 | },
71 | "typeof": {
72 | "type": "array",
73 | "invalid": "20001"
74 | }
75 | }
76 | }
77 | }
--------------------------------------------------------------------------------
/jsonsource/user/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "register": {
3 | "docs": "http://rongcloud.cn/docs/server.html#user_get_token",
4 | "url": "user/getToken",
5 | "params": {
6 | "user": {
7 | "id": "aFo990k",
8 | "name": "Martin",
9 | "portrait": "http://image.rongcloud.cn/portrait.png"
10 | }
11 | },
12 | "response": {
13 | "success": {
14 | "code": 200,
15 | "userId": "jlk456j5",
16 | "token": "MAo+IhwqEO3+h/DdXg1w6m20V27XsDF2Dx+"
17 | },
18 | "fail": {
19 | "2007": {
20 | "code": "2007",
21 | "errorMessage": "开发环境下注册用户上限为 100 个,生产环境下注册用户不超过 100 可免费使用,超过 100 需要开通 IM 商用版"
22 | },
23 | "20003": {
24 | "code": "1002",
25 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
26 | },
27 | "20005": {
28 | "code": "1002",
29 | "errorMessage": "{{name}} 参数为必传项"
30 | },
31 | "20001": {
32 | "code": "1501",
33 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
34 | },
35 | "20007": {
36 | "code": "1002",
37 | "errorMessage": "protrait 不是合法地址,请检查 protrait 是否正确"
38 | },
39 | "1004": {
40 | "code": "1004",
41 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
42 | },
43 | "1008": {
44 | "code": "1008",
45 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
46 | }
47 | }
48 | }
49 |
50 | },
51 | "update": {
52 | "docs": "http://rongcloud.cn/docs/server.html#user_refresh",
53 | "url": "user/refresh",
54 | "params": {
55 | "user": {
56 | "id": "aFo990k",
57 | "name": "Martin",
58 | "portrait": "http://image.rongcloud.cn/portrait.png"
59 | }
60 | },
61 | "response": {
62 | "success": {
63 | "code": "200",
64 | "errorMessage": "成功返回"
65 | },
66 | "fail": {
67 | "20003": {
68 | "code": "1002",
69 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
70 | },
71 | "20005": {
72 | "code": "1002",
73 | "errorMessage": "{{name}} 参数为必传项"
74 | },
75 | "20007": {
76 | "code": "1002",
77 | "errorMessage": "protrait 不是合法地址,请检查 protrait 是否正确"
78 | },
79 | "1004": {
80 | "code": "1004",
81 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
82 | },
83 | "1008": {
84 | "code": "1008",
85 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
86 | }
87 | }
88 | }
89 | }
90 | }
--------------------------------------------------------------------------------
/jsonsource/user/blacklist/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "add": {
3 | "docs": "http://rongcloud.cn/docs/server.html#user_blacklist_add",
4 | "url": "user/blacklist/add",
5 | "params": {
6 | "user": {
7 | "id": "kkfh091",
8 | "blacklist": [{
9 | "id": "kkfh091"
10 | }]
11 | }
12 | },
13 | "response": {
14 | "success": {
15 | "code": "200",
16 | "errorMessage": "成功返回"
17 | },
18 | "fail": {
19 | "20002": {
20 | "code": "1502",
21 | "errorMessage": "{{name}} 数量超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
22 | },
23 | "20003": {
24 | "code": "1002",
25 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
26 | },
27 | "1004": {
28 | "code": "1004",
29 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
30 | },
31 | "1008": {
32 | "code": "1008",
33 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
34 | },
35 | "20005": {
36 | "code": "1002",
37 | "errorMessage": "{{name}} 参数为必传项"
38 | },
39 | "20001": {
40 | "code": "1501",
41 | "errorMessage": "{{name}} 类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}} "
42 | }
43 | }
44 | }
45 | },
46 | "remove": {
47 | "docs": "http://rongcloud.cn/docs/server.html#user_blacklist_remove",
48 | "url": "user/blacklist/remove",
49 | "params": {
50 | "user": {
51 | "id": "kkfh091",
52 | "blacklist": [{
53 | "id": "kkfh091"
54 | }]
55 | }
56 | },
57 | "response": {
58 | "success": {
59 | "code": "200",
60 | "errorMessage": "成功返回"
61 | },
62 | "fail": {
63 | "20002": {
64 | "code": "1502",
65 | "errorMessage": "{{name}} 数量超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
66 | },
67 | "20003": {
68 | "code": "1002",
69 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
70 | },
71 | "20005": {
72 | "code": "1002",
73 | "errorMessage": "{{name}} 参数为必传项"
74 | },
75 | "20001": {
76 | "code": "1501",
77 | "errorMessage": "{{name}} 类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}} "
78 | },
79 | "1004": {
80 | "code": "1004",
81 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
82 | },
83 | "1008": {
84 | "code": "1008",
85 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
86 | }
87 | }
88 | }
89 | },
90 | "getList": {
91 | "docs": "http://rongcloud.cn/docs/server.html#user_blacklist_query",
92 | "url": "user/blacklist/query",
93 | "params": {
94 | "user": {
95 | "id": "kkfh091"
96 | }
97 | },
98 | "success": {
99 | "code": "200",
100 | "users": [{
101 | "id": "kkfh091"
102 | }]
103 | },
104 | "response": {
105 | "fail": {
106 | "20003": {
107 | "code": "1002",
108 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
109 | },
110 | "20005": {
111 | "code": "1002",
112 | "errorMessage": "{{name}} 参数为必传项"
113 | },
114 | "1004": {
115 | "code": "1004",
116 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
117 | },
118 | "1008": {
119 | "code": "1008",
120 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
121 | }
122 | }
123 | }
124 | }
125 | }
--------------------------------------------------------------------------------
/jsonsource/user/block/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "add": {
3 | "docs": "http://rongcloud.cn/docs/server.html#user_block_add",
4 | "url": "user/block",
5 | "params": {
6 | "user": {
7 | "id": "aFo990k",
8 | "minute": 30
9 | }
10 | },
11 | "response": {
12 | "success": {
13 | "code": "200",
14 | "errorMessage": "成功返回"
15 | },
16 | "fail": {
17 | "20004": {
18 | "code": "1002",
19 | "errorMessage": "minute 不正确,minute >= 1 且 minute <= 43200 单位: 分钟"
20 | },
21 | "20001": {
22 | "code": "1501",
23 | "errorMessage": "{{name}} 类型不正确,请检查参数类型,应该为 {{type}} 传入为 {{currentType}}"
24 | },
25 | "20005": {
26 | "code": "1002",
27 | "errorMessage": "{{name}} 参数为必传项"
28 | },
29 | "1004": {
30 | "code": "1004",
31 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
32 | },
33 | "1008": {
34 | "code": "1008",
35 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
36 | }
37 | }
38 | }
39 | },
40 | "remove": {
41 | "docs": "http://rongcloud.cn/docs/server.html#user_unblock",
42 | "url": "user/unblock",
43 | "params": {
44 | "user": {
45 | "id": "aFo990k"
46 | }
47 | },
48 | "response": {
49 | "success": {
50 | "code": "200",
51 | "errorMessage": "成功返回"
52 | },
53 | "fail": {
54 | "20001": {
55 | "code": "1501",
56 | "errorMessage": "minute 参数不正确,请检查参数类型,应该为 number 传入为 {{currentType}}"
57 | },
58 | "20005": {
59 | "code": "1002",
60 | "errorMessage": "{{name}} 参数为必传项"
61 | },
62 | "1004": {
63 | "code": "1004",
64 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
65 | },
66 | "1008": {
67 | "code": "1008",
68 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
69 | }
70 | }
71 | }
72 | },
73 | "getList": {
74 | "docs": "http://rongcloud.cn/docs/server.html#user_block_query",
75 | "url": "user/block/query",
76 | "params": {},
77 | "response": {
78 | "success": {
79 | "code": "200",
80 | "errorMessage": "成功返回"
81 | },
82 | "fail": {
83 | "1004": {
84 | "code": "1004",
85 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
86 | },
87 | "1008": {
88 | "code": "1008",
89 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
90 | }
91 | }
92 | }
93 | }
94 | }
--------------------------------------------------------------------------------
/jsonsource/user/online-status/api.json:
--------------------------------------------------------------------------------
1 | {
2 | "check": {
3 | "docs": "http://rongcloud.cn/docs/server.html#user_check_online",
4 | "url": "user/checkOnline",
5 | "params": {
6 | "user": {
7 | "id": "aFo990k"
8 | }
9 | },
10 | "response": {
11 | "success": {
12 | "code": 200,
13 | "status": 1
14 | },
15 | "fail": {
16 | "20003": {
17 | "code": "1002",
18 | "errorMessage": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}} 单位: 字节"
19 | },
20 | "20005": {
21 | "code": "1002",
22 | "errorMessage": "id 为必传项"
23 | },
24 | "20001": {
25 | "code": "1501",
26 | "errorMessage": "user 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
27 | },
28 | "1004": {
29 | "code": "1004",
30 | "errorMessage": "签名错误, 请排查 Appkey、Secret 是否正确"
31 | },
32 | "1008": {
33 | "code": "1008",
34 | "errorMessage": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
35 | }
36 | }
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/messages/BaseMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace io.rong.messages
7 | {
8 | public abstract class BaseMessage
9 | {
10 | public abstract String GetType();
11 |
12 | override
13 | public abstract String ToString();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/messages/CmdMsgMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 | /**
10 | *
11 | * 通用命令通知消息。此类型消息没有 Push 通知。此类型消息没有 Push 通知,与通用命令通知消息的区别是不存储、不计数。
12 | *
13 | */
14 | public class CmdMsgMessage : BaseMessage
15 |
16 | {
17 | [JsonProperty(PropertyName = "name")]
18 | private String name = "";
19 | [JsonProperty(PropertyName = "data")]
20 | private String data = "";
21 | private static readonly String TYPE = "RC:CmdMsg";
22 |
23 | [JsonIgnore]
24 | public string Name { get => name; set => name = value; }
25 | [JsonIgnore]
26 | public string Data { get => data; set => data = value; }
27 |
28 | public CmdMsgMessage(String name, String data)
29 | {
30 | this.name = name;
31 | this.data = data;
32 | }
33 |
34 | override
35 | public String GetType()
36 | {
37 | return TYPE;
38 | }
39 |
40 | override
41 | public String ToString()
42 | {
43 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/messages/CmdNtfMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 |
10 | /**
11 | *
12 | * 通用命令通知消息。此类型消息没有 Push 通知。
13 | *
14 | */
15 | public class CmdNtfMessage : BaseMessage
16 |
17 | {
18 | [JsonProperty(PropertyName = "name")]
19 | private String name = "";
20 | [JsonProperty(PropertyName = "data")]
21 | private String data = "";
22 | private static readonly String TYPE = "RC:CmdNtf";
23 |
24 | [JsonIgnore]
25 | public string Name { get => name; set => name = value; }
26 | [JsonIgnore]
27 | public string Data { get => data; set => data = value; }
28 |
29 | public CmdNtfMessage(String name, String data)
30 | {
31 | this.name = name;
32 | this.data = data;
33 | }
34 | override
35 | public String GetType()
36 | {
37 | return TYPE;
38 | }
39 |
40 | override
41 | public String ToString()
42 | {
43 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/messages/ContactNtfMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 | /**
10 | *
11 | * 添加联系人消息。
12 | *
13 | */
14 | public class ContactNtfMessage : BaseMessage
15 |
16 | {
17 | [JsonProperty(PropertyName = "operation")]
18 | private String operation = "";
19 | [JsonProperty(PropertyName = "extra")]
20 | private String extra = "";
21 | [JsonProperty(PropertyName = "sourceUserId")]
22 | private String sourceUserId = "";
23 | [JsonProperty(PropertyName = "targetUserId")]
24 | private String targetUserId = "";
25 | [JsonProperty(PropertyName = "message")]
26 | private String message = "";
27 | private static readonly String TYPE = "RC:ContactNtf";
28 |
29 | [JsonIgnore]
30 | public string Operation { get => operation; set => operation = value; }
31 | [JsonIgnore]
32 | public string Extra { get => extra; set => extra = value; }
33 | [JsonIgnore]
34 | public string SourceUserId { get => sourceUserId; set => sourceUserId = value; }
35 | [JsonIgnore]
36 | public string TargetUserId { get => targetUserId; set => targetUserId = value; }
37 | [JsonIgnore]
38 | public string Message { get => message; set => message = value; }
39 |
40 | public ContactNtfMessage(String operation, String extra, String sourceUserId, String targetUserId, String message)
41 | {
42 | this.operation = operation;
43 | this.extra = extra;
44 | this.sourceUserId = sourceUserId;
45 | this.targetUserId = targetUserId;
46 | this.message = message;
47 | }
48 | override
49 | public String GetType()
50 | {
51 | return TYPE;
52 | }
53 |
54 | override
55 | public String ToString()
56 | {
57 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/messages/CustomTxtMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 | /**
10 | *
11 | * 自定义消息
12 | *
13 | */
14 | public class CustomTxtMessage : BaseMessage
15 |
16 | {
17 | [JsonProperty(PropertyName = "content")]
18 | private String content = "";
19 | private static readonly String TYPE = "RC:TxtMsg";
20 |
21 | [JsonIgnore]
22 | public string Content { get => content; set => content = value; }
23 |
24 | public CustomTxtMessage(String content)
25 | {
26 | this.content = content;
27 | }
28 | override
29 | public String GetType()
30 | {
31 | return TYPE;
32 | }
33 |
34 | /**
35 | * 获取自定义消息内容。
36 | *
37 | * @return String
38 | */
39 | public String getContent()
40 | {
41 | return content;
42 | }
43 |
44 | /**
45 | * @param content 设置自定义消息内容。
46 | *
47 | *
48 | */
49 | public void setContent(String content)
50 | {
51 | this.content = content;
52 | }
53 |
54 | override
55 | public String ToString()
56 | {
57 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/messages/ImgMessage.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.message
9 | {
10 |
11 | /**
12 | *
13 | * 图片消息。
14 | *
15 | */
16 | public class ImgMessage : BaseMessage
17 |
18 | {
19 | [JsonProperty(PropertyName = "content")]
20 | private String content = "";
21 | [JsonProperty(PropertyName = "extra")]
22 | private String extra = "";
23 | [JsonProperty(PropertyName = "imageUri")]
24 | private String imageUri = "";
25 | private static readonly String TYPE = "RC:ImgMsg";
26 |
27 | [JsonIgnore]
28 | public string Content { get => content; set => content = value; }
29 | [JsonIgnore]
30 | public string Extra { get => extra; set => extra = value; }
31 | [JsonIgnore]
32 | public string ImageUri { get => imageUri; set => imageUri = value; }
33 |
34 | public static string TYPE1=> TYPE;
35 |
36 | public ImgMessage(String content, String extra, String imageUri)
37 | {
38 | this.content = content;
39 | this.extra = extra;
40 | this.imageUri = imageUri;
41 | }
42 | override
43 | public String GetType()
44 | {
45 | return TYPE;
46 | }
47 |
48 | override
49 | public String ToString()
50 | {
51 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/messages/ImgTextMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 |
10 | /**
11 | *
12 | * 图文消息。
13 | *
14 | */
15 | public class ImgTextMessage : BaseMessage
16 |
17 | {
18 | [JsonProperty(PropertyName = "content")]
19 | private String content = "";
20 | [JsonProperty(PropertyName = "extra")]
21 | private String extra = "";
22 | [JsonProperty(PropertyName = "title")]
23 | private String title = "";
24 | [JsonProperty(PropertyName = "imageUri")]
25 | private String imageUri = "";
26 | [JsonProperty(PropertyName = "conturlent")]
27 | private String url = "";
28 | private static readonly String TYPE = "RC:ImgTextMsg";
29 |
30 | [JsonIgnore]
31 | public string Content { get => content; set => content = value; }
32 | [JsonIgnore]
33 | public string Extra { get => extra; set => extra = value; }
34 | [JsonIgnore]
35 | public string Title { get => title; set => title = value; }
36 | [JsonIgnore]
37 | public string ImageUri { get => imageUri; set => imageUri = value; }
38 | [JsonIgnore]
39 | public string Url { get => url; set => url = value; }
40 |
41 | public static string TYPE1 => TYPE;
42 |
43 | public ImgTextMessage(String content, String extra, String title, String imageUri, String url)
44 | {
45 | this.content = content;
46 | this.extra = extra;
47 | this.title = title;
48 | this.imageUri = imageUri;
49 | this.url = url;
50 | }
51 | override
52 | public String GetType()
53 | {
54 | return TYPE;
55 | }
56 |
57 | override
58 | public String ToString()
59 | {
60 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
61 | }
62 | }
63 | }
--------------------------------------------------------------------------------
/messages/InfoNtfMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 |
10 | /**
11 | *
12 | * 提示条(小灰条)通知消息。此类型消息没有 Push 通知。
13 | *
14 | */
15 | public class InfoNtfMessage : BaseMessage
16 |
17 | {
18 | [JsonProperty(PropertyName = "content")]
19 | private String message = "";
20 | [JsonProperty(PropertyName = "content")]
21 | private String extra = "";
22 | private static readonly String TYPE = "RC:InfoNtf";
23 |
24 | [JsonIgnore]
25 | public string Message { get => message; set => message = value; }
26 | [JsonIgnore]
27 | public string Extra { get => extra; set => extra = value; }
28 |
29 | public static string TYPE1 => TYPE;
30 |
31 | public InfoNtfMessage(String message, String extra)
32 | {
33 | this.message = message;
34 | this.extra = extra;
35 | }
36 | override
37 | public String GetType()
38 | {
39 | return TYPE;
40 | }
41 |
42 |
43 | /**
44 | * @param extra 设置附加信息(如果开发者自己需要,可以自己在 App 端进行解析)。
45 | *
46 | *
47 | */
48 | public void setExtra(String extra)
49 | {
50 | this.extra = extra;
51 | }
52 |
53 | override
54 | public String ToString()
55 | {
56 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/messages/LBSMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 |
10 | /**
11 | *
12 | * 位置消息。
13 | *
14 | */
15 | public class LBSMessage : BaseMessage
16 |
17 | {
18 | [JsonProperty(PropertyName = "content")]
19 | private String content = "";
20 | [JsonProperty(PropertyName = "extra")]
21 | private String extra = "";
22 | [JsonProperty(PropertyName = "latitude")]
23 | private double latitude = 0;
24 | [JsonProperty(PropertyName = "longitude")]
25 | private double longitude = 0;
26 | [JsonProperty(PropertyName = "poi")]
27 | private String poi = "";
28 | private static readonly String TYPE = "RC:LBSMsg";
29 |
30 | [JsonIgnore]
31 | public string Content { get => content; set => content = value; }
32 | [JsonIgnore]
33 | public string Extra { get => extra; set => extra = value; }
34 | [JsonIgnore]
35 | public double Latitude { get => latitude; set => latitude = value; }
36 | [JsonIgnore]
37 | public double Longitude { get => longitude; set => longitude = value; }
38 | [JsonIgnore]
39 | public string Poi { get => poi; set => poi = value; }
40 |
41 | public LBSMessage(String content, String extra, double latitude, double longitude, String poi)
42 | {
43 | this.content = content;
44 | this.extra = extra;
45 | this.latitude = latitude;
46 | this.longitude = longitude;
47 | this.poi = poi;
48 | }
49 | override
50 | public String GetType()
51 | {
52 | return TYPE;
53 | }
54 |
55 |
56 | override
57 | public String ToString()
58 | {
59 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/messages/ProfileNtfMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 | /**
10 | *
11 | * 资料通知消息。此类型消息没有 Push 通知。
12 | *
13 | */
14 | public class ProfileNtfMessage : BaseMessage
15 |
16 | {
17 | [JsonProperty(PropertyName = "operation")]
18 | private String operation = "";
19 | [JsonProperty(PropertyName = "data")]
20 | private String data = "";
21 | [JsonProperty(PropertyName = "extra")]
22 | private String extra = "";
23 | private static readonly String TYPE = "RC:ProfileNtf";
24 |
25 | [JsonIgnore]
26 | public string Operation { get => operation; set => operation = value; }
27 | [JsonIgnore]
28 | public string Data { get => data; set => data = value; }
29 | [JsonIgnore]
30 | public string Extra { get => extra; set => extra = value; }
31 |
32 | public ProfileNtfMessage(String operation, String data, String extra)
33 | {
34 | this.operation = operation;
35 | this.data = data;
36 | this.extra = extra;
37 | }
38 | override
39 | public String GetType()
40 | {
41 | return TYPE;
42 | }
43 |
44 |
45 |
46 | override
47 | public String ToString()
48 | {
49 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/messages/TxtMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 | /**
10 | *
11 | * 文本消息。
12 | *
13 | */
14 | public class TxtMessage : BaseMessage
15 |
16 | {
17 | [JsonProperty(PropertyName = "content")]
18 | private String content = "";
19 | [JsonProperty(PropertyName = "extra")]
20 | private String extra = "";
21 | private static readonly String TYPE = "RC:TxtMsg";
22 |
23 | [JsonIgnore]
24 | public string Content { get => content; set => content = value; }
25 | [JsonIgnore]
26 | public string Extra { get => extra; set => extra = value; }
27 |
28 | public TxtMessage(String content, String extra)
29 | {
30 | this.content = content;
31 | this.extra = extra;
32 | }
33 |
34 | override
35 | public String GetType()
36 | {
37 | return TYPE;
38 | }
39 |
40 |
41 | override
42 | public String ToString()
43 | {
44 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/messages/VoiceMessage.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.messages
8 | {
9 | /**
10 | *
11 | * 语音消息。
12 | *
13 | */
14 | public class VoiceMessage : BaseMessage
15 |
16 | {
17 | [JsonProperty(PropertyName = "content")]
18 | private String content = "";
19 | [JsonProperty(PropertyName = "extra")]
20 | private String extra = "";
21 | [JsonProperty(PropertyName = "duration")]
22 | private long duration = 0L;
23 | private static readonly String TYPE = "RC:VcMsg";
24 |
25 | [JsonIgnore]
26 | public string Content { get => content; set => content = value; }
27 | [JsonIgnore]
28 | public string Extra { get => extra; set => extra = value; }
29 | [JsonIgnore]
30 | public long Duration { get => duration; set => duration = value; }
31 |
32 | public VoiceMessage(String content, String extra, long duration)
33 | {
34 | this.content = content;
35 | this.extra = extra;
36 | this.duration = duration;
37 | }
38 | override
39 | public String GetType()
40 | {
41 | return TYPE;
42 | }
43 |
44 |
45 | override
46 | public String ToString()
47 | {
48 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/methods/chatroom/whitelist/Whitelist.cs:
--------------------------------------------------------------------------------
1 | using io.rong.methods.user.block;
2 | using io.rong.methods.user.onlineStatus;
3 | using io.rong.models.conversation;
4 | using io.rong.models;
5 | using io.rong.models.response;
6 | using io.rong.models.push;
7 | using io.rong.util;
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 | using System.Web;
13 | using io.rong.models.chatroom;
14 |
15 | namespace io.rong.methods.chatroom.whitelist
16 | {
17 | public class Whitelist
18 |
19 | {
20 | private static readonly Encoding UTF8 = Encoding.UTF8;
21 | private static readonly String PATH = "chatroom/whitelist";
22 | private String appKey;
23 | private String appSecret;
24 | private RongCloud rongCloud;
25 | private User user;
26 | private Messages message;
27 |
28 | public string AppKey { get => appKey; set => appKey = value; }
29 | public string AppSecret { get => appSecret; set => appSecret = value; }
30 | internal RongCloud RongCloud
31 | {
32 | get => rongCloud;
33 | set
34 | {
35 | rongCloud = value;
36 | message.RongCloud = value;
37 | user.RongCloud = value;
38 | }
39 | }
40 | internal User User { get => user; set => user = value; }
41 | internal Messages Message { get => message; set => message = value; }
42 |
43 | public Whitelist(String appKey, String appSecret)
44 | {
45 | this.appKey = appKey;
46 | this.appSecret = appSecret;
47 | this.message = new Messages(appKey, appSecret);
48 | this.user = new User(appKey, appSecret);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/methods/message/Message.cs:
--------------------------------------------------------------------------------
1 | using io.rong.methods.messages._private;
2 | using io.rong.methods.messages.chatroom;
3 | using io.rong.methods.messages.discussion;
4 | using io.rong.methods.messages.system;
5 | using io.rong.methods.messages.history;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Text.RegularExpressions;
11 |
12 | namespace io.rong.methods.message
13 | {
14 | public class Message
15 |
16 | {
17 |
18 | private static readonly Encoding UTF8 = Encoding.UTF8;
19 | private static readonly String PATH = "message";
20 | private static String method = "";
21 | private String appKey;
22 | private String appSecret;
23 | public Private msgPrivate;
24 | public Chatroom chatroom;
25 | public Discussion discussion;
26 | public messages.group.Group group;
27 | public History history;
28 | public MsgSystem system;
29 | private RongCloud rongCloud;
30 |
31 | public RongCloud RongCloud
32 | {
33 | get => rongCloud;
34 | set
35 | {
36 | this.rongCloud = value;
37 | msgPrivate.RongCloud = value;
38 | chatroom.RongCloud = value;
39 | discussion.RongCloud = value;
40 | group.RongCloud = value;
41 | history.RongCloud = value;
42 | system.RongCloud = value;
43 | }
44 | }
45 |
46 | public Message(String appKey, String appSecret)
47 | {
48 | this.appKey = appKey;
49 | this.appSecret = appSecret;
50 | this.msgPrivate = new Private(appKey, appSecret);
51 | this.chatroom = new Chatroom(appKey, appSecret);
52 | this.discussion = new Discussion(appKey, appSecret);
53 | this.group = new messages.group.Group(appKey, appSecret);
54 | this.history = new History(appKey, appSecret);
55 | this.system = new MsgSystem(appKey, appSecret);
56 |
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/methods/push/Broadcast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Newtonsoft.Json;
6 | using io.rong.models;
7 | using io.rong.models.response;
8 | using io.rong.models.push;
9 | using io.rong.util;
10 | using System.Web;
11 |
12 | namespace io.rong.methods.push
13 | {
14 | public class Broadcast
15 | {
16 | private static String UTF8 = "UTF-8";
17 | private static String PATH = "push";
18 | private String appKey;
19 | private String appSecret;
20 | public RongCloud RongCloud;
21 |
22 | public RongCloud GetRongCloud()
23 | {
24 | return RongCloud;
25 | }
26 |
27 | public void SetRongCloud(RongCloud rongCloud)
28 | {
29 | this.RongCloud = rongCloud;
30 | }
31 |
32 | public Broadcast(String appKey, String appSecret)
33 | {
34 | this.appKey = appKey;
35 | this.appSecret = appSecret;
36 | }
37 |
38 | /**
39 | * 广播
40 | *
41 | * @param broadcast 广播数据
42 | * @return PushResult
43 | **/
44 | public PushResult Send(BroadcastModel broadcast)
45 | {
46 | // 需要校验的字段
47 | String message = CommonUtil.CheckFiled(broadcast, PATH, CheckMethod.BROADCAST);
48 | if (null != message)
49 | {
50 | return (PushResult)RongJsonUtil.JsonStringToObj(message);
51 | }
52 |
53 | String body = RongJsonUtil.ObjToJsonString(broadcast);
54 |
55 | String result = RongHttpClient.ExecutePost(appKey, appSecret, body,
56 | RongCloud.ApiHostType.Type + "/push.json", "application/json");
57 |
58 | return (PushResult)RongJsonUtil.JsonStringToObj(CommonUtil.GetResponseByCode(PATH, CheckMethod.BROADCAST, result));
59 |
60 | }
61 |
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/methods/push/Push.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Newtonsoft.Json;
6 | using io.rong.models;
7 | using io.rong.models.response;
8 | using io.rong.models.push;
9 | using io.rong.util;
10 | using System.Web;
11 |
12 | namespace io.rong.methods.push
13 | {
14 | /**
15 | * 推送服务
16 | *
17 | * docs https://www.rongcloud.cn/docs/push_service.html#broadcast
18 | * https://www.rongcloud.cn/docs/push_service.html#push
19 | */
20 | public class Push
21 | {
22 |
23 | private static String UTF8 = "UTF-8";
24 | private static String PATH = "push";
25 | private String appKey;
26 | private String appSecret;
27 | public RongCloud RongCloud;
28 |
29 | public RongCloud GetRongCloud()
30 | {
31 | return RongCloud;
32 | }
33 |
34 | public void SetRongCloud(RongCloud rongCloud)
35 | {
36 | this.RongCloud = rongCloud;
37 | }
38 |
39 | public Push(String appKey, String appSecret)
40 | {
41 | this.appKey = appKey;
42 | this.appSecret = appSecret;
43 | }
44 |
45 | /**
46 | * 推送
47 | *
48 | * @param push 推送数据
49 | * @return PushResult
50 | **/
51 | public PushResult Send(PushModel push)
52 | {
53 | // 需要校验的字段
54 | String message = CommonUtil.CheckFiled(push, PATH, CheckMethod.PUSH);
55 | if (null != message)
56 | {
57 | return (PushResult)RongJsonUtil.JsonStringToObj(message);
58 | }
59 |
60 | String body = RongJsonUtil.ObjToJsonString(push);
61 |
62 | String result = RongHttpClient.ExecutePost(appKey, appSecret, body,
63 | RongCloud.ApiHostType.Type + "/push.json", "application/json");
64 |
65 | return (PushResult)RongJsonUtil.JsonStringToObj(CommonUtil.GetResponseByCode(PATH, CheckMethod.BROADCAST, result));
66 |
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/methods/user/onlineStatus/OnlineStatus.cs:
--------------------------------------------------------------------------------
1 | using io.rong.util;
2 | using io.rong.models;
3 | using io.rong.models.response;
4 | using io.rong.models.push;
5 | using io.rong.util;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Web;
11 |
12 | namespace io.rong.methods.user.onlineStatus
13 | {
14 | public class OnlineStatus
15 |
16 | {
17 | private static readonly Encoding UTF8 = Encoding.UTF8;
18 | private static readonly String PATH = "user/online-status";
19 | private String appKey;
20 | private String appSecret;
21 | private RongCloud rongCloud;
22 |
23 | public RongCloud RongCloud
24 | {
25 | get { return this.rongCloud; }
26 | set { this.rongCloud = value; }
27 | }
28 |
29 | public RongCloud getRongCloud()
30 | {
31 | return rongCloud;
32 | }
33 |
34 | public OnlineStatus(String appKey, String appSecret)
35 | {
36 | this.appKey = appKey;
37 | this.appSecret = appSecret;
38 |
39 | }
40 | /**
41 | * 检查用户在线状态 方法(每秒钟限100次)
42 | * 请不要频繁循环调用此接口,而是选择合适的频率和时机调用,此接口设置了一定的频率限制。
43 | *
44 | * url /user/checkOnline
45 | * docs http://www.rongcloud.cn/docs/server.html#user_check_online
46 | *
47 | * @param user:用户 id(必传)
48 | *
49 | * @return CheckOnlineResult
50 | **/
51 | public CheckOnlineResult Check(UserModel user)
52 | {
53 | //参数校验
54 | String message = CommonUtil.CheckFiled(user, PATH, CheckMethod.CHECK);
55 | if (null != message)
56 | {
57 | return (CheckOnlineResult)RongJsonUtil.JsonStringToObj(message);
58 | }
59 | StringBuilder sb = new StringBuilder();
60 | sb.Append("&userId=").Append(HttpUtility.UrlEncode(user.id.ToString(), UTF8));
61 | String body = sb.ToString();
62 | if (body.IndexOf("&") == 0)
63 | {
64 | body = body.Substring(1, body.Length);
65 | }
66 |
67 | String result = RongHttpClient.ExecutePost(appKey, appSecret, body,
68 | RongCloud.ApiHostType.Type + "/user/checkOnline.json", "application/x-www-form-urlencoded");
69 |
70 | return (CheckOnlineResult)RongJsonUtil.JsonStringToObj(CommonUtil.GetResponseByCode(PATH, CheckMethod.CHECK, result));
71 |
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/models/BlockUsers.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models
8 | {
9 | public class BlockUsers
10 |
11 | {
12 | // 被封禁用户 ID。
13 | [JsonProperty(PropertyName = "id")]
14 | String id;
15 | // 封禁结束时间。
16 | [JsonProperty(PropertyName = "blockEndTime")]
17 | String blockEndTime;
18 |
19 | [JsonIgnore]
20 | public string Id { get => id; set => id = value; }
21 | [JsonIgnore]
22 | public string BlockEndTime { get => blockEndTime; set => blockEndTime = value; }
23 |
24 | public BlockUsers(String id, String blockEndTime)
25 | {
26 | this.id = id;
27 | this.blockEndTime = blockEndTime;
28 | }
29 |
30 | override
31 | public String ToString()
32 | {
33 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/models/CheckMethod.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace io.rong.models
7 | {
8 | public class CheckMethod
9 |
10 | {
11 | public static String ADD = "add";
12 | public static String GETLIST = "getList";
13 | public static String REMOVE = "remove";
14 | public static String CREATE = "create";
15 | public static String DESTORY = "destory";
16 | public static String GET_MEMBERS = "getMembers";
17 | public static String ISEXIST = "isExist";
18 | public static String STOP_DISTRIBUTION = "stop";
19 | public static String RESUME_DISTRIBUTION = "resume";
20 | public static String MUTE = "mute";
21 | public static String UNMUTE = "unmute";
22 | public static String GET = "get";
23 | public static String SYNC = "sync";
24 | public static String JOIN = "join";
25 | public static String QUIT = "quit";
26 | public static String KICK = "kick";
27 | public static String DISMISS = "dismiss";
28 | public static String REFRESH = "refresh";
29 | public static String UPDATE = "update";
30 | public static String GET_MEMBERS_LIST = "getMemberList";
31 | public static String PUSH = "push";
32 | public static String SET_TAG = "setTag";
33 | public static String BATCH_DELETE = "batchDelete";
34 | public static String GET_IMAGE = "getImage";
35 | public static String VERIFY = "verify";
36 | public static String SEND = "send";
37 | public static String REGISTER = "register";
38 | public static String GET_TOKEN = "getToken";
39 | public static String INVITE = "invite";
40 |
41 | public static String TAG_SET = "setTag";
42 | public static String TAG_BATCH_SET = "batchSetTag";
43 | public static String TAG_GET = "getTag";
44 |
45 |
46 | public static String CHECK = "check";
47 | public static String QUERY = "query";
48 | public static String PUBLISH = "send";
49 | public static String SENDTEMPLATE = "sendTemplate";
50 | public static String PUBLISHTEMPLATE = "sendTemplate";
51 | public static String BROADCAST = "broadcast";
52 | public static String SET_USER_TAG = "setUserTag";
53 | public static String RECALL = "recall";
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/models/Result.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models
8 | {
9 | public class Result
10 |
11 | {
12 | /**
13 | * 返回码,200 为正常。
14 | *
15 | */
16 | [JsonProperty(PropertyName = "code")]
17 | protected int code;
18 | /**
19 | * 错误信息。
20 | *
21 | */
22 | [JsonProperty(PropertyName = "msg")]
23 | protected String msg;
24 |
25 | [JsonIgnore]
26 | public int Code { get => code; set => code = value; }
27 | [JsonIgnore]
28 | public string Msg { get => msg; set => msg = value; }
29 |
30 | public Result(int code, String msg)
31 | {
32 | this.code = code;
33 | this.msg = msg;
34 | }
35 |
36 | public Result()
37 | {
38 |
39 | }
40 | /**
41 | * 设置code
42 | *
43 | */
44 | public void setCode(int code)
45 | {
46 | this.code = code;
47 | }
48 |
49 | /**
50 | * 获取code
51 | *
52 | * @return int
53 | */
54 | public int getCode()
55 | {
56 | return code;
57 | }
58 |
59 | /**
60 | * 获取msg
61 | *
62 | * @return String
63 | */
64 | public String getMsg()
65 | {
66 | return this.msg;
67 | }
68 | /**
69 | * 设置msg
70 | *
71 | */
72 | public void setMsg(String msg)
73 | {
74 | this.msg = msg;
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/models/chatroom/ChatroomMember.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.chatroom
8 | {
9 | public class ChatroomMember
10 |
11 | {
12 | /**
13 | * 聊天室用户Id。
14 | * */
15 | [JsonProperty(PropertyName = "id")]
16 | private String id;
17 | /**
18 | * 加入聊天室时间。
19 | * */
20 | [JsonProperty(PropertyName = "time")]
21 | private String time;
22 | /**
23 | * 聊天室ID
24 | * */
25 | [JsonProperty(PropertyName = "chatroomId")]
26 | private String chatroomId;
27 |
28 | [JsonProperty(PropertyName = "munite")]
29 | private int munite;
30 |
31 | [JsonIgnore]
32 | public string Id { get => id; set => id = value; }
33 | [JsonIgnore]
34 | public string Time { get => time; set => time = value; }
35 | [JsonIgnore]
36 | public string ChatroomId { get => chatroomId; set => chatroomId = value; }
37 | [JsonIgnore]
38 | public int Munite { get => munite; set => munite = value; }
39 |
40 | public ChatroomMember():base()
41 | {
42 |
43 | }
44 | public ChatroomMember(String id, String time)
45 | {
46 | this.id = id;
47 | this.time = time;
48 | }
49 |
50 | public ChatroomMember(String id, String chatroomId, String time)
51 | {
52 | this.id = id;
53 | this.chatroomId = chatroomId;
54 | this.time = time;
55 | }
56 |
57 | /**
58 | * 获取禁言时长
59 | *
60 | * @return String
61 | */
62 | public int getMunite()
63 | {
64 | return this.munite;
65 | }
66 | /**
67 | * 设置munite
68 | *
69 | *
70 | */
71 | public void setMunite(int munite)
72 | {
73 | this.munite = munite;
74 | }
75 | override
76 | public String ToString()
77 | {
78 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
79 | }
80 |
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/models/chatroom/ChatroomModel.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.chatroom
8 | {
9 | public class ChatroomModel
10 |
11 | {
12 | /**
13 | * 聊天室 id。
14 | */
15 | [JsonProperty(PropertyName ="id")]
16 | String id;
17 | /**
18 | * 聊天室名。
19 | */
20 | [JsonProperty(PropertyName = "name")]
21 | String name;
22 | /**
23 | * 聊天室创建时间。
24 | */
25 | [JsonProperty(PropertyName = "time")]
26 | String time;
27 | /**
28 | * 聊天室成员。
29 | */
30 | [JsonProperty(PropertyName = "members")]
31 | ChatroomMember[] members;
32 | /**
33 | * 聊天室成员数。
34 | */
35 | [JsonProperty(PropertyName = "count")]
36 | int count;
37 | /**
38 | * 加入聊天室的先后顺序,1正序,2倒叙。
39 | */
40 | [JsonProperty(PropertyName = "order")]
41 | int order;
42 |
43 | /**
44 | * 禁言时间
45 | * */
46 | [JsonProperty(PropertyName = "minute")]
47 | int minute;
48 |
49 | [JsonIgnore]
50 | public string Id { get => id; set => id = value; }
51 | [JsonIgnore]
52 | public string Name { get => name; set => name = value; }
53 | [JsonIgnore]
54 | public string Time { get => time; set => time = value; }
55 | [JsonIgnore]
56 | public ChatroomMember[] Members { get => members; set => members = value; }
57 | [JsonIgnore]
58 | public int Count { get => count; set => count = value; }
59 | [JsonIgnore]
60 | public int Order { get => order; set => order = value; }
61 | [JsonIgnore]
62 | public int Minute { get => minute; set => minute = value; }
63 |
64 | public ChatroomModel() : base()
65 | {
66 |
67 | }
68 | /**
69 | * 聊天室构造函数 全量
70 | * */
71 | public ChatroomModel(String id, String name, String time, ChatroomMember[] members,
72 | int count, int order, int minute)
73 | {
74 | this.id = id;
75 | this.name = name;
76 | this.time = time;
77 | this.members = members;
78 | this.count = count;
79 | this.order = order;
80 | this.minute = minute;
81 | }
82 |
83 | override
84 | public String ToString()
85 | {
86 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/models/conversation/ConversationModel.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.conversation
8 | {
9 | public class ConversationModel
10 |
11 | {
12 | [JsonProperty(PropertyName = "type")]
13 | private String type;
14 | [JsonProperty(PropertyName = "userId")]
15 | private String userId;
16 | [JsonProperty(PropertyName = "targetId")]
17 | private String targetId;
18 |
19 | [JsonIgnore]
20 | public string Type { get => type; set => type = value; }
21 | [JsonIgnore]
22 | public string UserId { get => userId; set => userId = value; }
23 | [JsonIgnore]
24 | public string TargetId { get => targetId; set => targetId = value; }
25 |
26 | public ConversationModel()
27 | {
28 | }
29 |
30 | /**
31 | * 构造函数。
32 | *
33 | * @param type:会话类型。
34 | * @param userId:设置消息免打扰的用户 Id
35 | * @param targetId:目标Id
36 | *
37 | **/
38 | public ConversationModel(String type, String userId, String targetId)
39 | {
40 | this.type = type;
41 | this.userId = userId;
42 | this.targetId = targetId;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/models/group/GroupMember.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.group
8 | {
9 |
10 | public class GroupMember
11 | {
12 | /**
13 | * 群组成员Id。
14 | * */
15 | [JsonProperty(PropertyName = "id")]
16 | private String id;
17 | /**
18 | * 群组ID
19 | * */
20 | [JsonProperty(PropertyName = "goupId1.NET")]
21 | private String groupId;
22 | /**
23 | * 禁言时间
24 | * */
25 | [JsonProperty(PropertyName = "munite")]
26 | private int munite;
27 |
28 | public GroupMember() : base()
29 | {
30 | }
31 |
32 | public GroupMember(String id, String groupId, int munite)
33 | {
34 | this.id = id;
35 | this.groupId = groupId;
36 | this.munite = munite;
37 | }
38 | [JsonIgnore]
39 | public string Id { get => id; set => id = value; }
40 | [JsonIgnore]
41 | public string GroupId { get => groupId; set => groupId = value; }
42 | [JsonIgnore]
43 | public int Munite { get => munite; set => munite = value; }
44 |
45 | override
46 | public String ToString()
47 | {
48 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
49 | }
50 |
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/models/group/GroupModel.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.group
8 | {
9 | /**
10 | * 群组数据模型
11 | *
12 | * */
13 | public class GroupModel
14 |
15 | {
16 | /**
17 | * 群组id
18 | **/
19 | private String id;
20 | /**
21 | * 群组成员
22 | **/
23 | private GroupMember[] members;
24 | /**
25 | * 群组名
26 | **/
27 | private String name;
28 |
29 | /**
30 | * 禁言时间
31 | * */
32 | private int minute;
33 |
34 | public GroupModel()
35 | {
36 | }
37 | /**
38 | * 构造方法
39 | *
40 | * @param id 群组id
41 | * @param members 群组成员
42 | * @param name 群名
43 | */
44 | public GroupModel(String id, GroupMember[] members, String name, int minute)
45 | {
46 | this.id = id;
47 | this.members = members;
48 | this.name = name;
49 | this.minute = minute;
50 | }
51 |
52 | public int Minute { get => minute; set => minute = value; }
53 | public string Id { get => id; set => id = value; }
54 | public GroupMember[] Members { get => members; set => members = value; }
55 | public string Name { get => name; set => name = value; }
56 |
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/models/group/UserGroup.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.group
8 | {
9 | public class UserGroup
10 |
11 | {
12 |
13 | private String id;
14 | private GroupModel[] groups;
15 |
16 | public string Id { get => id; set => id = value; }
17 | public GroupModel[] Groups { get => groups; set => groups = value; }
18 |
19 | public UserGroup()
20 | {
21 | }
22 |
23 | public UserGroup(String id, GroupModel[] groups)
24 | {
25 | this.id = id;
26 | this.groups = groups;
27 | }
28 |
29 | public String getId()
30 | {
31 | return this.id;
32 | }
33 |
34 | public UserGroup setId(String id)
35 | {
36 | this.id = id;
37 | return this;
38 | }
39 |
40 | public GroupModel[] getGroups()
41 | {
42 | return this.groups;
43 | }
44 |
45 | public UserGroup setGroups(GroupModel[] groups)
46 | {
47 | this.groups = groups;
48 | return this;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/models/message/BroadcastMessage.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.message
8 | {
9 |
10 | public class BroadcastMessage : MessageModel
11 |
12 | {
13 |
14 | private String os;
15 |
16 | public BroadcastMessage()
17 | {
18 | }
19 |
20 | public BroadcastMessage(String senderUserId, String[] targetId, String objectName, BaseMessage content, String pushContent, String pushData,
21 | String os) : base(senderUserId, targetId, objectName, content, pushContent, pushData)
22 | {
23 | this.os = os;
24 | }
25 |
26 | public string Os { get => os; set => os = value; }
27 | }
28 | }
--------------------------------------------------------------------------------
/models/message/ChatroomMessage.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.message
8 | {
9 | public class ChatroomMessage : MessageModel
10 |
11 | {
12 |
13 | public ChatroomMessage()
14 | {
15 |
16 | }
17 |
18 | public ChatroomMessage(String senderUserId, String[] targetId, String objectName, BaseMessage content) : base(senderUserId, targetId, objectName, content, null, null)
19 | {
20 |
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/models/message/DiscussionMessage.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.message
8 | {
9 |
10 | /**
11 | * 讨论组消息体
12 | * @author hc
13 | */
14 | public class DiscussionMessage : MessageModel
15 |
16 | {
17 |
18 | /**
19 | * 针对 iOS 平台,Push 时用来控制未读消息显示数,只有在 toUserId 为一个用户 Id 的时候有效。(可选)
20 | */
21 | private int isPersisted;
22 | /**
23 | * 当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行未读消息计数,
24 | * 0 表示为不计数、 1 表示为计数,默认为 1 计数,未读消息数增加 1。(可选)
25 | */
26 | private int isCounted;
27 |
28 | /**
29 | * 当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行未读消息计数,
30 | * 0 表示为不计数、 1 表示为计数,默认为 1 计数,未读消息数增加 1。(可选)
31 | */
32 | private int isIncludeSender;
33 |
34 | /**
35 | * ios静默推送 0关闭 1开启
36 | **/
37 | private int contentAvailable;
38 |
39 | public int IsPersisted { get => isPersisted; set => isPersisted = value; }
40 | public int IsCounted { get => isCounted; set => isCounted = value; }
41 | public int IsIncludeSender { get => isIncludeSender; set => isIncludeSender = value; }
42 | public int ContentAvailable { get => contentAvailable; set => contentAvailable = value; }
43 |
44 | public DiscussionMessage()
45 | {
46 | }
47 |
48 | public DiscussionMessage(String senderId, String[] targetId, String objectName, BaseMessage content, String pushContent, String pushData,
49 | int isPersisted, int isCounted, int isIncludeSender, int contentAvailable):base(senderId, targetId, objectName, content, pushContent, pushData)
50 | {
51 |
52 | this.isPersisted = isPersisted;
53 | this.isCounted = isCounted;
54 | this.isIncludeSender = isIncludeSender;
55 | this.contentAvailable = contentAvailable;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/models/message/GroupMessage.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.message
8 | {
9 | public class GroupMessage : MessageModel
10 |
11 | {
12 |
13 | /**
14 | * 发送者自己是否接收此条消息, 0: 不接收, 1: 接收, 默认: 0
15 | **/
16 | private int isIncludeSender;
17 | /**
18 | * 针对 iOS 平台,Push 时用来控制未读消息显示数,只有在 toUserId 为一个用户 Id 的时候有效。(可选)
19 | */
20 | private int isPersisted;
21 | /**
22 | * 当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行未读消息计数,
23 | * 0 表示为不计数、 1 表示为计数,默认为 1 计数,未读消息数增加 1。(可选)
24 | */
25 | private int isCounted;
26 |
27 | /**
28 | * ios静默推送 0关闭 1开启
29 | **/
30 | private int contentAvailable;
31 |
32 | public int IsIncludeSender { get => isIncludeSender; set => isIncludeSender = value; }
33 | public int IsPersisted { get => isPersisted; set => isPersisted = value; }
34 | public int IsCounted { get => isCounted; set => isCounted = value; }
35 | public int ContentAvailable { get => contentAvailable; set => contentAvailable = value; }
36 |
37 | public GroupMessage()
38 | {
39 | }
40 | /**
41 | * @param senderId:发送人用户 Id 。(必传)
42 | * @param targetId:接收群Id,提供多个本参数可以实现向多群发送消息,最多不超过 3 个群组。(必传)
43 | * @param content:发送消息内容,参考融云消息类型表.示例说明;如果 objectName 为自定义消息类型,该参数可自定义格式。(必传)
44 | * @param pushContent:定义显示的 Push 内容,如果 objectName 为融云内置消息类型时,则发送后用户一定会收到 Push 信息. 如果为自定义消息,则 pushContent 为自定义消息显示的 Push 内容,如果不传则用户不会收到 Push 通知。(可选)
45 | * @param pushData:针对 iOS 平台为 Push 通知时附加到 payload 中,Android 客户端收到推送消息时对应字段名为 pushData。(可选)
46 | * @param isPersisted:当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行存储,0 表示为不存储、 1 表示为存储,默认为 1 存储消息。(可选)
47 | * @param isCounted:当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行未读消息计数,0 表示为不计数、 1 表示为计数,默认为 1 计数,未读消息数增加 1。(可选)
48 | * @param isIncludeSender:发送用户自已是否接收消息,0 表示为不接收,1 表示为接收,默认为 0 不接收。(可选)
49 | *
50 | * */
51 | public GroupMessage(String senderId, String[] targetId, String objectName, BaseMessage content, String pushContent, String pushData, int isIncludeSender, int isPersisted, int isCounted, int contentAvailable) : base(senderId, targetId, objectName, content, pushContent, pushData)
52 | {
53 | this.isIncludeSender = isIncludeSender;
54 | this.isPersisted = isPersisted;
55 | this.isCounted = isCounted;
56 | this.contentAvailable = contentAvailable;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/models/message/MentionMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace io.rong.models.message
7 | {
8 | public class MentionMessage
9 |
10 | {
11 | private String senderId;
12 | /**
13 | * 接收群 Id,提供多个本参数可以实现向多群发送消息,最多不超过 3 个群组。(必传)
14 | */
15 | private String[] targetId;
16 | private String objectName;
17 | /**
18 | * 消息 内容
19 | */
20 | private MentionMessageContent content;
21 | private String pushContent;
22 | private String pushData;
23 | private int isPersisted;
24 | private int isCounted;
25 | private int isIncludeSender;
26 | private int contentAvailable;
27 |
28 | public string[] TargetId { get => targetId; set => targetId = value; }
29 | public string ObjectName { get => objectName; set => objectName = value; }
30 | public MentionMessageContent Content { get => content; set => content = value; }
31 | public string PushContent { get => pushContent; set => pushContent = value; }
32 | public string PushData { get => pushData; set => pushData = value; }
33 | public int IsPersisted { get => isPersisted; set => isPersisted = value; }
34 | public int IsCounted { get => isCounted; set => isCounted = value; }
35 | public int IsIncludeSender { get => isIncludeSender; set => isIncludeSender = value; }
36 | public int ContentAvailable { get => contentAvailable; set => contentAvailable = value; }
37 | public string SenderId { get => senderId; set => senderId = value; }
38 |
39 | public MentionMessage()
40 | {
41 | }
42 |
43 | public MentionMessage(String senderId, String[] targetId, String objectName, MentionMessageContent content, String pushContent, String pushData,
44 | int isPersisted, int isCounted, int isIncludeSender, int contentAvailable)
45 | {
46 | this.senderId = senderId;
47 | this.targetId = targetId;
48 | this.objectName = objectName;
49 | this.content = content;
50 | this.pushContent = pushContent;
51 | this.pushData = pushData;
52 | this.isPersisted = isPersisted;
53 | this.isCounted = isCounted;
54 | this.isIncludeSender = isIncludeSender;
55 | this.contentAvailable = contentAvailable;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/models/message/MentionMessageContent.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.message
9 | {
10 | public class MentionMessageContent
11 |
12 | {
13 | [JsonProperty(PropertyName = "content")]
14 | private BaseMessage content;
15 | [JsonProperty(PropertyName = "mentionedInfo")]
16 | private MentionedInfo mentionedInfo;
17 |
18 | [JsonIgnore]
19 | internal BaseMessage Content { get => content; set => content = value; }
20 | [JsonIgnore]
21 | public MentionedInfo MentionedInfo { get => mentionedInfo; set => mentionedInfo = value; }
22 |
23 | public MentionMessageContent(BaseMessage content, MentionedInfo mentionedInfo)
24 | {
25 | this.content = content;
26 | this.mentionedInfo = mentionedInfo;
27 | }
28 |
29 | override
30 | public String ToString()
31 | {
32 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/models/message/MentionedInfo.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.message
8 | {
9 | public class MentionedInfo
10 | {
11 | [JsonProperty(PropertyName = "type")]
12 | private int type;
13 | [JsonProperty(PropertyName = "userIds")]
14 | private String[] userIds;
15 | [JsonProperty(PropertyName = "pushContent")]
16 | private String pushContent;
17 |
18 | [JsonIgnore]
19 | public int Type { get => type; set => type = value; }
20 | [JsonIgnore]
21 | public string[] UserIds { get => userIds; set => userIds = value; }
22 | [JsonIgnore]
23 | public string PushContent { get => pushContent; set => pushContent = value; }
24 |
25 | public MentionedInfo(int type, String[] userIds, String pushContent)
26 | {
27 | this.type = type;
28 | this.userIds = userIds;
29 | this.pushContent = pushContent;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/models/message/MessageModel.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.message
9 | {
10 | public class MessageModel
11 |
12 | {
13 | [JsonProperty(PropertyName = "senderId")]
14 | private String senderId;
15 | /**
16 | *
17 | * 接受 Id 可能是用户Id,聊天Id ,群组Id,讨论组Id(必传)
18 | **/
19 | [JsonProperty(PropertyName = "targetId")]
20 | private String[] targetId;
21 | /**
22 | *消息类型 (必传)
23 | **/
24 | [JsonProperty(PropertyName = "objectName")]
25 | private String objectName;
26 | /**
27 | * 发送消息内容,参考融云消息类型表.示例说明;如果 objectName
28 | * 为自定义消息类型,该参数可自定义格式。(必传)。
29 | **/
30 | [JsonProperty(PropertyName = "content")]
31 | private BaseMessage content;
32 | /**
33 | * 定义显示的 Push 内容,如果 objectName 为融云内置消息类型时,
34 | * 则发送后用户一定会收到 Push 信息。如果为自定义消息,则 pushContent
35 | * 为自定义消息显示的 Push 内容,如果不传则用户不会收到 Push 通知。(可选)
36 | */
37 | [JsonProperty(PropertyName = "pushContent")]
38 | private String pushContent;
39 | /**
40 | * 针对 iOS 平台为 Push 通知时附加到 payload 中,Android 客户端收到推送消息时对应字段名为 pushData。(可选)
41 | */
42 | [JsonProperty(PropertyName = "pushData")]
43 | private String pushData;
44 |
45 | [JsonIgnore]
46 | public string SenderId { get => senderId; set => senderId = value; }
47 | [JsonIgnore]
48 | public string[] TargetId { get => targetId; set => targetId = value; }
49 | [JsonIgnore]
50 | public string ObjectName { get => objectName; set => objectName = value; }
51 | [JsonIgnore]
52 | public BaseMessage Content { get => content; set => content = value; }
53 | [JsonIgnore]
54 | public string PushContent { get => pushContent; set => pushContent = value; }
55 | [JsonIgnore]
56 | public string PushData { get => pushData; set => pushData = value; }
57 |
58 | public MessageModel()
59 | {
60 | }
61 |
62 | public MessageModel(String senderId, String[] targetId, String objectName, BaseMessage content,
63 | String pushContent, String pushData)
64 | {
65 | this.senderId = senderId;
66 | this.targetId = targetId;
67 | this.objectName = objectName;
68 | this.content = content;
69 | this.pushContent = pushContent;
70 | this.pushData = pushData;
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/models/message/PrivateMessage.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.message
8 | {
9 | public class PrivateMessage : MessageModel
10 |
11 | {
12 |
13 | /**
14 | * 针对 iOS 平台,Push 时用来控制未读消息显示数,只有在 toUserId 为一个用户 Id 的时候有效。(可选)
15 | **/
16 | private String count;
17 | /**
18 | * 针对 iOS 平台,Push 时用来控制未读消息显示数,只有在 toUserId 为一个用户 Id 的时候有效。(可选)
19 | */
20 | private int isPersisted;
21 | /**
22 | * 当前版本有新的自定义消息,而老版本没有该自定义消息时,老版本客户端收到消息后是否进行未读消息计数,
23 | * 0 表示为不计数、 1 表示为计数,默认为 1 计数,未读消息数增加 1。(可选)
24 | */
25 | private int isCounted;
26 |
27 | /**
28 | *是否过滤发送人黑名单列表,0 表示为不过滤、 1 表示为过滤,默认为 0 不过滤。(可选
29 | */
30 | private int verifyBlacklist;
31 | /**
32 | * 发送用户自已是否接收消息,0 表示为不接收,1 表示为接收,默认为 0 不接收。(可选)
33 | */
34 | private int isIncludeSender;
35 |
36 | private int contentAvailable;
37 |
38 | public string Count { get => count; set => count = value; }
39 | public int IsPersisted { get => isPersisted; set => isPersisted = value; }
40 | public int IsCounted { get => isCounted; set => isCounted = value; }
41 | public int VerifyBlacklist { get => verifyBlacklist; set => verifyBlacklist = value; }
42 | public int IsIncludeSender { get => isIncludeSender; set => isIncludeSender = value; }
43 | public int ContentAvailable { get => contentAvailable; set => contentAvailable = value; }
44 |
45 | public PrivateMessage()
46 | {
47 | }
48 |
49 | public PrivateMessage(String senderId, String[] targetId, String objectName, BaseMessage content, String pushContent, String pushData,
50 | String count, int isPersisted, int isCounted, int verifyBlacklist, int isIncludeSender, int contentAvailable) : base(senderId, targetId, objectName, content, pushContent, pushData)
51 | {
52 |
53 | this.count = count;
54 | this.isPersisted = isPersisted;
55 | this.isCounted = isCounted;
56 | this.verifyBlacklist = verifyBlacklist;
57 | this.isIncludeSender = isIncludeSender;
58 | this.contentAvailable = contentAvailable;
59 | }
60 |
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/models/message/RecallMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace io.rong.models.message
7 | {
8 | public class RecallMessage
9 | {
10 | /**
11 | * 撤回消息体
12 | * 发送人id
13 | * */
14 | private String senderId;
15 | /**
16 | * 接收人id
17 | * */
18 | private String targetId;
19 | /**
20 | * 消息唯一标识 各端 SDK 发送消息成功后会返回 uId
21 | * */
22 | private String uId;
23 | /**
24 | * 消息的发送时间,各端 SDK 发送消息成功后会返回 sentTime
25 | * */
26 | private String sentTime;
27 |
28 | public string SenderId { get => senderId; set => senderId = value; }
29 | public string TargetId { get => targetId; set => targetId = value; }
30 | public string UId { get => uId; set => uId = value; }
31 | public string SentTime { get => sentTime; set => sentTime = value; }
32 |
33 | public RecallMessage()
34 | {
35 | }
36 |
37 | /**
38 | * @param senderId String 消息发送人用户 Id。(必传)
39 | * @param conversationType Int 会话类型,二人会话是 1 、讨论组会话是 2 、群组会话是 3 。(必传)
40 | * @param targetId String 目标 Id,根据不同的 ConversationType,可能是用户 Id、讨论组 Id、群组 Id。(必传)
41 | * @param uId String 消息唯一标识,可通过服务端实时消息路由获取,对应名称为 msgUID。(必传)
42 | * @param sentTime
43 | *
44 | * */
45 | public RecallMessage(String senderId, String conversationType, String targetId,
46 | String uId, String sentTime)
47 | {
48 | this.senderId = senderId;
49 | this.targetId = targetId;
50 | this.uId = uId;
51 | this.sentTime = sentTime;
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/models/message/SystemMessage.cs:
--------------------------------------------------------------------------------
1 | using io.rong.messages;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.message
8 | {
9 | public class SystemMessage : MessageModel
10 |
11 | {
12 | /**
13 | * 当前版本有新的自定义消息,而老版本没有该自定义消息时,
14 | * 老版本客户端收到消息后是否进行存储,0 表示为不存储、 1 表示为存储,默认为 1 存储消息。(可选)
15 | *
16 | * */
17 | private int isPersisted;
18 | /**
19 | * 当前版本有新的自定义消息,而老版本没有该自定义消息时,
20 | * 老版本客户端收到消息后是否进行未读消息计数,0 表示为不计数、 1 表示为计数,默认为 1 计数,未读消息数增加 1。(可选)
21 | * */
22 | private int isCounted;
23 | /**
24 | * 针对 iOS 平台,对 SDK 处于后台暂停状态时为静默推送,是 iOS7 之后推出的一种推送方式。
25 | * 允许应用在收到通知后在后台运行一段代码,且能够马上执行。1 表示为开启,0 表示为关闭,默认为 0(可选)
26 | * */
27 | private int contentAvailable;
28 |
29 | public SystemMessage()
30 | {
31 | }
32 |
33 | public SystemMessage(String senderUserId, String[] targetId, String objectName, BaseMessage content, String pushContent, String pushData,
34 | int isPersisted, int isCounted, int contentAvailable) : base(senderUserId, targetId, objectName, content, pushContent, pushData)
35 | {
36 | this.isPersisted = isPersisted;
37 | this.isCounted = isCounted;
38 | this.contentAvailable = contentAvailable;
39 | }
40 |
41 | public int IsPersisted { get => isPersisted; set => isPersisted = value; }
42 | public int IsCounted { get => isCounted; set => isCounted = value; }
43 | public int ContentAvailable { get => contentAvailable; set => contentAvailable = value; }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/models/message/TemplateMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace io.rong.models.message
7 | {
8 | public class TemplateMessage
9 | {
10 | /**
11 | * 发送人Id
12 | * */
13 | private String senderId;
14 | /**
15 | * 消息类型
16 | * */
17 | private String objectName;
18 | /**
19 | * 发送消息内容,内容中定义模版,标识通过 content 中的标识位内容进行替换,
20 | * 参考融云消息类型表.示例说明;如果 objectName 为自定义消息类型,该参数可自定义格式。(必传)
21 | * */
22 | private Object template;
23 | /**
24 | * key 用户Id ,value 模板赋值内容
25 | *
26 | * */
27 | private Dictionary content;
28 |
29 | private String[] pushData;
30 |
31 | private int verifyBlacklist;
32 |
33 | private int contentAvailable;
34 |
35 | public string SenderId { get => senderId; set => senderId = value; }
36 | public string ObjectName { get => objectName; set => objectName = value; }
37 | public object Template { get => template; set => template = value; }
38 | public Dictionary Content { get => content; set => content = value; }
39 | public string[] PushData { get => pushData; set => pushData = value; }
40 | public int VerifyBlacklist { get => verifyBlacklist; set => verifyBlacklist = value; }
41 | public int ContentAvailable { get => contentAvailable; set => contentAvailable = value; }
42 | }
43 |
44 | public class ContentData
45 | {
46 | /**
47 | * 消息内容数据,key对应模版的标识 ,value具体内容
48 | */
49 | private Dictionary data;
50 | /**
51 | * push内容
52 | */
53 | private String push;
54 |
55 | public string Push { get => push; set => push = value; }
56 | public Dictionary Data { get => data; set => data = value; }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/models/push/Audience.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 |
4 | namespace io.rong.models.push
5 | {
6 | /**
7 | * 推送条件
8 | */
9 | public class Audience
10 | {
11 | /**
12 | * 用户标签,每次发送时最多发送 20 个标签,标签之间为 AND 的关系,is_to_all 为 true 时参数无效。(非必传)
13 | */
14 | [JsonProperty(PropertyName = "tag")]
15 | private String[] tag;
16 |
17 | /**
18 | * 用户标签,每次发送时最多发送 20 个标签,标签之间为 OR 的关系,is_to_all 为 true 时参数无效,tag_or 同 tag
19 | * 参数可以同时存在。(非必传)
20 | */
21 | [JsonProperty(PropertyName = "tag_or")]
22 | private String[] tag_or;
23 |
24 | /**
25 | * 用户 Id,每次发送时最多发送 1000 个用户,如果 tag 和 userid 两个条件同时存在时,则以 userid 为准,如果 userid
26 | * 有值时,则 platform 参数无效,is_to_all 为 true 时参数无效。(非必传)
27 | */
28 | [JsonProperty(PropertyName = "userid")]
29 | private String[] userid;
30 |
31 | /**
32 | * 是否全部推送,false 表示按 tag 、tag_or 或 userid 条件推送,true 表示向所有用户推送,tag、tag_or 和 userid
33 | * 条件无效。(必传)
34 | */
35 | [JsonProperty(PropertyName = "is_to_all")]
36 | private Boolean is_to_all;
37 |
38 | /**
39 | * 应用包名,is_to_all 为 true 时,此参数无效。与 tag、tag_or 同时存在时为 And 的关系,向同时满足条件的用户推送。与
40 | * userid 条件同时存在时,以 userid 为准进行推送。(非必传)
41 | */
42 | [JsonProperty(PropertyName = "packageName")]
43 | private String packageName;
44 |
45 | public String[] GetTag()
46 | {
47 | return tag;
48 | }
49 |
50 | public void SetTag(String[] tag)
51 | {
52 | this.tag = tag;
53 | }
54 |
55 | public String[] GetTag_or()
56 | {
57 | return tag_or;
58 | }
59 |
60 | public void SetTag_or(String[] tag_or)
61 | {
62 | this.tag_or = tag_or;
63 | }
64 |
65 | public String[] GetUserid()
66 | {
67 | return userid;
68 | }
69 |
70 | public void SetUserid(String[] userid)
71 | {
72 | this.userid = userid;
73 | }
74 |
75 | public Boolean GetIs_to_all()
76 | {
77 | return is_to_all;
78 | }
79 |
80 | public void SetIs_to_all(Boolean is_to_all)
81 | {
82 | this.is_to_all = is_to_all;
83 | }
84 |
85 | public String GetPackageName()
86 | {
87 | return packageName;
88 | }
89 |
90 | public void SetPackageName(String packageName)
91 | {
92 | this.packageName = packageName;
93 | }
94 |
95 | public Audience()
96 | {
97 | tag = new String[] { };
98 | }
99 |
100 | override
101 | public String ToString()
102 | {
103 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
104 | }
105 | }
106 |
107 | }
108 |
--------------------------------------------------------------------------------
/models/push/BroadcastModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Newtonsoft.Json;
3 |
4 | namespace io.rong.models.push
5 | {
6 | /**
7 | * 广播消息体。
8 | */
9 | public class BroadcastModel : BroadcastPushPublicPart
10 | {
11 |
12 | /**
13 | * 发送人用户 Id。(必传)
14 | */
15 | [JsonProperty(PropertyName = "fromuserid")]
16 | private String fromuserid;
17 |
18 | /**
19 | * 发送消息内容(必传)
20 | */
21 | [JsonProperty(PropertyName = "message")]
22 | private Message message;
23 |
24 | public String GetFromuserid()
25 | {
26 | return fromuserid;
27 | }
28 |
29 | public void SetFromuserid(String fromuserid)
30 | {
31 | this.fromuserid = fromuserid;
32 | }
33 |
34 | public Message GetMessage()
35 | {
36 | return message;
37 | }
38 |
39 | public void SetMessage(Message message)
40 | {
41 | this.message = message;
42 | }
43 |
44 | override
45 | public String ToString()
46 | {
47 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/models/push/BroadcastPushPublicPart.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Newtonsoft.Json;
3 |
4 | namespace io.rong.models.push
5 | {
6 | /**
7 | * 广播跟参数公共部分
8 | */
9 | public class BroadcastPushPublicPart
10 | {
11 |
12 | /**
13 | * 目标操作系统,iOS、Android 最少传递一个。如果需要给两个系统推送消息时,则需要全部填写。(必传)
14 | */
15 | [JsonProperty(PropertyName = "platform")]
16 | private String[] platform;
17 |
18 | /**
19 | * 推送条件,包括: tag、userid、is_to_all。(必传)
20 | */
21 | [JsonProperty(PropertyName = "audience")]
22 | private Audience audience;
23 |
24 | /**
25 | * 按操作系统类型推送消息内容
26 | */
27 | [JsonProperty(PropertyName = "notification")]
28 | private Notification notification;
29 |
30 | public String[] GetPlatform()
31 | {
32 | return platform;
33 | }
34 |
35 | public void SetPlatform(String[] platform)
36 | {
37 | this.platform = platform;
38 | }
39 |
40 | public Audience GetAudience()
41 | {
42 | return audience;
43 | }
44 |
45 | public void SetAudience(Audience audience)
46 | {
47 | this.audience = audience;
48 | }
49 |
50 | public Notification GetNotification()
51 | {
52 | return notification;
53 | }
54 |
55 | public void SetNotification(Notification notification)
56 | {
57 | this.notification = notification;
58 | }
59 |
60 | override
61 | public String ToString()
62 | {
63 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/models/push/Message.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 |
4 | namespace io.rong.models.push
5 | {
6 | /**
7 | * 发送消息内容(必传)
8 | */
9 | public class Message
10 | {
11 |
12 | /**
13 | * 发送消息内容,参考融云 Server API 消息类型表.示例说明;如果 objectName 为自定义消息类型,该参数可自定义格式。(必传)
14 | */
15 | [JsonProperty(PropertyName = "content")]
16 | private String content;
17 |
18 | /**
19 | * 消息类型,参考融云 Server API 消息类型表.消息标志;可自定义消息类型,长度不超过 32 个字符。(必传)
20 | */
21 | [JsonProperty(PropertyName = "objectName")]
22 | private String objectName;
23 |
24 | public String GetContent()
25 | {
26 | return content;
27 | }
28 |
29 | public void SetContent(String content)
30 | {
31 | this.content = content;
32 | }
33 |
34 | public String GetObjectName()
35 | {
36 | return objectName;
37 | }
38 |
39 | public void SetObjectName(String objectName)
40 | {
41 | this.objectName = objectName;
42 | }
43 |
44 | override
45 | public String ToString()
46 | {
47 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/models/push/Notification.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 |
4 | namespace io.rong.models.push
5 | {
6 | /**
7 | * 按操作系统类型推送消息内容,如 platform 中设置了给 iOS 和 Android 系统推送消息,而在 notification 中只设置了 iOS
8 | * 的推送内容,则 Android 的推送内容为最初 alert 设置的内容。(非必传)
9 | */
10 | public class Notification
11 | {
12 |
13 | /**
14 | * 默认推送消息内容,如填写了 iOS 或 Android 下的 alert 时,则推送内容以对应平台系统的 alert 为准。(必传)
15 | */
16 | [JsonProperty(PropertyName = "alert")]
17 | private String alert;
18 |
19 | /**
20 | * 设置 iOS 平台下的推送及附加信息。
21 | */
22 | [JsonProperty(PropertyName = "ios")]
23 | private PlatformNotification ios;
24 |
25 | /**
26 | * 设置 Android 平台下的推送及附加信息。
27 | */
28 | [JsonProperty(PropertyName = "android")]
29 | private PlatformNotification android;
30 |
31 | public String GetAlert()
32 | {
33 | return alert;
34 | }
35 |
36 | public void SetAlert(String alert)
37 | {
38 | this.alert = alert;
39 | }
40 |
41 | public PlatformNotification GetIos()
42 | {
43 | return ios;
44 | }
45 |
46 | public void SetIos(PlatformNotification ios)
47 | {
48 | this.ios = ios;
49 | }
50 |
51 | public PlatformNotification GetAndroid()
52 | {
53 | return android;
54 | }
55 |
56 | public void SetAndroid(PlatformNotification android)
57 | {
58 | this.android = android;
59 | }
60 |
61 | override
62 | public String ToString()
63 | {
64 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/models/push/PushModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Newtonsoft.Json;
3 |
4 | namespace io.rong.models.push
5 | {
6 | public class PushModel : BroadcastPushPublicPart
7 | {
8 | override
9 | public String ToString()
10 | {
11 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/models/response/BlackListResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.push;
2 | using Newtonsoft.Json;
3 | using System;
4 |
5 | namespace io.rong.models.response
6 | {
7 | public class BlackListResult : Result
8 |
9 | {
10 | /**
11 | * 黑名单用户列表
12 | */
13 | [JsonProperty(PropertyName = "users")]
14 | UserModel[] users;
15 |
16 | [JsonIgnore]
17 | public UserModel[] Users { get => users; set => users = value; }
18 |
19 | public BlackListResult(int code, String msg, UserModel[] users) : base(code, msg)
20 | {
21 | this.users = users;
22 | }
23 |
24 |
25 | /**
26 | * 获取users
27 | *
28 | * @return User[]
29 | */
30 | public UserModel[] getUsers()
31 | {
32 | return this.users;
33 | }
34 | /**
35 | * 设置users
36 | *
37 | */
38 | public void setUsers(UserModel[] users)
39 | {
40 | this.users = users;
41 | }
42 |
43 | override
44 | public String ToString()
45 | {
46 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/models/response/BlockUserList.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | class BlockUserList
10 | {
11 | /**
12 | * 返回码,200 为正常。
13 | *
14 | */
15 | private int code;
16 | /**
17 | * 黑名单用户列表
18 | */
19 | private String[] users;
20 |
21 |
22 | public BlockUserList(int code, String[] users)
23 | {
24 | this.code = code;
25 | this.users = users;
26 | }
27 |
28 | public String[] getUsers()
29 | {
30 | return this.users;
31 | }
32 |
33 | public void setUsers(String[] users)
34 | {
35 | this.users = users;
36 | }
37 |
38 | public int getCode()
39 | {
40 | return this.code;
41 | }
42 |
43 | public void setCode(int code)
44 | {
45 | this.code = code;
46 | }
47 |
48 | override
49 | public String ToString()
50 | {
51 | return JsonConvert.SerializeObject(this);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/models/response/BlockUserResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | public class BlockUserResult : Result
10 |
11 | {
12 | // 被封禁用户列表。
13 | [JsonProperty(PropertyName = "users")]
14 | List users;
15 |
16 | [JsonIgnore]
17 | public List Users { get => users; set => users = value; }
18 |
19 | public BlockUserResult(int code, String errorMessage, List users) : base(code, errorMessage)
20 | {
21 | this.users = users;
22 | }
23 |
24 | override
25 | public String ToString()
26 | {
27 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/models/response/ChatroomDemotionMsgResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.push;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class ChatroomDemotionMsgResult : Result
11 |
12 | {
13 | [JsonProperty(PropertyName = "objectNames")]
14 | private String[] objectNames;
15 |
16 | [JsonIgnore]
17 | public string[] ObjectNames { get => objectNames; set => objectNames = value; }
18 |
19 | public ChatroomDemotionMsgResult()
20 | {
21 |
22 | }
23 |
24 | public ChatroomDemotionMsgResult(int code, String msg, String[] objectNames) : base(code, msg)
25 | {
26 | this.objectNames = objectNames;
27 | }
28 |
29 | public ChatroomDemotionMsgResult(String[] objectNames)
30 | {
31 | this.objectNames = objectNames;
32 | }
33 |
34 | override
35 | public String ToString()
36 | {
37 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/models/response/ChatroomKeepaliveResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.push;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class ChatroomKeepaliveResult : Result
11 |
12 | {
13 | [JsonProperty(PropertyName = "chatrooms")]
14 | private String[] chatrooms;
15 |
16 | public ChatroomKeepaliveResult(int code, String msg, String[] chatrooms) : base(code, msg)
17 | {
18 | this.chatrooms = chatrooms;
19 | }
20 | [JsonIgnore]
21 | public string[] Chatrooms { get => chatrooms; set => chatrooms = value; }
22 |
23 |
24 | override
25 | public String ToString()
26 | {
27 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/models/response/ChatroomQueryResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.chatroom;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class ChatroomQueryResult : Result
11 | {
12 | [JsonProperty(PropertyName = "chatRooms")]
13 | List chatRooms;
14 |
15 | [JsonIgnore]
16 | internal List ChatRooms { get => chatRooms; set => chatRooms = value; }
17 |
18 | public ChatroomQueryResult()
19 | {
20 |
21 | }
22 | public ChatroomQueryResult(int code, String errorMessage, List chatRooms) : base(code, errorMessage)
23 | {
24 | this.chatRooms = chatRooms;
25 | }
26 |
27 | override
28 | public String ToString()
29 | {
30 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/models/response/ChatroomUserQueryResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.chatroom;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class ChatroomUserQueryResult : Result
11 |
12 | {
13 | /**
14 | * 聊天室中用户数。
15 | *
16 | */
17 | [JsonProperty(PropertyName = "total")]
18 | int total;
19 | /**
20 | * 聊天室成员列表。
21 | *
22 | */
23 | [JsonProperty(PropertyName = "members")]
24 | List members;
25 |
26 | [JsonIgnore]
27 | public int Total { get => total; set => total = value; }
28 | [JsonIgnore]
29 | internal List Members { get => members; set => members = value; }
30 |
31 | public ChatroomUserQueryResult()
32 | {
33 |
34 | }
35 |
36 | public ChatroomUserQueryResult(int code, String msg, int total, List members) : base(code, msg)
37 | {
38 | this.total = total;
39 | this.members = members;
40 | }
41 |
42 | public ChatroomUserQueryResult(int total, List members)
43 | {
44 | this.total = total;
45 | this.members = members;
46 | }
47 |
48 | override
49 | public String ToString()
50 | {
51 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/models/response/ChatroomWhitelistMsgResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.chatroom;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class ChatroomWhitelistMsgResult : Result
11 |
12 | {
13 | [JsonProperty(PropertyName = "objectNames")]
14 | private String[] objectNames;
15 |
16 | [JsonIgnore]
17 | public string[] ObjectNames { get => objectNames; set => objectNames = value; }
18 |
19 | public ChatroomWhitelistMsgResult()
20 | {
21 |
22 | }
23 |
24 | public ChatroomWhitelistMsgResult(int code, String msg, String[] objectNames) : base(code, msg)
25 | {
26 | this.objectNames = objectNames;
27 | }
28 |
29 | public ChatroomWhitelistMsgResult(String[] objectNames)
30 | {
31 | this.objectNames = objectNames;
32 | }
33 |
34 | override
35 | public String ToString()
36 | {
37 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/models/response/CheckChatRoomUserResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.chatroom;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class CheckChatRoomUserResult
11 |
12 | {
13 | [JsonProperty(PropertyName = "code")]
14 | private String code;
15 | [JsonProperty(PropertyName = "isInChrm")]
16 | private Boolean isInChrm;
17 |
18 | [JsonIgnore]
19 | public string Code { get => code; set => code = value; }
20 | [JsonIgnore]
21 | public bool IsInChrm { get => isInChrm; set => isInChrm = value; }
22 |
23 | public CheckChatRoomUserResult(String code, Boolean isInChrm)
24 | {
25 | this.code = code;
26 | this.isInChrm = isInChrm;
27 | }
28 |
29 | override
30 | public String ToString()
31 | {
32 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/models/response/CheckOnlineResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | public class CheckOnlineResult : Result
10 |
11 | {
12 | // 在线状态,1为在线,0为不在线。
13 | [JsonProperty(PropertyName = "status")]
14 | String status;
15 |
16 | public string Status { get => status; set => status = value; }
17 |
18 | public CheckOnlineResult(int code, String status, String errorMessage):base(code, errorMessage)
19 | {
20 | this.code = code;
21 | this.status = status;
22 | this.msg = errorMessage;
23 | }
24 | /**
25 | * 设置status
26 | *
27 | */
28 | public void setStatus(String status)
29 | {
30 | this.status = status;
31 | }
32 |
33 | /**
34 | * 获取status
35 | *
36 | * @return String
37 | */
38 | public String getStatus()
39 | {
40 | return status;
41 | }
42 |
43 | override
44 | public String ToString()
45 | {
46 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/models/response/GagGroupUser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Newtonsoft.Json;
6 |
7 | namespace io.rong.models.response
8 | {
9 |
10 | /**
11 | * 群组用户封禁信息。
12 | */
13 | public class GagGroupUser
14 |
15 | {
16 | // 解禁时间。
17 | String time;
18 | // 群成员 Id。
19 | String id;
20 |
21 | public GagGroupUser(String time, String id)
22 | {
23 | this.time = time;
24 | this.id = id;
25 | }
26 |
27 | /**
28 | * 设置time
29 | *
30 | */
31 | public GagGroupUser setTime(String time)
32 | {
33 | this.time = time;
34 | return this;
35 | }
36 |
37 | /**
38 | * 获取time
39 | *
40 | * @return String
41 | */
42 | public String getTime()
43 | {
44 | return time;
45 | }
46 |
47 | /**
48 | * 获取userId
49 | *
50 | * @return String
51 | */
52 | public String getId()
53 | {
54 | return this.id;
55 | }
56 |
57 | /**
58 | * 设置userId
59 | *
60 | */
61 | public void setId(String id)
62 | {
63 | this.id = id;
64 | }
65 |
66 | override
67 | public String ToString()
68 | {
69 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
70 |
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/models/response/GroupUser.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | public class GroupUser
10 |
11 | {
12 | // 用户 Id。
13 | [JsonProperty(PropertyName = "id")]
14 | String id;
15 |
16 | public GroupUser(String id)
17 | {
18 | this.id = id;
19 | }
20 |
21 | [JsonIgnore]
22 | public string Id { get => id; set => id = value; }
23 |
24 | override
25 | public String ToString()
26 | {
27 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/models/response/GroupUserQueryResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | public class GroupUserQueryResult : Result
10 |
11 | {
12 |
13 | // 群成员用户Id。
14 | [JsonProperty(PropertyName = "id")]
15 | String id;
16 | // 群成员列表。
17 | [JsonProperty(PropertyName = "members")]
18 | List members;
19 |
20 | [JsonIgnore]
21 | public string Id { get => id; set => id = value; }
22 | [JsonIgnore]
23 | public List Members { get => members; set => members = value; }
24 |
25 | public GroupUserQueryResult()
26 | {
27 |
28 | }
29 | public GroupUserQueryResult(int code, String msg, String id, List members) : base(code, msg)
30 | {
31 | this.id = id;
32 | this.members = members;
33 | }
34 |
35 | public GroupUserQueryResult(int code, List members): base(code, "")
36 | {
37 | this.members = members;
38 | }
39 |
40 |
41 | public GroupUserQueryResult(String id, List members)
42 | {
43 | this.id = id;
44 | this.members = members;
45 | }
46 |
47 | override
48 | public String ToString()
49 | {
50 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/models/response/HistoryMessageResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | /**
10 | * historyMessage返回结果
11 | */
12 | public class HistoryMessageResult : Result
13 |
14 | {
15 |
16 | // 历史消息下载地址。
17 | [JsonProperty(PropertyName = "url")]
18 | String url;
19 | // 历史记录时间。(yyyymmddhh)
20 | [JsonProperty(PropertyName = "date")]
21 | String date;
22 |
23 | [JsonIgnore]
24 | public string Url { get => url; set => url = value; }
25 | [JsonIgnore]
26 | public string Date { get => date; set => date = value; }
27 |
28 | public HistoryMessageResult(int code, String url, String date, String errorMessage):base(code, errorMessage)
29 | {
30 | this.code = code;
31 | this.url = url;
32 | this.date = date;
33 | this.msg = errorMessage;
34 | }
35 |
36 | override
37 | public String ToString()
38 | {
39 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/models/response/ListBlockChatroomUserResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.chatroom;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class ListBlockChatroomUserResult : Result
11 |
12 | {
13 | /**
14 | * 被封禁用户列表
15 | *
16 | */
17 | [JsonProperty(PropertyName = "members")]
18 | List members;
19 |
20 | [JsonIgnore]
21 | internal List Members { get => members; set => members = value; }
22 |
23 | public ListBlockChatroomUserResult()
24 | {
25 |
26 | }
27 |
28 | public ListBlockChatroomUserResult(int code, String msg, List members) : base(code, msg)
29 | {
30 | this.members = members;
31 | }
32 |
33 | public ListBlockChatroomUserResult(List members)
34 | {
35 | this.members = members;
36 | }
37 |
38 | override
39 | public String ToString()
40 | {
41 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/models/response/ListGagChatroomUserResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.chatroom;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class ListGagChatroomUserResult : Result
11 |
12 | {
13 | /**
14 | * 聊天室被禁言用户列表。
15 | *
16 | */
17 | [JsonProperty(PropertyName = "members")]
18 | List members;
19 |
20 | [JsonIgnore]
21 | internal List Members { get => members; set => members = value; }
22 |
23 | public ListGagChatroomUserResult()
24 | {
25 |
26 | }
27 |
28 | public ListGagChatroomUserResult(int code, String msg, List members) : base(code, msg)
29 | {
30 | this.members = members;
31 | }
32 |
33 | public ListGagChatroomUserResult(List members)
34 | {
35 | this.members = members;
36 | }
37 |
38 | override
39 | public String ToString()
40 | {
41 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/models/response/ListGagGroupUserResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | public class ListGagGroupUserResult : Result
10 |
11 | {
12 | // 群组被禁言用户列表。
13 | List members;
14 |
15 | public ListGagGroupUserResult(int code, String msg, List members) : base(code, msg)
16 | {
17 | this.members = members;
18 | }
19 |
20 | public ListGagGroupUserResult(List members)
21 | {
22 | this.members = members;
23 | }
24 |
25 | public ListGagGroupUserResult()
26 | {
27 | }
28 |
29 |
30 |
31 | /**
32 | * 获取members
33 | *
34 | * @return List
35 | */
36 | public List getMembers()
37 | {
38 | return this.members;
39 | }
40 |
41 | /**
42 | * 设置members
43 | *
44 | */
45 | public void setMembers(List members)
46 | {
47 | this.members = members;
48 | }
49 |
50 | override
51 | public String ToString()
52 | {
53 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
54 |
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/models/response/ListWordfilterResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using io.rong.models.sensitiveword;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class ListWordfilterResult:Result
11 |
12 | {
13 | // 敏感词内容。
14 |
15 | [JsonProperty(PropertyName = "words")]
16 | List words;
17 |
18 | [JsonIgnore]
19 | public List Words { get => words; set => words = value; }
20 |
21 | public ListWordfilterResult()
22 | {
23 | }
24 |
25 | public ListWordfilterResult(int code, List words, String errorMessage):base(code, errorMessage)
26 | {
27 | this.code = code;
28 | this.words = words;
29 | this.msg = errorMessage;
30 | }
31 |
32 | override
33 | public String ToString()
34 | {
35 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/models/response/PushResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Newtonsoft.Json;
6 |
7 | namespace io.rong.models.response
8 | {
9 | /**
10 | * push 返回结果
11 | */
12 | public class PushResult : Result
13 | {
14 |
15 | /**
16 | * 推送唯一标识。
17 | */
18 | private String id;
19 |
20 | public String GetId()
21 | {
22 | return id;
23 | }
24 |
25 | public void SetId(String id)
26 | {
27 | this.id = id;
28 | }
29 |
30 |
31 | public PushResult(int code, String id) : base(code, id)
32 | {
33 | this.code = code;
34 | this.id = id;
35 | }
36 |
37 | override
38 | public String ToString()
39 | {
40 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/models/response/ResponseResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | public class ResponseResult : Result
10 |
11 | {
12 | public ResponseResult(int code, string msg) : base(code, msg)
13 | {
14 | this.code = code;
15 | this.msg = msg;
16 | }
17 |
18 | override
19 | public String ToString()
20 | {
21 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
22 | }
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/models/response/TagListResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.push.tag;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 |
6 |
7 | namespace io.rong.models.response
8 | {
9 | public class TagListResult : Result
10 | {
11 | [JsonProperty(PropertyName = "result")]
12 | Dictionary result;
13 |
14 | [JsonIgnore]
15 | public Dictionary Result { get => result; set => result = value; }
16 |
17 | override
18 | public String ToString()
19 | {
20 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/models/response/TokenResult.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | /**
8 | * getToken 返回结果
9 | */
10 | namespace io.rong.models.response
11 | {
12 | public class TokenResult : Result
13 |
14 | {
15 | // 用户 Token,可以保存应用内,长度在 256 字节以内.用户 Token,可以保存应用内,长度在 256 字节以内。
16 | [JsonProperty(PropertyName = "token")]
17 | String token;
18 | // 用户 Id,与输入的用户 Id 相同.
19 | [JsonProperty(PropertyName = "userId")]
20 | private String userId;
21 |
22 | public TokenResult(int code, String token, String userId, String errorMessage)
23 | {
24 | this.code = code;
25 | this.token = token;
26 | this.userId = userId;
27 | this.msg = errorMessage;
28 | }
29 |
30 | [JsonIgnore]
31 | public String Token
32 |
33 | {
34 | get { return this.token; }
35 | set { this.token = value; }
36 | }
37 |
38 | [JsonIgnore]
39 | public string UserId { get => userId; set => userId = value; }
40 | [JsonIgnore]
41 | public string UserId1 { get => userId; set => userId = value; }
42 |
43 | override
44 | public String ToString()
45 | {
46 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
47 | }
48 |
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/models/response/UserList.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.response
8 | {
9 | public class UserList
10 |
11 | {
12 | /**
13 | * 返回码,200 为正常。
14 | *
15 | */
16 | [JsonProperty(PropertyName = "code")]
17 | private int code;
18 | /**
19 | * 黑名单用户列表
20 | */
21 | [JsonProperty(PropertyName = "users")]
22 | private String[] users;
23 |
24 | [JsonIgnore]
25 | public int Code { get => code; set => code = value; }
26 | [JsonIgnore]
27 | public string[] Users { get => users; set => users = value; }
28 |
29 | public UserList(int code, String[] users)
30 | {
31 | this.code = code;
32 | this.users = users;
33 | }
34 |
35 | public String[] getUsers()
36 | {
37 | return this.users;
38 | }
39 |
40 | public void setUsers(String[] users)
41 | {
42 | this.users = users;
43 | }
44 |
45 | public int getCode()
46 | {
47 | return this.code;
48 | }
49 |
50 | public void setCode(int code)
51 | {
52 | this.code = code;
53 | }
54 |
55 | override
56 | public String ToString()
57 | {
58 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/models/response/WhiteListResult.cs:
--------------------------------------------------------------------------------
1 | using io.rong.models.push;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace io.rong.models.response
9 | {
10 | public class WhiteListResult : Result
11 |
12 | {
13 | [JsonProperty(PropertyName = "members")]
14 | private UserModel[] members;
15 |
16 | [JsonIgnore]
17 | internal UserModel[] Members { get => members; set => members = value; }
18 |
19 | public WhiteListResult(int code, String msg) :base(code, msg)
20 | {
21 |
22 | }
23 |
24 | public WhiteListResult(int code, String msg, UserModel[] members) : base(code, msg)
25 | {
26 | this.members = members;
27 | }
28 |
29 | public WhiteListResult(UserModel[] members)
30 | {
31 | this.members = members;
32 | }
33 |
34 | public UserModel[] getMembers()
35 | {
36 | return this.members;
37 | }
38 |
39 | public void setMembers(UserModel[] members)
40 | {
41 | this.members = members;
42 | }
43 |
44 | override
45 | public String ToString()
46 | {
47 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/models/sensitiveword/SensitiveWordModel.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace io.rong.models.sensitiveword
8 | {
9 | /**
10 | * 敏感词、替换词信息
11 | */
12 | public class SensitiveWordModel
13 |
14 | {
15 | /**
16 | * 敏感词类型
17 | */
18 | [JsonProperty(PropertyName = "type")]
19 | int type = 1;
20 | /**
21 | *敏感词
22 | */
23 | [JsonProperty(PropertyName = "keyword")]
24 | String keyword;
25 | /**
26 | *替换词
27 | */
28 | [JsonProperty(PropertyName = "replace")]
29 | String replace;
30 |
31 | [JsonIgnore]
32 | public int Type { get => type; set => type = value; }
33 | [JsonIgnore]
34 | public string Keyword { get => keyword; set => keyword = value; }
35 | [JsonIgnore]
36 | public string Replace { get => replace; set => replace = value; }
37 |
38 | public SensitiveWordModel(int type, String keyword, String replace)
39 | {
40 | this.type = type;
41 | this.keyword = keyword;
42 | this.replace = replace;
43 | }
44 |
45 | public SensitiveWordModel()
46 | {
47 | }
48 |
49 | override
50 | public String ToString()
51 | {
52 | return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/models/user/BlockUser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace io.rong.models.push
7 | {
8 | public class BlockUser
9 |
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/models/user/tag/TagModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Newtonsoft.Json;
6 |
7 | namespace io.rong.models.push.tag
8 | {
9 | public class TagModel
10 | {
11 | [JsonProperty(PropertyName = "userId")]
12 | private String userId;
13 | [JsonProperty(PropertyName = "userIds")]
14 | private String[] userIds;
15 | [JsonProperty(PropertyName = "tags")]
16 | private String[] tags;
17 |
18 | public string GetUserId()
19 | {
20 | return userId;
21 | }
22 |
23 | public void SetUserId(string value)
24 | {
25 | userId = value;
26 | }
27 |
28 | public string[] GetUserIds()
29 | {
30 | return userIds;
31 | }
32 |
33 | public void SetUserIds(string[] value)
34 | {
35 | userIds = value;
36 | }
37 |
38 | public string[] GetTags()
39 | {
40 | return tags;
41 | }
42 |
43 | public void SetTags(string[] value)
44 | {
45 | tags = value;
46 | }
47 |
48 | public TagModel()
49 | {
50 | }
51 |
52 | public TagModel(string userId, string[] tags)
53 | {
54 | this.userId = userId;
55 | this.tags = tags;
56 | }
57 |
58 | public TagModel(string[] userIds, string[] tags)
59 | {
60 | this.userIds = userIds;
61 | this.tags = tags;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.9.0.1/Newtonsoft.Json.9.0.1.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rongcloud/server-sdk-dotnet/b0095490b4896636331a5f0a9fbcd4872f6286ac/packages/Newtonsoft.Json.9.0.1/Newtonsoft.Json.9.0.1.nupkg
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.9.0.1/lib/net20/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rongcloud/server-sdk-dotnet/b0095490b4896636331a5f0a9fbcd4872f6286ac/packages/Newtonsoft.Json.9.0.1/lib/net20/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.9.0.1/lib/net35/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rongcloud/server-sdk-dotnet/b0095490b4896636331a5f0a9fbcd4872f6286ac/packages/Newtonsoft.Json.9.0.1/lib/net35/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.9.0.1/lib/net40/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rongcloud/server-sdk-dotnet/b0095490b4896636331a5f0a9fbcd4872f6286ac/packages/Newtonsoft.Json.9.0.1/lib/net40/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.9.0.1/lib/net45/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rongcloud/server-sdk-dotnet/b0095490b4896636331a5f0a9fbcd4872f6286ac/packages/Newtonsoft.Json.9.0.1/lib/net45/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rongcloud/server-sdk-dotnet/b0095490b4896636331a5f0a9fbcd4872f6286ac/packages/Newtonsoft.Json.9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.9.0.1/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rongcloud/server-sdk-dotnet/b0095490b4896636331a5f0a9fbcd4872f6286ac/packages/Newtonsoft.Json.9.0.1/lib/portable-net40+sl5+wp80+win8+wpa81/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/packages/Newtonsoft.Json.9.0.1/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rongcloud/server-sdk-dotnet/b0095490b4896636331a5f0a9fbcd4872f6286ac/packages/Newtonsoft.Json.9.0.1/lib/portable-net45+wp80+win8+wpa81/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/util/HostType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace io.rong.util
7 | {
8 | public class HostType
9 |
10 | {
11 | private String type;
12 |
13 | public HostType(String type)
14 | {
15 | this.type = type;
16 | }
17 |
18 | public String Type
19 | {
20 | get { return this.type; }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/util/RongJsonUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Newtonsoft.Json;
3 |
4 | namespace io.rong.util {
5 | class RongJsonUtil {
6 | public static ObjType JsonStringToObj(string JsonString) where ObjType : class {
7 | ObjType s = JsonConvert.DeserializeObject(JsonString);
8 | return s;
9 | }
10 |
11 | public static String ObjToJsonString(Object obj)
12 | {
13 | return JsonConvert.SerializeObject(obj, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
14 | }
15 | }
16 |
17 | }
--------------------------------------------------------------------------------