Skip to content

Commit

Permalink
Update Code
Browse files Browse the repository at this point in the history
  • Loading branch information
Awbugl committed Aug 5, 2023
1 parent b2ecfad commit 8b1d484
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Beans/Json/ArcSongdata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ public class ArcSongdata
public int Score { get; set; }

[JsonProperty("shiny_perfect_count")]
public string MaxPure { get; set; }
public string MaxPure { get; set; } = "?";

[JsonProperty("perfect_count")]
public string Pure { get; set; }
public string Pure { get; set; } = "?";

[JsonProperty("near_count")]
public string Far { get; set; }
public string Far { get; set; } = "?";

[JsonProperty("miss_count")]
public string Lost { get; set; }
public string Lost { get; set; } = "?";

[JsonProperty("time_played")]
public long TimePlayed { get; set; }
Expand Down
12 changes: 9 additions & 3 deletions ImageAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,27 @@ private static FileStreamResult FileStreamResult(BackGround backGround)
}

[HttpPost("user/best30")]
public async Task<FileStreamResult> GetUserBest30([FromBody] ResponseRoot<UserBestsContent> json, ImgVersion imgVersion)
public async Task<FileStreamResult> GetUserBest30(
[FromBody] ResponseRoot<UserBestsContent> json,
[FromQuery(Name = "image_version")] ImgVersion imgVersion)
{
var backGround = await GetBestsGeneratorImage(json.Content, imgVersion);
return FileStreamResult(backGround);
}

[HttpPost("user/best")]
public async Task<FileStreamResult> GetUserBest([FromBody] ResponseRoot<UserBestContent> json, ImgVersion imgVersion)
public async Task<FileStreamResult> GetUserBest(
[FromBody] ResponseRoot<UserBestContent> json,
[FromQuery(Name = "image_version")] ImgVersion imgVersion)
{
var backGround = await RecordGenerator.Generate(json.Content, imgVersion);
return FileStreamResult(backGround);
}

[HttpPost("user/info")]
public async Task<FileStreamResult> GetUserInfo([FromBody] ResponseRoot<UserInfoContent> json, ImgVersion imgVersion)
public async Task<FileStreamResult> GetUserInfo(
[FromBody] ResponseRoot<UserInfoContent> json,
[FromQuery(Name = "image_version")] ImgVersion imgVersion)
{
var backGround = await RecordGenerator.Generate(json.Content, imgVersion);
return FileStreamResult(backGround);
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,25 @@
> 您应知悉,使用本项目将违反 [Arcaea使用条款](https://arcaea.lowiro.com/zh/terms_of_service) 中的 3.2-4 和 3.2-6,以及 [Arcaea二次创作管理条例](https://arcaea.lowiro.com/zh/derivative_policy)
>
> 因使用本项目而造成的损失,Andreal开发组不予承担任何责任。
#### 对外API

- `POST /user/best30/` 生成用户的最近30首谱面的查分图
- `image_version` 图片类型,作为查询参数,可选值为 `1``2`
- `body` UnofficialArcaeaAPI 的对应API的返回值,作为请求体

- `POST /user/best/` 生成用户的最高分数样式的查分图
- `image_version` 图片类型,作为查询参数,可选值为 `1``2``3`
- `body` UnofficialArcaeaAPI 的对应API的返回值,作为请求体

- `POST /user/info/` 生成用户的最近分数样式的查分图
- `image_version` 图片类型,作为查询参数,可选值为 `1``2``3`
- `body` UnofficialArcaeaAPI 的对应API的返回值,作为请求体

* UnofficialArcaeaAPI 的返回值格式请参考 [UnofficialArcaeaAPI.Docs](https://github.com/Arcaea-Infinity/UnofficialArcaeaAPI.Docs)

#### 本地部署

1. 下载本项目的[release版本](https://github.com/Awbugl/AndrealImageGenerator/releases/)

2. 运行 `AndrealImageGenerator.exe` 即可启动服务

0 comments on commit 8b1d484

Please sign in to comment.