This commit is contained in:
sam 2024-06-09 15:48:26 +02:00
parent 14f8e77e6a
commit a2f001392b
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
11 changed files with 241 additions and 2 deletions

View file

@ -14,8 +14,13 @@ public class MetaController(DatabaseContext db) : ApiControllerBase
var userCount = await db.Users.CountAsync();
var memberCount = await db.Members.CountAsync();
return Ok(new MetaResponse(userCount, memberCount, BuildInfo.Version, BuildInfo.Hash));
return Ok(new MetaResponse(
BuildInfo.Version, BuildInfo.Hash, memberCount,
new UserInfo(userCount, 0, 0, 0))
);
}
private record MetaResponse(int Users, int Members, string Version, string Hash);
private record MetaResponse(string Version, string Hash, int Members, UserInfo Users);
private record UserInfo(int Total, int ActiveMonth, int ActiveWeek, int ActiveDay);
}