refactor: Common components are moved to the Common library.

This commit is contained in:
real-zony
2022-10-06 13:02:20 +08:00
parent ecab0e0f5c
commit 740e8f4c63
64 changed files with 84 additions and 150 deletions

View File

@@ -0,0 +1,33 @@
using Newtonsoft.Json;
namespace ZonyLrcTools.Common.Lyrics.Providers.QQMusic.JsonModel
{
public class GetLyricRequest
{
[JsonProperty("nobase64")] public int IsNoBase64Encoding { get; set; }
[JsonProperty("songmid")] public string SongId { get; set; }
[JsonProperty("platform")] public string ClientPlatform { get; set; }
[JsonProperty("inCharset")] public string InCharset { get; set; }
[JsonProperty("outCharset")] public string OutCharset { get; set; }
[JsonProperty("g_tk")] public int Gtk { get; set; }
protected GetLyricRequest()
{
}
public GetLyricRequest(string songId)
{
IsNoBase64Encoding = 1;
SongId = songId;
ClientPlatform = "yqq";
InCharset = "utf8";
OutCharset = "utf-8";
Gtk = 5381;
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Text;
using System.Web;
using Newtonsoft.Json;
namespace ZonyLrcTools.Common.Lyrics.Providers.QQMusic.JsonModel
{
public class SongSearchRequest
{
[JsonProperty("format")]
public string Format { get; protected set; }
[JsonProperty("inCharset")]
public string InCharset { get; protected set; }
[JsonProperty("outCharset")]
public string OutCharset { get; protected set; }
[JsonProperty("platform")]
public string Platform { get; protected set; }
[JsonProperty("key")]
public string Keyword { get; protected set; }
protected SongSearchRequest()
{
Format = "json";
InCharset = OutCharset = "utf-8";
Platform = "yqq.json";
}
public SongSearchRequest(string musicName, string artistName) : this()
{
Keyword = HttpUtility.UrlEncode($"{musicName}+{artistName}", Encoding.UTF8);
}
}
}

View File

@@ -0,0 +1,26 @@
using Newtonsoft.Json;
namespace ZonyLrcTools.Common.Lyrics.Providers.QQMusic.JsonModel
{
public class SongSearchResponse
{
[JsonProperty("code")] public int StatusCode { get; set; }
[JsonProperty("data")] public QQMusicInnerDataModel Data { get; set; }
}
public class QQMusicInnerDataModel
{
[JsonProperty("song")] public QQMusicInnerSongModel Song { get; set; }
}
public class QQMusicInnerSongModel
{
[JsonProperty("itemlist")] public List<QQMusicInnerSongItem> SongItems { get; set; }
}
public class QQMusicInnerSongItem
{
[JsonProperty("mid")] public string SongId { get; set; }
}
}