zn-cloud-wcs/yudao-module-grpc/yudao-module-grpc-lib/src/main/proto/model/common/schema.proto
2024-12-26 17:50:50 +08:00

139 lines
3.1 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package device.proto.model.common.schema;
option csharp_namespace = "Al.Proto.Model.Common.Schema";
//枚举值
message EnumValue {
//枚举值
int64 value = 1;
//对应的串字面值
string text = 2;
//备注信息
string remark = 3;
}
//类型元描述
message TypeAttribute {
//类型分类
enum Category {
//类型分类:未知
UNKNOWN = 0;
//类型分类:布尔
BOOLEAN = 1;
//类型分类有符号8位整数
INT8 = 2;
//类型分类无符号8位整数
UINT8 = 3;
//类型分类有符号16位整数
INT16 = 4;
//类型分类无符号16位整数
UINT16 = 5;
//类型分类有符号32位整数
INT32 = 6;
//类型分类无符号32位整数
UINT32 = 7;
//类型分类有符号64位整数
INT64 = 8;
//类型分类无符号64位整数
UINT64 = 9;
//类型分类:小数
FLOAT = 10;
//类型分类:字符串
STRING = 15;
//类型分类:枚举值
ENUM = 20;
//类型分类:数组/集合
ARRAY = 25;
//类型分类:键值对
MAP = 26;
//类型分类:变体
VARIANT = 29;
//类型分类:对象
OBJECT = 30;
}
//初始值
message InitialValue {
oneof kind_of_initial {
//浮点小数值
double floating = 1;
//整数值
uint64 integer = 2;
//文本值
string text = 3;
//枚举值
EnumValue enum_value = 4;
//布尔值
bool boolean = 5;
}
}
//可选值
message OptionValue {
oneof kind_of_value {
//浮点小数值
double floating = 1;
//整数值
uint64 integer = 2;
//文本值
string text = 3;
//枚举值
EnumValue enum_value = 4;
}
}
//类型定义
string definition = 1;
//类型分类
Category category = 2;
//概要备注信息
string remark = 3;
//默认初始值
InitialValue initial = 4;
//依赖的类型定义
repeated string dependencies = 5;
//详细备注信息
string note = 6;
//是否必要/必填
bool necessary = 11;
//是否只读
bool readonly = 13;
//匹配信息
string pattern = 15;
oneof kind_of_range_min {
//最小整数
int64 min_integer_value = 17;
//最小浮点数
double min_float_value = 18;
}
oneof kind_of_range_max {
//最大整数
uint64 max_integer_value = 19;
//最大浮点数
double max_float_value = 20;
}
//是否可扩展,仅针对枚举类型
bool extendable = 21;
//可选值
repeated OptionValue options = 22;
//装饰属性信息
map<string, string> decorators = 23;
}
//类型信息
message TypeSchema {
//类型属性
TypeAttribute attr = 1;
//字段集合
map<string, TypeAttribute> fields = 4;
}