Skip to content

Commit

Permalink
fix type of PutPolicy properties not matching the server
Browse files Browse the repository at this point in the history
  • Loading branch information
lihsai0 committed Dec 13, 2023
1 parent 2e55079 commit 635d556
Showing 1 changed file with 9 additions and 4 deletions.
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

0 comments on commit 635d556

Please sign in to comment.