syntax = "proto3";

message View {
    string id = 1;
    string belong_to_id = 2;
    string name = 3;
    string desc = 4;
    ViewType view_type = 5;
    int64 version = 6;
    RepeatedView belongings = 7;
    int64 modified_time = 8;
    int64 create_time = 9;
}
message RepeatedView {
    repeated View items = 1;
}
message CreateViewRequest {
    string belong_to_id = 1;
    string name = 2;
    string desc = 3;
    oneof one_of_thumbnail { string thumbnail = 4; };
    ViewType view_type = 5;
}
message CreateViewParams {
    string belong_to_id = 1;
    string name = 2;
    string desc = 3;
    string thumbnail = 4;
    ViewType view_type = 5;
    string view_data = 6;
    string view_id = 7;
}
message QueryViewRequest {
    repeated string view_ids = 1;
}
message ViewId {
    string view_id = 1;
}
message RepeatedViewId {
    repeated string items = 1;
}
message UpdateViewRequest {
    string view_id = 1;
    oneof one_of_name { string name = 2; };
    oneof one_of_desc { string desc = 3; };
    oneof one_of_thumbnail { string thumbnail = 4; };
}
message UpdateViewParams {
    string view_id = 1;
    oneof one_of_name { string name = 2; };
    oneof one_of_desc { string desc = 3; };
    oneof one_of_thumbnail { string thumbnail = 4; };
}
enum ViewType {
    Blank = 0;
    Doc = 1;
}
