Skip to content

Commit

Permalink
Merge branch 'develop2'
Browse files Browse the repository at this point in the history
  • Loading branch information
yar229 committed Mar 3, 2020
2 parents 9d07f99 + aeda0f5 commit 290277b
Show file tree
Hide file tree
Showing 12 changed files with 625 additions and 8 deletions.
3 changes: 3 additions & 0 deletions MailRuCloud/MailRuCloudApi/Base/PublicLinkInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ private set
_uri = value;
}
}

public string Key { get; set; }

private Uri _uri;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class YadResponseModel


public class YadResponseModel<TData, TParams> : YadResponseModel
where TData : YadModelDataBase
//where TData : YadModelDataBase
{
[JsonProperty("params")]
public TParams Params { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ public override IEnumerable<KeyValuePair<string, string>> ToKvp(int index)
yield return pair;

yield return new KeyValuePair<string, string>($"idContext.{index}", WebDavPath.Combine(_pathPrefix, Path));

//if (Path == "/Camera")
//{
// yield return new KeyValuePair<string, string>($"idContext.{index}", "/photounlim/");
//}
//else
//{
// yield return new KeyValuePair<string, string>($"idContext.{index}", WebDavPath.Combine(_pathPrefix, Path));
//}

yield return new KeyValuePair<string, string>($"order.{index}", Order.ToString());
yield return new KeyValuePair<string, string>($"sort.{index}", SortBy);
yield return new KeyValuePair<string, string>($"offset.{index}", Offset.ToString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@ public override IEnumerable<KeyValuePair<string, string>> ToKvp(int index)
{
foreach (var pair in base.ToKvp(index))
yield return pair;

yield return new KeyValuePair<string, string>($"id.{index}", WebDavPath.Combine("/disk/", Path));

//if (Path == "/Camera")
//{
// yield return new KeyValuePair<string, string>($"id.{index}", "/photounlim/");
//}
//else
//{
// yield return new KeyValuePair<string, string>($"id.{index}", WebDavPath.Combine("/disk/", Path));
//}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace YaR.Clouds.Base.Repos.YandexDisk.YadWeb.Models.Media
{
class YadAlbumsPostModel : YadPostModel
{
public YadAlbumsPostModel()
{
Name = "albums";
}

public override IEnumerable<KeyValuePair<string, string>> ToKvp(int index)
{
foreach (var pair in base.ToKvp(index))
yield return pair;
}
}

internal class YadAlbumsRequestParams
{
}

internal class YadAlbumsRequestData
{
[JsonProperty("album_type")]
public string AlbumType { get; set; }

[JsonProperty("uid")]
public long Uid { get; set; }

[JsonProperty("mtime")]
public long Mtime { get; set; }

[JsonProperty("id")]
public string Id { get; set; }

[JsonProperty("layout")]
public string Layout { get; set; }

[JsonProperty("title")]
public string Title { get; set; }

[JsonProperty("social_cover_url")]
public string SocialCoverUrl { get; set; }

[JsonProperty("public")]
public FPublic Public { get; set; }

[JsonProperty("album_items_sorting")]
public string AlbumItemsSorting { get; set; }

[JsonProperty("is_empty")]
public bool IsEmpty { get; set; }

[JsonProperty("user")]
public FUser User { get; set; }

[JsonProperty("is_public")]
public bool IsPublic { get; set; }

[JsonProperty("is_blocked")]
public bool IsBlocked { get; set; }

[JsonProperty("fotki_album_id")]
public object FotkiAlbumId { get; set; }

[JsonProperty("ctime")]
public long Ctime { get; set; }

[JsonProperty("cover")]
public Cover Cover { get; set; }

[JsonProperty("is_desc_sorting")]
public bool IsDescSorting { get; set; }

[JsonProperty("social_cover_stid")]
public string SocialCoverStid { get; set; }
}

internal class Cover
{
[JsonProperty("obj_type")]
public string ObjType { get; set; }

[JsonProperty("object")]
public Object Object { get; set; }

[JsonProperty("uid")]
public string Uid { get; set; }

[JsonProperty("album_id")]
public string AlbumId { get; set; }

[JsonProperty("obj_id")]
public string ObjId { get; set; }

[JsonProperty("order_index")]
public double OrderIndex { get; set; }

[JsonProperty("id")]
public string Id { get; set; }
}

internal class Object
{
[JsonProperty("ctime")]
public long Ctime { get; set; }

[JsonProperty("etime")]
public long Etime { get; set; }

[JsonProperty("meta")]
public FMeta Meta { get; set; }

[JsonProperty("mtime")]
public long Mtime { get; set; }

[JsonProperty("path")]
public string Path { get; set; }

[JsonProperty("utime")]
public long Utime { get; set; }

[JsonProperty("type")]
public string Type { get; set; }

[JsonProperty("id")]
public string Id { get; set; }

[JsonProperty("name")]
public string Name { get; set; }
}

internal class FMeta
{
[JsonProperty("sizes")]
public FSize[] Sizes { get; set; }

[JsonProperty("mediatype")]
public string Mediatype { get; set; }

[JsonProperty("etime")]
public long Etime { get; set; }

[JsonProperty("storage_type")]
public string StorageType { get; set; }

[JsonProperty("file_id")]
public string FileId { get; set; }

[JsonProperty("size")]
public long Size { get; set; }
}

internal class FSize
{
[JsonProperty("url")]
public string Url { get; set; }

[JsonProperty("name")]
public string Name { get; set; }
}

internal class FPublic
{
[JsonProperty("public_key")]
public string PublicKey { get; set; }

[JsonProperty("public_url")]
public string PublicUrl { get; set; }

[JsonProperty("views_count")]
public long ViewsCount { get; set; }

[JsonProperty("short_url")]
public string ShortUrl { get; set; }
}

internal class FUser
{
[JsonProperty("username")]
public string Username { get; set; }

[JsonProperty("public_name")]
public string PublicName { get; set; }

[JsonProperty("display_name")]
public string DisplayName { get; set; }

[JsonProperty("uid")]
public string Uid { get; set; }

[JsonProperty("locale")]
public string Locale { get; set; }

[JsonProperty("login")]
public string Login { get; set; }

[JsonProperty("paid")]
public long Paid { get; set; }

[JsonProperty("advertising_enabled")]
public long AdvertisingEnabled { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace YaR.Clouds.Base.Repos.YandexDisk.YadWeb.Models.Media
{
class YadGetAlbumsSlicesPostModel : YadPostModel
{
public YadGetAlbumsSlicesPostModel()
{
Name = "getAlbumsSlices";
}

public override IEnumerable<KeyValuePair<string, string>> ToKvp(int index)
{
foreach (var pair in base.ToKvp(index))
yield return pair;
}
}

internal class YadGetAlbumsSlicesRequestParams
{
}


internal class YadGetAlbumsSlicesRequestData : YadModelDataBase
{
[JsonProperty("albums")]
public GAlbums Albums { get; set; }
}

internal class GAlbums
{
[JsonProperty("videos")]
public GAlbum Videos { get; set; }

[JsonProperty("photounlim")]
public GAlbum Photounlim { get; set; }

[JsonProperty("camera")]
public GAlbum Camera { get; set; }
}

internal class GAlbum
{
[JsonProperty("id")]
public string Id { get; set; }

[JsonProperty("count")]
public long Count { get; set; }

[JsonProperty("preview")]
public string Preview { get; set; }
}
}
Loading

0 comments on commit 290277b

Please sign in to comment.