Skip to content
Repos

DevPlaceApp

C++ 688 B30 lines Opens in site

Directory Raw Download

#pragma once
// Spec: models.md User. Wire: uid, username, avatar_seed?, role?, bio?, location?, git_link?, website?, level?, xp?, stars?, created_at?.
#include <cstdint>
#include <optional>
#include <string>

#include "core/Date.hpp"
#include "core/Json.hpp"
#include "model/Role.hpp"

namespace dp {

struct User {
  std::string id;
  std::string username;
  std::optional<std::string> avatarSeed;
  std::optional<Role> role;
  std::string bio;
  std::string location;
  std::string gitLink;
  std::string website;
  std::int64_t level = 0;
  std::int64_t xp = 0;
  std::int64_t stars = 0;
  std::optional<Date> createdAt;

  static User fromJson(const Json& j);
};

}  // namespace dp
31.2ms