* AVCloud.cs: chore
* AVFile.cs: * AVUploadProgressEventArgs.cs: * AVDownloadProgressEventArgs.cs:
parent
e4681cfa40
commit
8f7dcc080d
|
@ -7,18 +7,8 @@ using System.Net.Http;
|
||||||
|
|
||||||
namespace LeanCloud {
|
namespace LeanCloud {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The AVCloud class provides methods for interacting with LeanCloud Cloud Functions.
|
/// AVCloud,提供与 LeanCloud 云函数交互的接口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <example>
|
|
||||||
/// For example, this sample code calls the
|
|
||||||
/// "validateGame" Cloud Function and calls processResponse if the call succeeded
|
|
||||||
/// and handleError if it failed.
|
|
||||||
///
|
|
||||||
/// <code>
|
|
||||||
/// var result =
|
|
||||||
/// await AVCloud.CallFunctionAsync<IDictionary<string, object>>("validateGame", parameters);
|
|
||||||
/// </code>
|
|
||||||
/// </example>
|
|
||||||
public static class AVCloud {
|
public static class AVCloud {
|
||||||
internal static AVCloudCodeController CloudCodeController {
|
internal static AVCloudCodeController CloudCodeController {
|
||||||
get {
|
get {
|
||||||
|
@ -111,13 +101,12 @@ namespace LeanCloud {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 发送手机短信,并指定模板以及传入模板所需的参数。
|
/// 发送手机短信,并指定模板以及传入模板所需的参数。
|
||||||
/// Exceptions:
|
/// </summary>
|
||||||
/// AVOSCloud.AVException:
|
|
||||||
/// 手机号为空。
|
|
||||||
/// <param name="mobilePhoneNumber"></param>
|
/// <param name="mobilePhoneNumber"></param>
|
||||||
/// <param name="template">Sms's template</param>
|
/// <param name="template"></param>
|
||||||
/// <param name="env">Template variables env.</param>
|
/// <param name="env"></param>
|
||||||
/// <param name="sign">Sms's sign.</param>
|
/// <param name="sign"></param>
|
||||||
|
/// <param name="validateToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Task RequestSMSCodeAsync(
|
public static Task RequestSMSCodeAsync(
|
||||||
string mobilePhoneNumber,
|
string mobilePhoneNumber,
|
||||||
|
@ -218,7 +207,6 @@ namespace LeanCloud {
|
||||||
/// Verify the user's input of catpcha.
|
/// Verify the user's input of catpcha.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="code">User's input of this captcha.</param>
|
/// <param name="code">User's input of this captcha.</param>
|
||||||
/// <param name="cancellationToken">CancellationToken.</param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task VerifyAsync(string code) {
|
public Task VerifyAsync(string code) {
|
||||||
return AVCloud.VerifyCaptchaAsync(code, Token);
|
return AVCloud.VerifyCaptchaAsync(code, Token);
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace LeanCloud {
|
|
||||||
/// <summary>
|
|
||||||
/// Represents download progress.
|
|
||||||
/// </summary>
|
|
||||||
public class AVDownloadProgressEventArgs : EventArgs {
|
|
||||||
public AVDownloadProgressEventArgs() { }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the progress (a number between 0.0 and 1.0) of a download.
|
|
||||||
/// </summary>
|
|
||||||
public double Progress { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -272,38 +272,15 @@ namespace LeanCloud {
|
||||||
|
|
||||||
#region Save
|
#region Save
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Saves the file to the LeanCloud cloud.
|
|
||||||
/// </summary>
|
|
||||||
public Task SaveAsync() {
|
|
||||||
return SaveAsync(null, CancellationToken.None);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Saves the file to the LeanCloud cloud.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
|
||||||
public Task SaveAsync(CancellationToken cancellationToken) {
|
|
||||||
return SaveAsync(null, cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Saves the file to the LeanCloud cloud.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="progress">The progress callback.</param>
|
|
||||||
public Task SaveAsync(IProgress<AVUploadProgressEventArgs> progress) {
|
|
||||||
return SaveAsync(progress, CancellationToken.None);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the file to the LeanCloud cloud.
|
/// Saves the file to the LeanCloud cloud.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="progress">The progress callback.</param>
|
/// <param name="progress">The progress callback.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
public Task SaveAsync(IProgress<AVUploadProgressEventArgs> progress,
|
public Task SaveAsync(IProgress<AVUploadProgressEventArgs> progress = null,
|
||||||
CancellationToken cancellationToken) {
|
CancellationToken cancellationToken = default) {
|
||||||
if (this.isExternal)
|
if (isExternal)
|
||||||
return this.SaveExternal();
|
return SaveExternal();
|
||||||
|
|
||||||
return taskQueue.Enqueue(
|
return taskQueue.Enqueue(
|
||||||
toAwait => FileController.SaveAsync(state, dataStream, progress, cancellationToken), cancellationToken)
|
toAwait => FileController.SaveAsync(state, dataStream, progress, cancellationToken), cancellationToken)
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace LeanCloud {
|
||||||
/// Represents upload progress.
|
/// Represents upload progress.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AVUploadProgressEventArgs : EventArgs {
|
public class AVUploadProgressEventArgs : EventArgs {
|
||||||
public AVUploadProgressEventArgs() { }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the progress (a number between 0.0 and 1.0) of an upload.
|
/// Gets the progress (a number between 0.0 and 1.0) of an upload.
|
||||||
|
|
Loading…
Reference in New Issue