分层重构
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
namespace adminive {
|
||||
enum class Field_Control {
|
||||
automatic,
|
||||
text,
|
||||
multiline_text,
|
||||
number,
|
||||
boolean,
|
||||
select,
|
||||
date,
|
||||
color
|
||||
};
|
||||
inline std::string_view field_control_name(Field_Control value) noexcept {
|
||||
switch(value) {
|
||||
case Field_Control::automatic:
|
||||
return "automatic";
|
||||
case Field_Control::text:
|
||||
return "text";
|
||||
case Field_Control::multiline_text:
|
||||
return "multiline_text";
|
||||
case Field_Control::number:
|
||||
return "number";
|
||||
case Field_Control::boolean:
|
||||
return "boolean";
|
||||
case Field_Control::select:
|
||||
return "select";
|
||||
case Field_Control::date:
|
||||
return "date";
|
||||
case Field_Control::color:
|
||||
return "color";
|
||||
}
|
||||
return "automatic";
|
||||
}
|
||||
struct Field_Presentation {
|
||||
std::string label;
|
||||
std::string description;
|
||||
Field_Control control{Field_Control::automatic};
|
||||
std::string visible_on;
|
||||
std::map<std::string, std::string> enum_labels;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user