doc: realtime

oneRain 2021-04-20 11:12:47 +08:00
parent 28e6890e94
commit 1cf7684597
21 changed files with 92 additions and 3 deletions

View File

@ -5,7 +5,7 @@ using System.Threading.Tasks;
namespace LeanCloud.Realtime {
/// <summary>
/// Chatroom
/// LCIMChatRoom is a local representation of chatroom in LeanCloud.
/// </summary>
public class LCIMChatRoom : LCIMConversation {
public LCIMChatRoom(LCIMClient client) :
@ -25,14 +25,29 @@ namespace LeanCloud.Realtime {
return await Client.ConversationController.GetOnlineMembers(Id, limit);
}
/// <summary>
/// Adds members to this conversation.
/// </summary>
/// <param name="clientIds"></param>
/// <returns></returns>
public override Task<LCIMPartiallySuccessResult> AddMembers(IEnumerable<string> clientIds) {
throw new Exception("Add members is not allowed in chat room.");
}
/// <summary>
/// Flags the read status of this conversation.
/// But it's nothing to do in LCIMChatRoom.
/// </summary>
/// <returns></returns>
public override Task Read() {
return Task.CompletedTask;
}
/// <summary>
/// Fetchs the recipt timestamps of this conversation.
/// But it's nothing to do in LCIMChatRoom.
/// </summary>
/// <returns></returns>
public override Task FetchReciptTimestamps() {
return Task.CompletedTask;
}

View File

@ -6,7 +6,8 @@ using System.Collections.ObjectModel;
namespace LeanCloud.Realtime {
/// <summary>
/// Conversation
/// LCIMConversation is a local representation of general conversation
/// in LeanCloud.
/// </summary>
public class LCIMConversation {
/// <summary>

View File

@ -1,4 +1,7 @@
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMConversationMemberInfo represents the member info of the conversation.
/// </summary>
public class LCIMConversationMemberInfo {
public const string Owner = "Owner";

View File

@ -3,10 +3,12 @@ using System.Collections;
using System.Collections.ObjectModel;
using LeanCloud.Storage.Internal.Query;
using System.Linq;
using System.Collections.Generic;
using System;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMConversationQuery is the query for conversation.
/// </summary>
public class LCIMConversationQuery {
internal const int CompactFlag = 0x1;
internal const int WithLastMessageFlag = 0x2;

View File

@ -1,6 +1,10 @@
using System;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMMessageQueryEndpoint is the parameter that controls the limitation
/// of querying messages.
/// </summary>
public class LCIMMessageQueryEndpoint {
public string MessageId {
get; set;

View File

@ -2,6 +2,10 @@
using System.Threading.Tasks;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMServiceConversation is a local representation of service conversation
/// in LeanCloud.
/// </summary>
public class LCIMServiceConversation : LCIMConversation {
public LCIMServiceConversation(LCIMClient client) : base(client) {
}

View File

@ -1,6 +1,10 @@
using System;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMTemporaryConversation is a local representation of temporary conversation
/// in LeanCloud.
/// </summary>
public class LCIMTemporaryConversation : LCIMConversation {
public DateTime ExpiredAt {
get;

View File

@ -29,6 +29,9 @@ namespace LeanCloud.Realtime {
get; private set;
}
/// <summary>
/// Device Id
/// </summary>
public string DeviceId {
get; private set;
}
@ -235,6 +238,13 @@ namespace LeanCloud.Realtime {
#region 接口
/// <summary>
/// Constructs a LCIMClient with client id.
/// </summary>
/// <param name="clientId"></param>
/// <param name="tag"></param>
/// <param name="deviceId"></param>
/// <param name="signatureFactory"></param>
public LCIMClient(string clientId,
string tag = null,
string deviceId = null,
@ -245,6 +255,13 @@ namespace LeanCloud.Realtime {
SetUpClient(clientId, tag, deviceId, signatureFactory);
}
/// <summary>
/// Constructs a LCIMClient with a LCUser.
/// </summary>
/// <param name="user"></param>
/// <param name="tag"></param>
/// <param name="deviceId"></param>
/// <param name="signatureFactory"></param>
public LCIMClient(LCUser user,
string tag = null,
string deviceId = null,

View File

@ -2,6 +2,9 @@
using LeanCloud.Realtime.Internal.Connection;
namespace LeanCloud.Realtime {
/// <summary>
/// LCRealtime contains static functions that handle the global connection.
/// </summary>
public class LCRealtime {
/// <summary>
/// Every application uses a connection.

View File

@ -2,6 +2,9 @@
using LeanCloud.Storage;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMAudioMessage is a local representation of audio message in LeanCloud.
/// </summary>
public class LCIMAudioMessage : LCIMFileMessage {
public double Duration {
get; private set;

View File

@ -1,4 +1,7 @@
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMBinaryMessage is a local representation of binary message in LeanCloud.
/// </summary>
public class LCIMBinaryMessage : LCIMMessage {
public byte[] Data {
get; internal set;

View File

@ -5,6 +5,9 @@ using LeanCloud.Storage;
using System.Threading.Tasks;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMFileMessage is a local representation of file message in LeanCloud.
/// </summary>
public class LCIMFileMessage : LCIMTextMessage {
public LCFile File {
get; set;

View File

@ -2,6 +2,9 @@
using LeanCloud.Storage;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMImageMessage is a local representation of image message in LeanCloud.
/// </summary>
public class LCIMImageMessage : LCIMFileMessage {
public int Width {
get; private set;

View File

@ -3,6 +3,9 @@ using System.Collections.Generic;
using LeanCloud.Storage;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMLocationMessage is a local representation of location message in LeanCloud.
/// </summary>
public class LCIMLocationMessage : LCIMTextMessage {
public LCGeoPoint Location {
get; set;

View File

@ -1,6 +1,9 @@
using System.Collections.Generic;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMTextMessage is a local representation of text message in LeanCloud.
/// </summary>
public class LCIMTextMessage : LCIMTypedMessage {
public string Text {
get; set;

View File

@ -2,6 +2,9 @@
using LeanCloud.Storage;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMVideoMessage is a local representation of video message in LeanCloud.
/// </summary>
public class LCIMVideoMessage : LCIMFileMessage {
public int Width {
get; private set;

View File

@ -1,6 +1,9 @@
using System.Collections.Generic;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMOperationFailure is the result that handles the operation of conversation.
/// </summary>
public class LCIMOperationFailure {
public int Code {
get; set;

View File

@ -1,6 +1,9 @@
using System.Collections.ObjectModel;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMPageResult represents the results of query.
/// </summary>
public class LCIMPageResult {
public ReadOnlyCollection<string> Results {
get; internal set;

View File

@ -1,6 +1,9 @@
using System.Collections.Generic;
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMPartiallySuccessResult is the result that handles the operation of conversation.
/// </summary>
public class LCIMPartiallySuccessResult {
public List<string> SuccessfulClientIdList {
get; internal set;

View File

@ -2,6 +2,9 @@
using System.Threading.Tasks;
namespace LeanCloud.Realtime {
/// <summary>
///
/// </summary>
public interface ILCIMSignatureFactory {
Task<LCIMSignature> CreateConnectSignature(string clientId);

View File

@ -1,4 +1,7 @@
namespace LeanCloud.Realtime {
/// <summary>
/// LCIMSignature represents a LCRealtime signature.
/// </summary>
public class LCIMSignature {
public string Signature {
get; set;