First stuff

This commit is contained in:
2022-04-18 16:08:19 +02:00
parent abb9b3f415
commit e7c2ae7b8d
17 changed files with 737 additions and 30 deletions

View File

@@ -0,0 +1,59 @@
using System.Text;
using APP.DTO;
namespace APP.Utility;
public static class StringAssemble
{
public static string UserInfo(User? user)
{
if (user == null)
{
return string.Empty;
}
var sb = new StringBuilder();
sb.Append("MAL ID:");
sb.AppendLine();
sb.Append("Last online:");
sb.AppendLine();
if (!string.IsNullOrEmpty(user.Location))
{
sb.Append("Location:");
sb.AppendLine();
}
sb.Append("Joined:");
sb.AppendLine();
return sb.ToString();
}
public static string UserData(User? user)
{
if (user == null)
{
return string.Empty;
}
var sb = new StringBuilder();
sb.Append(user.Id);
sb.AppendLine();
sb.Append(user.LastOnline);
sb.AppendLine();
if (!string.IsNullOrEmpty(user.Location))
{
sb.Append(user.Location);
sb.AppendLine();
}
sb.Append(user.Joined.ToShortDateString());
sb.AppendLine();
return sb.ToString();
}
}