Skip to content
Repos

DevPlaceApp

C++ 438 B19 lines Opens in site

Directory Raw Download

#pragma once
// Spec: models.md ReportReason. fromJson reads one item; listFromJson reads {"reasons":[{key,label},...]}.
#include <string>
#include <vector>

#include "core/Json.hpp"

namespace dp {

struct ReportReason {
  std::string key;
  std::string label;

  static ReportReason fromJson(const Json& j);
  static std::vector<ReportReason> listFromJson(const Json& j);
  std::string id() const { return key; }
};

}  // namespace dp
33.3ms