Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix type of PutPolicy properties not matching the server #261

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/Qiniu/Storage/PutPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class PutPolicy
/// [必需]上传策略失效时刻,请使用SetExpire来设置它
/// </summary>
[JsonProperty("deadline")]
public int Deadline { get; private set; }
public long Deadline { get; private set; }

/// <summary>
/// [可选]"仅新增"模式
Expand Down Expand Up @@ -115,13 +115,13 @@ public class PutPolicy
/// [可选]上传文件大小限制:最小值,单位Byte
/// </summary>
[JsonProperty("fsizeMin", NullValueHandling = NullValueHandling.Ignore)]
public int? FsizeMin { get; set; }
public long? FsizeMin { get; set; }

/// <summary>
/// [可选]上传文件大小限制:最大值,单位Byte
/// </summary>
[JsonProperty("fsizeLimit", NullValueHandling = NullValueHandling.Ignore)]
public int? FsizeLimit { get; set; }
public long? FsizeLimit { get; set; }

/// <summary>
/// [可选]上传时是否自动检测MIME
Expand Down Expand Up @@ -153,7 +153,12 @@ public class PutPolicy
/// <param name="expireInSeconds"></param>
public void SetExpires(int expireInSeconds)
{
this.Deadline = (int)Util.UnixTimestamp.GetUnixTimestamp(expireInSeconds);
this.Deadline = Util.UnixTimestamp.GetUnixTimestamp(expireInSeconds);
}

public void SetExpires(long expireInSeconds)
{
this.Deadline = Util.UnixTimestamp.GetUnixTimestamp(expireInSeconds);
}

/// <summary>
Expand Down
Loading