mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
config doc test with view
This commit is contained in:
parent
68df54e9f2
commit
59d447e27b
@ -1,6 +1,6 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_create.proto
|
||||
// source: doc.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
@ -9,67 +9,6 @@ import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class CreateDocRequest extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateDocRequest', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
CreateDocRequest._() : super();
|
||||
factory CreateDocRequest({
|
||||
$core.String? id,
|
||||
$core.String? data,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (id != null) {
|
||||
_result.id = id;
|
||||
}
|
||||
if (data != null) {
|
||||
_result.data = data;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory CreateDocRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory CreateDocRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
CreateDocRequest clone() => CreateDocRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
CreateDocRequest copyWith(void Function(CreateDocRequest) updates) => super.copyWith((message) => updates(message as CreateDocRequest)) as CreateDocRequest; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static CreateDocRequest create() => CreateDocRequest._();
|
||||
CreateDocRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<CreateDocRequest> createRepeated() => $pb.PbList<CreateDocRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static CreateDocRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateDocRequest>(create);
|
||||
static CreateDocRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get id => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set id($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get data => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set data($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasData() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearData() => clearField(2);
|
||||
}
|
||||
|
||||
class CreateDocParams extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateDocParams', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||
@ -192,3 +131,124 @@ class Doc extends $pb.GeneratedMessage {
|
||||
void clearData() => clearField(2);
|
||||
}
|
||||
|
||||
enum UpdateDocParams_OneOfData {
|
||||
data,
|
||||
notSet
|
||||
}
|
||||
|
||||
class UpdateDocParams extends $pb.GeneratedMessage {
|
||||
static const $core.Map<$core.int, UpdateDocParams_OneOfData> _UpdateDocParams_OneOfDataByTag = {
|
||||
2 : UpdateDocParams_OneOfData.data,
|
||||
0 : UpdateDocParams_OneOfData.notSet
|
||||
};
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateDocParams', createEmptyInstance: create)
|
||||
..oo(0, [2])
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
UpdateDocParams._() : super();
|
||||
factory UpdateDocParams({
|
||||
$core.String? id,
|
||||
$core.String? data,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (id != null) {
|
||||
_result.id = id;
|
||||
}
|
||||
if (data != null) {
|
||||
_result.data = data;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory UpdateDocParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory UpdateDocParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
UpdateDocParams clone() => UpdateDocParams()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
UpdateDocParams copyWith(void Function(UpdateDocParams) updates) => super.copyWith((message) => updates(message as UpdateDocParams)) as UpdateDocParams; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static UpdateDocParams create() => UpdateDocParams._();
|
||||
UpdateDocParams createEmptyInstance() => create();
|
||||
static $pb.PbList<UpdateDocParams> createRepeated() => $pb.PbList<UpdateDocParams>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static UpdateDocParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateDocParams>(create);
|
||||
static UpdateDocParams? _defaultInstance;
|
||||
|
||||
UpdateDocParams_OneOfData whichOneOfData() => _UpdateDocParams_OneOfDataByTag[$_whichOneof(0)]!;
|
||||
void clearOneOfData() => clearField($_whichOneof(0));
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get id => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set id($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get data => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set data($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasData() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearData() => clearField(2);
|
||||
}
|
||||
|
||||
class QueryDocParams extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'QueryDocParams', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
QueryDocParams._() : super();
|
||||
factory QueryDocParams({
|
||||
$core.String? docId,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (docId != null) {
|
||||
_result.docId = docId;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory QueryDocParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory QueryDocParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
QueryDocParams clone() => QueryDocParams()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
QueryDocParams copyWith(void Function(QueryDocParams) updates) => super.copyWith((message) => updates(message as QueryDocParams)) as QueryDocParams; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static QueryDocParams create() => QueryDocParams._();
|
||||
QueryDocParams createEmptyInstance() => create();
|
||||
static $pb.PbList<QueryDocParams> createRepeated() => $pb.PbList<QueryDocParams>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static QueryDocParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<QueryDocParams>(create);
|
||||
static QueryDocParams? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get docId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set docId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasDocId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearDocId() => clearField(1);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_query.proto
|
||||
// source: doc.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
@ -1,6 +1,6 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_create.proto
|
||||
// source: doc.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
@ -8,17 +8,6 @@
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use createDocRequestDescriptor instead')
|
||||
const CreateDocRequest$json = const {
|
||||
'1': 'CreateDocRequest',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||
const {'1': 'data', '3': 2, '4': 1, '5': 9, '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `CreateDocRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List createDocRequestDescriptor = $convert.base64Decode('ChBDcmVhdGVEb2NSZXF1ZXN0Eg4KAmlkGAEgASgJUgJpZBISCgRkYXRhGAIgASgJUgRkYXRh');
|
||||
@$core.Deprecated('Use createDocParamsDescriptor instead')
|
||||
const CreateDocParams$json = const {
|
||||
'1': 'CreateDocParams',
|
||||
@ -41,3 +30,27 @@ const Doc$json = const {
|
||||
|
||||
/// Descriptor for `Doc`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List docDescriptor = $convert.base64Decode('CgNEb2MSDgoCaWQYASABKAlSAmlkEhIKBGRhdGEYAiABKAlSBGRhdGE=');
|
||||
@$core.Deprecated('Use updateDocParamsDescriptor instead')
|
||||
const UpdateDocParams$json = const {
|
||||
'1': 'UpdateDocParams',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||
const {'1': 'data', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'data'},
|
||||
],
|
||||
'8': const [
|
||||
const {'1': 'one_of_data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `UpdateDocParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List updateDocParamsDescriptor = $convert.base64Decode('Cg9VcGRhdGVEb2NQYXJhbXMSDgoCaWQYASABKAlSAmlkEhQKBGRhdGEYAiABKAlIAFIEZGF0YUINCgtvbmVfb2ZfZGF0YQ==');
|
||||
@$core.Deprecated('Use queryDocParamsDescriptor instead')
|
||||
const QueryDocParams$json = const {
|
||||
'1': 'QueryDocParams',
|
||||
'2': const [
|
||||
const {'1': 'doc_id', '3': 1, '4': 1, '5': 9, '10': 'docId'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `QueryDocParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List queryDocParamsDescriptor = $convert.base64Decode('Cg5RdWVyeURvY1BhcmFtcxIVCgZkb2NfaWQYASABKAlSBWRvY0lk');
|
@ -1,9 +1,9 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_query.proto
|
||||
// source: doc.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
export 'doc_query.pb.dart';
|
||||
export 'doc.pb.dart';
|
||||
|
@ -1,7 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_create.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
@ -1,9 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_create.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
export 'doc_create.pb.dart';
|
||||
|
@ -1,159 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_modify.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
enum UpdateDocRequest_OneOfData {
|
||||
data,
|
||||
notSet
|
||||
}
|
||||
|
||||
class UpdateDocRequest extends $pb.GeneratedMessage {
|
||||
static const $core.Map<$core.int, UpdateDocRequest_OneOfData> _UpdateDocRequest_OneOfDataByTag = {
|
||||
2 : UpdateDocRequest_OneOfData.data,
|
||||
0 : UpdateDocRequest_OneOfData.notSet
|
||||
};
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateDocRequest', createEmptyInstance: create)
|
||||
..oo(0, [2])
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
UpdateDocRequest._() : super();
|
||||
factory UpdateDocRequest({
|
||||
$core.String? id,
|
||||
$core.String? data,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (id != null) {
|
||||
_result.id = id;
|
||||
}
|
||||
if (data != null) {
|
||||
_result.data = data;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory UpdateDocRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory UpdateDocRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
UpdateDocRequest clone() => UpdateDocRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
UpdateDocRequest copyWith(void Function(UpdateDocRequest) updates) => super.copyWith((message) => updates(message as UpdateDocRequest)) as UpdateDocRequest; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static UpdateDocRequest create() => UpdateDocRequest._();
|
||||
UpdateDocRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<UpdateDocRequest> createRepeated() => $pb.PbList<UpdateDocRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static UpdateDocRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateDocRequest>(create);
|
||||
static UpdateDocRequest? _defaultInstance;
|
||||
|
||||
UpdateDocRequest_OneOfData whichOneOfData() => _UpdateDocRequest_OneOfDataByTag[$_whichOneof(0)]!;
|
||||
void clearOneOfData() => clearField($_whichOneof(0));
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get id => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set id($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get data => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set data($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasData() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearData() => clearField(2);
|
||||
}
|
||||
|
||||
enum UpdateDocParams_OneOfData {
|
||||
data,
|
||||
notSet
|
||||
}
|
||||
|
||||
class UpdateDocParams extends $pb.GeneratedMessage {
|
||||
static const $core.Map<$core.int, UpdateDocParams_OneOfData> _UpdateDocParams_OneOfDataByTag = {
|
||||
2 : UpdateDocParams_OneOfData.data,
|
||||
0 : UpdateDocParams_OneOfData.notSet
|
||||
};
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateDocParams', createEmptyInstance: create)
|
||||
..oo(0, [2])
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
UpdateDocParams._() : super();
|
||||
factory UpdateDocParams({
|
||||
$core.String? id,
|
||||
$core.String? data,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (id != null) {
|
||||
_result.id = id;
|
||||
}
|
||||
if (data != null) {
|
||||
_result.data = data;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory UpdateDocParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory UpdateDocParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
UpdateDocParams clone() => UpdateDocParams()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
UpdateDocParams copyWith(void Function(UpdateDocParams) updates) => super.copyWith((message) => updates(message as UpdateDocParams)) as UpdateDocParams; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static UpdateDocParams create() => UpdateDocParams._();
|
||||
UpdateDocParams createEmptyInstance() => create();
|
||||
static $pb.PbList<UpdateDocParams> createRepeated() => $pb.PbList<UpdateDocParams>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static UpdateDocParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateDocParams>(create);
|
||||
static UpdateDocParams? _defaultInstance;
|
||||
|
||||
UpdateDocParams_OneOfData whichOneOfData() => _UpdateDocParams_OneOfDataByTag[$_whichOneof(0)]!;
|
||||
void clearOneOfData() => clearField($_whichOneof(0));
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get id => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set id($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get data => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set data($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasData() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearData() => clearField(2);
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_modify.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
@ -1,38 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_modify.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use updateDocRequestDescriptor instead')
|
||||
const UpdateDocRequest$json = const {
|
||||
'1': 'UpdateDocRequest',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||
const {'1': 'data', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'data'},
|
||||
],
|
||||
'8': const [
|
||||
const {'1': 'one_of_data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `UpdateDocRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List updateDocRequestDescriptor = $convert.base64Decode('ChBVcGRhdGVEb2NSZXF1ZXN0Eg4KAmlkGAEgASgJUgJpZBIUCgRkYXRhGAIgASgJSABSBGRhdGFCDQoLb25lX29mX2RhdGE=');
|
||||
@$core.Deprecated('Use updateDocParamsDescriptor instead')
|
||||
const UpdateDocParams$json = const {
|
||||
'1': 'UpdateDocParams',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||
const {'1': 'data', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'data'},
|
||||
],
|
||||
'8': const [
|
||||
const {'1': 'one_of_data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `UpdateDocParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List updateDocParamsDescriptor = $convert.base64Decode('Cg9VcGRhdGVEb2NQYXJhbXMSDgoCaWQYASABKAlSAmlkEhQKBGRhdGEYAiABKAlIAFIEZGF0YUINCgtvbmVfb2ZfZGF0YQ==');
|
@ -1,9 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_modify.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
export 'doc_modify.pb.dart';
|
||||
|
@ -1,105 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_query.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class QueryDocRequest extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'QueryDocRequest', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
QueryDocRequest._() : super();
|
||||
factory QueryDocRequest({
|
||||
$core.String? docId,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (docId != null) {
|
||||
_result.docId = docId;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory QueryDocRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory QueryDocRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
QueryDocRequest clone() => QueryDocRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
QueryDocRequest copyWith(void Function(QueryDocRequest) updates) => super.copyWith((message) => updates(message as QueryDocRequest)) as QueryDocRequest; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static QueryDocRequest create() => QueryDocRequest._();
|
||||
QueryDocRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<QueryDocRequest> createRepeated() => $pb.PbList<QueryDocRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static QueryDocRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<QueryDocRequest>(create);
|
||||
static QueryDocRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get docId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set docId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasDocId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearDocId() => clearField(1);
|
||||
}
|
||||
|
||||
class QueryDocParams extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'QueryDocParams', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
QueryDocParams._() : super();
|
||||
factory QueryDocParams({
|
||||
$core.String? docId,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (docId != null) {
|
||||
_result.docId = docId;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory QueryDocParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory QueryDocParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
QueryDocParams clone() => QueryDocParams()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
QueryDocParams copyWith(void Function(QueryDocParams) updates) => super.copyWith((message) => updates(message as QueryDocParams)) as QueryDocParams; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static QueryDocParams create() => QueryDocParams._();
|
||||
QueryDocParams createEmptyInstance() => create();
|
||||
static $pb.PbList<QueryDocParams> createRepeated() => $pb.PbList<QueryDocParams>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static QueryDocParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<QueryDocParams>(create);
|
||||
static QueryDocParams? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get docId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set docId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasDocId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearDocId() => clearField(1);
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: doc_query.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
|
||||
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use queryDocRequestDescriptor instead')
|
||||
const QueryDocRequest$json = const {
|
||||
'1': 'QueryDocRequest',
|
||||
'2': const [
|
||||
const {'1': 'doc_id', '3': 1, '4': 1, '5': 9, '10': 'docId'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `QueryDocRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List queryDocRequestDescriptor = $convert.base64Decode('Cg9RdWVyeURvY1JlcXVlc3QSFQoGZG9jX2lkGAEgASgJUgVkb2NJZA==');
|
||||
@$core.Deprecated('Use queryDocParamsDescriptor instead')
|
||||
const QueryDocParams$json = const {
|
||||
'1': 'QueryDocParams',
|
||||
'2': const [
|
||||
const {'1': 'doc_id', '3': 1, '4': 1, '5': 9, '10': 'docId'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `QueryDocParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List queryDocParamsDescriptor = $convert.base64Decode('Cg5RdWVyeURvY1BhcmFtcxIVCgZkb2NfaWQYASABKAlSBWRvY0lk');
|
@ -1,7 +1,5 @@
|
||||
// Auto-generated, do not edit
|
||||
export './doc_modify.pb.dart';
|
||||
export './doc_create.pb.dart';
|
||||
export './observable.pb.dart';
|
||||
export './errors.pb.dart';
|
||||
export './event.pb.dart';
|
||||
export './doc_query.pb.dart';
|
||||
export './doc.pb.dart';
|
||||
|
@ -22,10 +22,8 @@ class ErrorCode extends $pb.ProtobufEnum {
|
||||
static const ErrorCode ViewThumbnailInvalid = ErrorCode._(21, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewThumbnailInvalid');
|
||||
static const ErrorCode ViewIdInvalid = ErrorCode._(22, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewIdInvalid');
|
||||
static const ErrorCode ViewDescInvalid = ErrorCode._(23, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ViewDescInvalid');
|
||||
static const ErrorCode DatabaseConnectionFail = ErrorCode._(100, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DatabaseConnectionFail');
|
||||
static const ErrorCode WorkspaceDatabaseError = ErrorCode._(101, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'WorkspaceDatabaseError');
|
||||
static const ErrorCode UserIdIsEmpty = ErrorCode._(102, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserIdIsEmpty');
|
||||
static const ErrorCode UserUnauthorized = ErrorCode._(103, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserUnauthorized');
|
||||
static const ErrorCode UserIdIsEmpty = ErrorCode._(100, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserIdIsEmpty');
|
||||
static const ErrorCode UserUnauthorized = ErrorCode._(101, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UserUnauthorized');
|
||||
static const ErrorCode InternalError = ErrorCode._(1000, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'InternalError');
|
||||
static const ErrorCode RecordNotFound = ErrorCode._(1001, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'RecordNotFound');
|
||||
|
||||
@ -42,8 +40,6 @@ class ErrorCode extends $pb.ProtobufEnum {
|
||||
ViewThumbnailInvalid,
|
||||
ViewIdInvalid,
|
||||
ViewDescInvalid,
|
||||
DatabaseConnectionFail,
|
||||
WorkspaceDatabaseError,
|
||||
UserIdIsEmpty,
|
||||
UserUnauthorized,
|
||||
InternalError,
|
||||
|
@ -24,17 +24,15 @@ const ErrorCode$json = const {
|
||||
const {'1': 'ViewThumbnailInvalid', '2': 21},
|
||||
const {'1': 'ViewIdInvalid', '2': 22},
|
||||
const {'1': 'ViewDescInvalid', '2': 23},
|
||||
const {'1': 'DatabaseConnectionFail', '2': 100},
|
||||
const {'1': 'WorkspaceDatabaseError', '2': 101},
|
||||
const {'1': 'UserIdIsEmpty', '2': 102},
|
||||
const {'1': 'UserUnauthorized', '2': 103},
|
||||
const {'1': 'UserIdIsEmpty', '2': 100},
|
||||
const {'1': 'UserUnauthorized', '2': 101},
|
||||
const {'1': 'InternalError', '2': 1000},
|
||||
const {'1': 'RecordNotFound', '2': 1001},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ErrorCode`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List errorCodeDescriptor = $convert.base64Decode('CglFcnJvckNvZGUSCwoHVW5rbm93bhAAEhgKFFdvcmtzcGFjZU5hbWVJbnZhbGlkEAESFgoSV29ya3NwYWNlSWRJbnZhbGlkEAISGAoUQXBwQ29sb3JTdHlsZUludmFsaWQQAxIYChRXb3Jrc3BhY2VEZXNjSW52YWxpZBAEEhwKGEN1cnJlbnRXb3Jrc3BhY2VOb3RGb3VuZBAFEhAKDEFwcElkSW52YWxpZBAKEhIKDkFwcE5hbWVJbnZhbGlkEAsSEwoPVmlld05hbWVJbnZhbGlkEBQSGAoUVmlld1RodW1ibmFpbEludmFsaWQQFRIRCg1WaWV3SWRJbnZhbGlkEBYSEwoPVmlld0Rlc2NJbnZhbGlkEBcSGgoWRGF0YWJhc2VDb25uZWN0aW9uRmFpbBBkEhoKFldvcmtzcGFjZURhdGFiYXNlRXJyb3IQZRIRCg1Vc2VySWRJc0VtcHR5EGYSFAoQVXNlclVuYXV0aG9yaXplZBBnEhIKDUludGVybmFsRXJyb3IQ6AcSEwoOUmVjb3JkTm90Rm91bmQQ6Qc=');
|
||||
final $typed_data.Uint8List errorCodeDescriptor = $convert.base64Decode('CglFcnJvckNvZGUSCwoHVW5rbm93bhAAEhgKFFdvcmtzcGFjZU5hbWVJbnZhbGlkEAESFgoSV29ya3NwYWNlSWRJbnZhbGlkEAISGAoUQXBwQ29sb3JTdHlsZUludmFsaWQQAxIYChRXb3Jrc3BhY2VEZXNjSW52YWxpZBAEEhwKGEN1cnJlbnRXb3Jrc3BhY2VOb3RGb3VuZBAFEhAKDEFwcElkSW52YWxpZBAKEhIKDkFwcE5hbWVJbnZhbGlkEAsSEwoPVmlld05hbWVJbnZhbGlkEBQSGAoUVmlld1RodW1ibmFpbEludmFsaWQQFRIRCg1WaWV3SWRJbnZhbGlkEBYSEwoPVmlld0Rlc2NJbnZhbGlkEBcSEQoNVXNlcklkSXNFbXB0eRBkEhQKEFVzZXJVbmF1dGhvcml6ZWQQZRISCg1JbnRlcm5hbEVycm9yEOgHEhMKDlJlY29yZE5vdEZvdW5kEOkH');
|
||||
@$core.Deprecated('Use workspaceErrorDescriptor instead')
|
||||
const WorkspaceError$json = const {
|
||||
'1': 'WorkspaceError',
|
||||
|
@ -24,6 +24,8 @@ class WorkspaceEvent extends $pb.ProtobufEnum {
|
||||
static const WorkspaceEvent ReadView = WorkspaceEvent._(202, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ReadView');
|
||||
static const WorkspaceEvent UpdateView = WorkspaceEvent._(203, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UpdateView');
|
||||
static const WorkspaceEvent DeleteView = WorkspaceEvent._(204, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DeleteView');
|
||||
static const WorkspaceEvent OpenView = WorkspaceEvent._(205, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OpenView');
|
||||
static const WorkspaceEvent UpdateViewData = WorkspaceEvent._(206, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UpdateViewData');
|
||||
|
||||
static const $core.List<WorkspaceEvent> values = <WorkspaceEvent> [
|
||||
CreateWorkspace,
|
||||
@ -40,6 +42,8 @@ class WorkspaceEvent extends $pb.ProtobufEnum {
|
||||
ReadView,
|
||||
UpdateView,
|
||||
DeleteView,
|
||||
OpenView,
|
||||
UpdateViewData,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, WorkspaceEvent> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
|
@ -26,8 +26,10 @@ const WorkspaceEvent$json = const {
|
||||
const {'1': 'ReadView', '2': 202},
|
||||
const {'1': 'UpdateView', '2': 203},
|
||||
const {'1': 'DeleteView', '2': 204},
|
||||
const {'1': 'OpenView', '2': 205},
|
||||
const {'1': 'UpdateViewData', '2': 206},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `WorkspaceEvent`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||
final $typed_data.Uint8List workspaceEventDescriptor = $convert.base64Decode('Cg5Xb3Jrc3BhY2VFdmVudBITCg9DcmVhdGVXb3Jrc3BhY2UQABIUChBSZWFkQ3VyV29ya3NwYWNlEAESEgoOUmVhZFdvcmtzcGFjZXMQAhITCg9EZWxldGVXb3Jrc3BhY2UQAxIRCg1PcGVuV29ya3NwYWNlEAQSFQoRUmVhZFdvcmtzcGFjZUFwcHMQBRINCglDcmVhdGVBcHAQZRINCglEZWxldGVBcHAQZhILCgdSZWFkQXBwEGcSDQoJVXBkYXRlQXBwEGgSDwoKQ3JlYXRlVmlldxDJARINCghSZWFkVmlldxDKARIPCgpVcGRhdGVWaWV3EMsBEg8KCkRlbGV0ZVZpZXcQzAE=');
|
||||
final $typed_data.Uint8List workspaceEventDescriptor = $convert.base64Decode('Cg5Xb3Jrc3BhY2VFdmVudBITCg9DcmVhdGVXb3Jrc3BhY2UQABIUChBSZWFkQ3VyV29ya3NwYWNlEAESEgoOUmVhZFdvcmtzcGFjZXMQAhITCg9EZWxldGVXb3Jrc3BhY2UQAxIRCg1PcGVuV29ya3NwYWNlEAQSFQoRUmVhZFdvcmtzcGFjZUFwcHMQBRINCglDcmVhdGVBcHAQZRINCglEZWxldGVBcHAQZhILCgdSZWFkQXBwEGcSDQoJVXBkYXRlQXBwEGgSDwoKQ3JlYXRlVmlldxDJARINCghSZWFkVmlldxDKARIPCgpVcGRhdGVWaWV3EMsBEg8KCkRlbGV0ZVZpZXcQzAESDQoIT3BlblZpZXcQzQESEwoOVXBkYXRlVmlld0RhdGEQzgE=');
|
||||
|
@ -137,6 +137,7 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
||||
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
|
||||
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
||||
..e<ViewType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewType', $pb.PbFieldType.OE, defaultOrMaker: ViewType.Blank, valueOf: ViewType.valueOf, enumValues: ViewType.values)
|
||||
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
@ -147,6 +148,7 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
||||
$core.String? desc,
|
||||
$core.String? thumbnail,
|
||||
ViewType? viewType,
|
||||
$core.String? data,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (belongToId != null) {
|
||||
@ -164,6 +166,9 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
||||
if (viewType != null) {
|
||||
_result.viewType = viewType;
|
||||
}
|
||||
if (data != null) {
|
||||
_result.data = data;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory CreateViewParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
@ -231,6 +236,15 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
||||
$core.bool hasViewType() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearViewType() => clearField(5);
|
||||
|
||||
@$pb.TagNumber(6)
|
||||
$core.String get data => $_getSZ(5);
|
||||
@$pb.TagNumber(6)
|
||||
set data($core.String v) { $_setString(5, v); }
|
||||
@$pb.TagNumber(6)
|
||||
$core.bool hasData() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
void clearData() => clearField(6);
|
||||
}
|
||||
|
||||
class View extends $pb.GeneratedMessage {
|
||||
|
@ -45,11 +45,12 @@ const CreateViewParams$json = const {
|
||||
const {'1': 'desc', '3': 3, '4': 1, '5': 9, '10': 'desc'},
|
||||
const {'1': 'thumbnail', '3': 4, '4': 1, '5': 9, '10': 'thumbnail'},
|
||||
const {'1': 'view_type', '3': 5, '4': 1, '5': 14, '6': '.ViewType', '10': 'viewType'},
|
||||
const {'1': 'data', '3': 6, '4': 1, '5': 9, '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `CreateViewParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List createViewParamsDescriptor = $convert.base64Decode('ChBDcmVhdGVWaWV3UGFyYW1zEiAKDGJlbG9uZ190b19pZBgBIAEoCVIKYmVsb25nVG9JZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2MSHAoJdGh1bWJuYWlsGAQgASgJUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBl');
|
||||
final $typed_data.Uint8List createViewParamsDescriptor = $convert.base64Decode('ChBDcmVhdGVWaWV3UGFyYW1zEiAKDGJlbG9uZ190b19pZBgBIAEoCVIKYmVsb25nVG9JZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2MSHAoJdGh1bWJuYWlsGAQgASgJUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBlEhIKBGRhdGEYBiABKAlSBGRhdGE=');
|
||||
@$core.Deprecated('Use viewDescriptor instead')
|
||||
const View$json = const {
|
||||
'1': 'View',
|
||||
|
@ -159,3 +159,50 @@ class QueryViewParams extends $pb.GeneratedMessage {
|
||||
void clearReadBelongings() => clearField(3);
|
||||
}
|
||||
|
||||
class OpenViewRequest extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'OpenViewRequest', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
OpenViewRequest._() : super();
|
||||
factory OpenViewRequest({
|
||||
$core.String? viewId,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (viewId != null) {
|
||||
_result.viewId = viewId;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory OpenViewRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory OpenViewRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
OpenViewRequest clone() => OpenViewRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
OpenViewRequest copyWith(void Function(OpenViewRequest) updates) => super.copyWith((message) => updates(message as OpenViewRequest)) as OpenViewRequest; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static OpenViewRequest create() => OpenViewRequest._();
|
||||
OpenViewRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<OpenViewRequest> createRepeated() => $pb.PbList<OpenViewRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static OpenViewRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<OpenViewRequest>(create);
|
||||
static OpenViewRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get viewId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set viewId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasViewId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearViewId() => clearField(1);
|
||||
}
|
||||
|
||||
|
@ -32,3 +32,13 @@ const QueryViewParams$json = const {
|
||||
|
||||
/// Descriptor for `QueryViewParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List queryViewParamsDescriptor = $convert.base64Decode('Cg9RdWVyeVZpZXdQYXJhbXMSFwoHdmlld19pZBgBIAEoCVIGdmlld0lkEhkKCGlzX3RyYXNoGAIgASgIUgdpc1RyYXNoEicKD3JlYWRfYmVsb25naW5ncxgDIAEoCFIOcmVhZEJlbG9uZ2luZ3M=');
|
||||
@$core.Deprecated('Use openViewRequestDescriptor instead')
|
||||
const OpenViewRequest$json = const {
|
||||
'1': 'OpenViewRequest',
|
||||
'2': const [
|
||||
const {'1': 'view_id', '3': 1, '4': 1, '5': 9, '10': 'viewId'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `OpenViewRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List openViewRequestDescriptor = $convert.base64Decode('Cg9PcGVuVmlld1JlcXVlc3QSFwoHdmlld19pZBgBIAEoCVIGdmlld0lk');
|
||||
|
@ -319,3 +319,64 @@ class UpdateViewParams extends $pb.GeneratedMessage {
|
||||
void clearIsTrash() => clearField(5);
|
||||
}
|
||||
|
||||
class UpdateViewDataRequest extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateViewDataRequest', createEmptyInstance: create)
|
||||
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId')
|
||||
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||
..hasRequiredFields = false
|
||||
;
|
||||
|
||||
UpdateViewDataRequest._() : super();
|
||||
factory UpdateViewDataRequest({
|
||||
$core.String? viewId,
|
||||
$core.String? data,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (viewId != null) {
|
||||
_result.viewId = viewId;
|
||||
}
|
||||
if (data != null) {
|
||||
_result.data = data;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory UpdateViewDataRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||
factory UpdateViewDataRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
UpdateViewDataRequest clone() => UpdateViewDataRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated(
|
||||
'Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
UpdateViewDataRequest copyWith(void Function(UpdateViewDataRequest) updates) => super.copyWith((message) => updates(message as UpdateViewDataRequest)) as UpdateViewDataRequest; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static UpdateViewDataRequest create() => UpdateViewDataRequest._();
|
||||
UpdateViewDataRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<UpdateViewDataRequest> createRepeated() => $pb.PbList<UpdateViewDataRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static UpdateViewDataRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateViewDataRequest>(create);
|
||||
static UpdateViewDataRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get viewId => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set viewId($core.String v) { $_setString(0, v); }
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasViewId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearViewId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get data => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set data($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasData() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearData() => clearField(2);
|
||||
}
|
||||
|
||||
|
@ -48,3 +48,14 @@ const UpdateViewParams$json = const {
|
||||
|
||||
/// Descriptor for `UpdateViewParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List updateViewParamsDescriptor = $convert.base64Decode('ChBVcGRhdGVWaWV3UGFyYW1zEhcKB3ZpZXdfaWQYASABKAlSBnZpZXdJZBIUCgRuYW1lGAIgASgJSABSBG5hbWUSFAoEZGVzYxgDIAEoCUgBUgRkZXNjEh4KCXRodW1ibmFpbBgEIAEoCUgCUgl0aHVtYm5haWwSGwoIaXNfdHJhc2gYBSABKAhIA1IHaXNUcmFzaEINCgtvbmVfb2ZfbmFtZUINCgtvbmVfb2ZfZGVzY0ISChBvbmVfb2ZfdGh1bWJuYWlsQhEKD29uZV9vZl9pc190cmFzaA==');
|
||||
@$core.Deprecated('Use updateViewDataRequestDescriptor instead')
|
||||
const UpdateViewDataRequest$json = const {
|
||||
'1': 'UpdateViewDataRequest',
|
||||
'2': const [
|
||||
const {'1': 'view_id', '3': 1, '4': 1, '5': 9, '10': 'viewId'},
|
||||
const {'1': 'data', '3': 2, '4': 1, '5': 9, '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `UpdateViewDataRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List updateViewDataRequestDescriptor = $convert.base64Decode('ChVVcGRhdGVWaWV3RGF0YVJlcXVlc3QSFwoHdmlld19pZBgBIAEoCVIGdmlld0lkEhIKBGRhdGEYAiABKAlSBGRhdGE=');
|
||||
|
@ -122,8 +122,6 @@ fn user_scope() -> Scope {
|
||||
.route(web::patch().to(view::update_handler))
|
||||
)
|
||||
.service(web::resource("/doc")
|
||||
.route(web::post().to(doc::create_handler))
|
||||
.route(web::delete().to(doc::delete_handler))
|
||||
.route(web::get().to(doc::read_handler))
|
||||
.route(web::patch().to(doc::update_handler))
|
||||
)
|
||||
|
@ -3,6 +3,5 @@ pub mod config;
|
||||
mod context;
|
||||
mod entities;
|
||||
mod middleware;
|
||||
mod routers;
|
||||
mod service;
|
||||
mod sqlx_ext;
|
||||
|
@ -1 +0,0 @@
|
||||
pub(crate) mod utils;
|
@ -1,7 +1,7 @@
|
||||
use super::sql_builder::*;
|
||||
use crate::{
|
||||
entities::doc::{DocTable, DOC_TABLE},
|
||||
sqlx_ext::{map_sqlx_error, SqlBuilder},
|
||||
sqlx_ext::{map_sqlx_error, DBTransaction, SqlBuilder},
|
||||
};
|
||||
use anyhow::Context;
|
||||
use flowy_document::protobuf::{CreateDocParams, Doc, QueryDocParams, UpdateDocParams};
|
||||
@ -10,27 +10,17 @@ use sqlx::{postgres::PgArguments, PgPool, Postgres};
|
||||
use uuid::Uuid;
|
||||
|
||||
pub(crate) async fn create_doc(
|
||||
pool: &PgPool,
|
||||
transaction: &mut DBTransaction<'_>,
|
||||
params: CreateDocParams,
|
||||
) -> Result<FlowyResponse, ServerError> {
|
||||
) -> Result<(), ServerError> {
|
||||
let uuid = Uuid::parse_str(¶ms.id)?;
|
||||
let mut transaction = pool
|
||||
.begin()
|
||||
.await
|
||||
.context("Failed to acquire a Postgres connection to create doc")?;
|
||||
let (sql, args) = Builder::new(uuid).data(params.data).build()?;
|
||||
|
||||
let (sql, args) = NewDocSqlBuilder::new(uuid).data(params.data).build()?;
|
||||
let _ = sqlx::query_with(&sql, args)
|
||||
.execute(&mut transaction)
|
||||
.execute(transaction)
|
||||
.await
|
||||
.map_err(map_sqlx_error)?;
|
||||
|
||||
transaction
|
||||
.commit()
|
||||
.await
|
||||
.context("Failed to commit SQL transaction to create doc.")?;
|
||||
|
||||
Ok(FlowyResponse::success())
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn read_doc(
|
||||
@ -97,28 +87,17 @@ pub(crate) async fn update_doc(
|
||||
}
|
||||
|
||||
pub(crate) async fn delete_doc(
|
||||
pool: &PgPool,
|
||||
params: QueryDocParams,
|
||||
) -> Result<FlowyResponse, ServerError> {
|
||||
let doc_id = Uuid::parse_str(¶ms.doc_id)?;
|
||||
let mut transaction = pool
|
||||
.begin()
|
||||
.await
|
||||
.context("Failed to acquire a Postgres connection to delete doc")?;
|
||||
|
||||
transaction: &mut DBTransaction<'_>,
|
||||
doc_id: Uuid,
|
||||
) -> Result<(), ServerError> {
|
||||
let (sql, args) = SqlBuilder::delete(DOC_TABLE)
|
||||
.and_where_eq("id", doc_id)
|
||||
.build()?;
|
||||
|
||||
let _ = sqlx::query_with(&sql, args)
|
||||
.execute(&mut transaction)
|
||||
.execute(transaction)
|
||||
.await
|
||||
.map_err(map_sqlx_error)?;
|
||||
|
||||
transaction
|
||||
.commit()
|
||||
.await
|
||||
.context("Failed to commit SQL transaction to delete doc.")?;
|
||||
|
||||
Ok(FlowyResponse::success())
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,23 +1,16 @@
|
||||
use crate::{
|
||||
routers::utils::parse_from_payload,
|
||||
service::doc_service::{create_doc, read_doc, update_doc},
|
||||
};
|
||||
use actix_web::{
|
||||
web::{Data, Payload},
|
||||
HttpResponse,
|
||||
};
|
||||
use flowy_document::protobuf::{CreateDocParams, QueryDocParams, UpdateDocParams};
|
||||
use flowy_net::errors::ServerError;
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub async fn create_handler(
|
||||
payload: Payload,
|
||||
pool: Data<PgPool>,
|
||||
) -> Result<HttpResponse, ServerError> {
|
||||
let params: CreateDocParams = parse_from_payload(payload).await?;
|
||||
let response = create_doc(pool.get_ref(), params).await?;
|
||||
Ok(response.into())
|
||||
}
|
||||
use flowy_document::protobuf::{CreateDocParams, QueryDocParams, UpdateDocParams};
|
||||
use flowy_net::errors::ServerError;
|
||||
|
||||
use crate::service::{
|
||||
doc_service::{read_doc, update_doc},
|
||||
util::parse_from_payload,
|
||||
};
|
||||
|
||||
pub async fn read_handler(
|
||||
payload: Payload,
|
||||
@ -36,12 +29,3 @@ pub async fn update_handler(
|
||||
let response = update_doc(pool.get_ref(), params).await?;
|
||||
Ok(response.into())
|
||||
}
|
||||
|
||||
pub async fn delete_handler(
|
||||
payload: Payload,
|
||||
pool: Data<PgPool>,
|
||||
) -> Result<HttpResponse, ServerError> {
|
||||
let params: QueryDocParams = parse_from_payload(payload).await?;
|
||||
let response = read_doc(pool.get_ref(), params).await?;
|
||||
Ok(response.into())
|
||||
}
|
||||
|
@ -8,11 +8,11 @@ use flowy_net::errors::ServerError;
|
||||
use sqlx::postgres::PgArguments;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct Builder {
|
||||
pub struct NewDocSqlBuilder {
|
||||
table: DocTable,
|
||||
}
|
||||
|
||||
impl Builder {
|
||||
impl NewDocSqlBuilder {
|
||||
pub fn new(id: Uuid) -> Self {
|
||||
let table = DocTable {
|
||||
id,
|
||||
|
@ -1,4 +1,5 @@
|
||||
pub mod doc_service;
|
||||
pub mod user_service;
|
||||
pub(crate) mod util;
|
||||
pub mod workspace_service;
|
||||
pub mod ws_service;
|
||||
|
@ -11,14 +11,16 @@ use flowy_user::protobuf::{SignInParams, SignUpParams, UpdateUserParams};
|
||||
|
||||
use crate::{
|
||||
entities::token::Token,
|
||||
routers::utils::parse_from_payload,
|
||||
service::user_service::{
|
||||
get_user_profile,
|
||||
register_user,
|
||||
set_user_profile,
|
||||
sign_in,
|
||||
sign_out,
|
||||
LoggedUser,
|
||||
service::{
|
||||
user_service::{
|
||||
get_user_profile,
|
||||
register_user,
|
||||
set_user_profile,
|
||||
sign_in,
|
||||
sign_out,
|
||||
LoggedUser,
|
||||
},
|
||||
util::parse_from_payload,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ pub(crate) async fn create_app(
|
||||
.await
|
||||
.context("Failed to acquire a Postgres connection to create app")?;
|
||||
|
||||
let (sql, args, app) = Builder::new(&user_id, workspace_id.as_ref())
|
||||
let (sql, args, app) = NewAppSqlBuilder::new(&user_id, workspace_id.as_ref())
|
||||
.name(name.as_ref())
|
||||
.desc(desc.as_ref())
|
||||
.color_style(params.take_color_style())
|
||||
|
@ -12,12 +12,10 @@ use flowy_workspace::protobuf::{
|
||||
UpdateAppParams,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
routers::utils::parse_from_payload,
|
||||
service::{
|
||||
user_service::LoggedUser,
|
||||
workspace_service::app::app::{create_app, delete_app, read_app, update_app},
|
||||
},
|
||||
use crate::service::{
|
||||
user_service::LoggedUser,
|
||||
util::parse_from_payload,
|
||||
workspace_service::app::app::{create_app, delete_app, read_app, update_app},
|
||||
};
|
||||
|
||||
pub async fn create_handler(
|
||||
|
@ -12,11 +12,11 @@ use protobuf::Message;
|
||||
use sqlx::postgres::PgArguments;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct Builder {
|
||||
pub struct NewAppSqlBuilder {
|
||||
table: AppTable,
|
||||
}
|
||||
|
||||
impl Builder {
|
||||
impl NewAppSqlBuilder {
|
||||
pub fn new(user_id: &str, workspace_id: &str) -> Self {
|
||||
let uuid = uuid::Uuid::new_v4();
|
||||
let time = Utc::now();
|
||||
|
@ -3,9 +3,9 @@ use flowy_workspace::protobuf::{App, View, ViewType, Workspace};
|
||||
|
||||
use crate::{
|
||||
service::workspace_service::{
|
||||
app::sql_builder::Builder as AppBuilder,
|
||||
view::sql_builder::Builder as ViewBuilder,
|
||||
workspace::sql_builder::Builder as WorkspaceBuilder,
|
||||
app::sql_builder::NewAppSqlBuilder as AppBuilder,
|
||||
view::sql_builder::NewViewSqlBuilder as ViewBuilder,
|
||||
workspace::sql_builder::NewWorkspaceBuilder as WorkspaceBuilder,
|
||||
},
|
||||
sqlx_ext::{map_sqlx_error, DBTransaction},
|
||||
};
|
||||
|
@ -12,9 +12,9 @@ use flowy_workspace::protobuf::{
|
||||
UpdateViewParams,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
routers::utils::parse_from_payload,
|
||||
service::workspace_service::view::{create_view, delete_view, read_view, update_view},
|
||||
use crate::service::{
|
||||
util::parse_from_payload,
|
||||
workspace_service::view::{create_view, delete_view, read_view, update_view},
|
||||
};
|
||||
|
||||
pub async fn create_handler(
|
||||
|
@ -12,11 +12,11 @@ use protobuf::ProtobufEnum;
|
||||
use sqlx::postgres::PgArguments;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct Builder {
|
||||
pub struct NewViewSqlBuilder {
|
||||
table: ViewTable,
|
||||
}
|
||||
|
||||
impl Builder {
|
||||
impl NewViewSqlBuilder {
|
||||
pub fn new(belong_to_id: &str) -> Self {
|
||||
let uuid = uuid::Uuid::new_v4();
|
||||
let time = Utc::now();
|
||||
|
@ -16,9 +16,13 @@ use flowy_workspace::{
|
||||
|
||||
use crate::{
|
||||
entities::workspace::{ViewTable, VIEW_TABLE},
|
||||
service::workspace_service::view::sql_builder::*,
|
||||
service::{
|
||||
doc_service::{create_doc, delete_doc},
|
||||
workspace_service::view::sql_builder::*,
|
||||
},
|
||||
sqlx_ext::{map_sqlx_error, DBTransaction, SqlBuilder},
|
||||
};
|
||||
use flowy_document::protobuf::CreateDocParams;
|
||||
|
||||
pub(crate) async fn create_view(
|
||||
pool: &PgPool,
|
||||
@ -34,7 +38,7 @@ pub(crate) async fn create_view(
|
||||
.await
|
||||
.context("Failed to acquire a Postgres connection to create view")?;
|
||||
|
||||
let (sql, args, view) = Builder::new(belong_to_id.as_ref())
|
||||
let (sql, args, view) = NewViewSqlBuilder::new(belong_to_id.as_ref())
|
||||
.name(name.as_ref())
|
||||
.desc(desc.as_ref())
|
||||
.thumbnail(thumbnail.as_ref())
|
||||
@ -46,6 +50,11 @@ pub(crate) async fn create_view(
|
||||
.await
|
||||
.map_err(map_sqlx_error)?;
|
||||
|
||||
let mut create_doc_params = CreateDocParams::new();
|
||||
create_doc_params.set_data(params.data);
|
||||
create_doc_params.set_id(view.id.clone());
|
||||
let _ = create_doc(&mut transaction, create_doc_params).await?;
|
||||
|
||||
transaction
|
||||
.commit()
|
||||
.await
|
||||
@ -165,7 +174,7 @@ pub(crate) async fn delete_view(
|
||||
.context("Failed to acquire a Postgres connection to delete view")?;
|
||||
|
||||
let (sql, args) = SqlBuilder::delete(VIEW_TABLE)
|
||||
.and_where_eq("id", view_id)
|
||||
.and_where_eq("id", &view_id)
|
||||
.build()?;
|
||||
|
||||
let _ = sqlx::query_with(&sql, args)
|
||||
@ -173,6 +182,8 @@ pub(crate) async fn delete_view(
|
||||
.await
|
||||
.map_err(map_sqlx_error)?;
|
||||
|
||||
let _ = delete_doc(&mut transaction, view_id).await?;
|
||||
|
||||
transaction
|
||||
.commit()
|
||||
.await
|
||||
|
@ -12,16 +12,14 @@ use flowy_workspace::protobuf::{
|
||||
UpdateWorkspaceParams,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
routers::utils::parse_from_payload,
|
||||
service::{
|
||||
user_service::LoggedUser,
|
||||
workspace_service::workspace::{
|
||||
create_workspace,
|
||||
delete_workspace,
|
||||
read_workspaces,
|
||||
update_workspace,
|
||||
},
|
||||
use crate::service::{
|
||||
user_service::LoggedUser,
|
||||
util::parse_from_payload,
|
||||
workspace_service::workspace::{
|
||||
create_workspace,
|
||||
delete_workspace,
|
||||
read_workspaces,
|
||||
update_workspace,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -11,11 +11,11 @@ use flowy_workspace::{
|
||||
use sqlx::postgres::PgArguments;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct Builder {
|
||||
pub struct NewWorkspaceBuilder {
|
||||
table: WorkspaceTable,
|
||||
}
|
||||
|
||||
impl Builder {
|
||||
impl NewWorkspaceBuilder {
|
||||
pub fn new(user_id: &str) -> Self {
|
||||
let uuid = uuid::Uuid::new_v4();
|
||||
let time = Utc::now();
|
||||
|
@ -19,7 +19,7 @@ use crate::{
|
||||
sqlx_ext::*,
|
||||
};
|
||||
|
||||
use super::sql_builder::Builder;
|
||||
use super::sql_builder::NewWorkspaceBuilder;
|
||||
|
||||
pub(crate) async fn create_workspace(
|
||||
pool: &PgPool,
|
||||
@ -35,7 +35,7 @@ pub(crate) async fn create_workspace(
|
||||
.await
|
||||
.context("Failed to acquire a Postgres connection to create workspace")?;
|
||||
|
||||
let (sql, args, workspace) = Builder::new(&user_id)
|
||||
let (sql, args, workspace) = NewWorkspaceBuilder::new(&user_id)
|
||||
.name(name.as_ref())
|
||||
.desc(desc.as_ref())
|
||||
.build()?;
|
||||
|
@ -1,8 +1,30 @@
|
||||
use crate::helper::DocTest;
|
||||
use crate::helper::ViewTest;
|
||||
use flowy_document::entities::doc::QueryDocParams;
|
||||
use flowy_workspace::entities::view::DeleteViewParams;
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn doc_create() {
|
||||
let test = DocTest::new().await;
|
||||
async fn doc_read() {
|
||||
let test = ViewTest::new().await;
|
||||
|
||||
log::info!("{:?}", test.doc);
|
||||
let params = QueryDocParams {
|
||||
doc_id: test.view.id.clone(),
|
||||
};
|
||||
|
||||
let doc = test.server.read_doc(params).await;
|
||||
assert_eq!(doc.is_some(), true);
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn doc_delete() {
|
||||
let test = ViewTest::new().await;
|
||||
let delete_params = DeleteViewParams {
|
||||
view_id: test.view.id.clone(),
|
||||
};
|
||||
test.server.delete_view(delete_params).await;
|
||||
|
||||
let params = QueryDocParams {
|
||||
doc_id: test.view.id.clone(),
|
||||
};
|
||||
let doc = test.server.read_doc(params).await;
|
||||
assert_eq!(doc.is_none(), true);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ use backend::{
|
||||
};
|
||||
|
||||
use flowy_document::{
|
||||
entities::doc::{CreateDocParams, Doc},
|
||||
entities::doc::{CreateDocParams, Doc, QueryDocParams, UpdateDocParams},
|
||||
prelude::*,
|
||||
};
|
||||
use flowy_user::{errors::UserError, prelude::*};
|
||||
@ -156,13 +156,21 @@ impl TestServer {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
pub async fn create_doc(&self, params: CreateDocParams) {
|
||||
pub async fn update_doc(&self, params: UpdateDocParams) {
|
||||
let url = format!("{}/api/doc", self.address);
|
||||
let _ = create_doc_request(self.user_token(), params, &url)
|
||||
let _ = update_doc_request(self.user_token(), params, &url)
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
pub async fn read_doc(&self, params: QueryDocParams) -> Option<Doc> {
|
||||
let url = format!("{}/api/doc", self.address);
|
||||
let doc = read_doc_request(self.user_token(), params, &url)
|
||||
.await
|
||||
.unwrap();
|
||||
doc
|
||||
}
|
||||
|
||||
pub(crate) async fn register_user(&self) -> SignUpResponse {
|
||||
let params = SignUpParams {
|
||||
email: "annie@appflowy.io".to_string(),
|
||||
@ -283,24 +291,12 @@ pub(crate) async fn create_test_view(application: &TestServer, app_id: &str) ->
|
||||
desc: "This is my first view".to_string(),
|
||||
thumbnail: "http://1.png".to_string(),
|
||||
view_type: ViewType::Doc,
|
||||
data: "".to_owned(),
|
||||
};
|
||||
let app = application.create_view(params).await;
|
||||
app
|
||||
}
|
||||
|
||||
pub(crate) async fn create_test_doc(server: &TestServer, view_id: &str, data: &str) -> Doc {
|
||||
let params = CreateDocParams {
|
||||
id: view_id.to_string(),
|
||||
data: data.to_string(),
|
||||
};
|
||||
let doc = Doc {
|
||||
id: params.id.clone(),
|
||||
data: params.data.clone(),
|
||||
};
|
||||
let _ = server.create_doc(params).await;
|
||||
doc
|
||||
}
|
||||
|
||||
pub struct WorkspaceTest {
|
||||
pub server: TestServer,
|
||||
pub workspace: Workspace,
|
||||
@ -358,28 +354,3 @@ impl ViewTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DocTest {
|
||||
pub server: TestServer,
|
||||
pub workspace: Workspace,
|
||||
pub app: App,
|
||||
pub view: View,
|
||||
pub doc: Doc,
|
||||
}
|
||||
|
||||
impl DocTest {
|
||||
pub async fn new() -> Self {
|
||||
let server = TestServer::new().await;
|
||||
let workspace = create_test_workspace(&server).await;
|
||||
let app = create_test_app(&server, &workspace.id).await;
|
||||
let view = create_test_view(&server, &app.id).await;
|
||||
let doc = create_test_doc(&server, &view.id, "").await;
|
||||
Self {
|
||||
server,
|
||||
workspace,
|
||||
app,
|
||||
view,
|
||||
doc,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,22 +41,21 @@ pub fn category_from_str(type_str: &str) -> TypeCategory {
|
||||
| "CurrentWorkspace"
|
||||
| "UpdateViewRequest"
|
||||
| "UpdateViewParams"
|
||||
| "UpdateViewDataRequest"
|
||||
| "DeleteViewRequest"
|
||||
| "DeleteViewParams"
|
||||
| "QueryViewRequest"
|
||||
| "QueryViewParams"
|
||||
| "OpenViewRequest"
|
||||
| "CreateViewRequest"
|
||||
| "CreateViewParams"
|
||||
| "View"
|
||||
| "RepeatedView"
|
||||
| "WorkspaceError"
|
||||
| "CreateDocRequest"
|
||||
| "CreateDocParams"
|
||||
| "Doc"
|
||||
| "QueryDocRequest"
|
||||
| "QueryDocParams"
|
||||
| "UpdateDocRequest"
|
||||
| "UpdateDocParams"
|
||||
| "QueryDocParams"
|
||||
| "DocError"
|
||||
| "FFIRequest"
|
||||
| "FFIResponse"
|
||||
|
@ -5,15 +5,6 @@ use crate::{
|
||||
use flowy_derive::ProtoBuf;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(ProtoBuf, Default)]
|
||||
pub struct CreateDocRequest {
|
||||
#[pb(index = 1)]
|
||||
pub id: String,
|
||||
|
||||
#[pb(index = 2)]
|
||||
pub data: String,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone)]
|
||||
pub struct CreateDocParams {
|
||||
#[pb(index = 1)]
|
||||
@ -23,19 +14,16 @@ pub struct CreateDocParams {
|
||||
pub data: String,
|
||||
}
|
||||
|
||||
impl TryInto<CreateDocParams> for CreateDocRequest {
|
||||
type Error = DocError;
|
||||
|
||||
fn try_into(self) -> Result<CreateDocParams, Self::Error> {
|
||||
let id = DocId::parse(self.id)
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::DocIdInvalid).msg(e).build())?
|
||||
.0;
|
||||
|
||||
Ok(CreateDocParams { id, data: self.data })
|
||||
impl CreateDocParams {
|
||||
pub fn new(id: &str, data: &str) -> Self {
|
||||
Self {
|
||||
id: id.to_owned(),
|
||||
data: data.to_owned(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone)]
|
||||
#[derive(ProtoBuf, Default, Debug, Clone, Eq, PartialEq)]
|
||||
pub struct Doc {
|
||||
#[pb(index = 1)]
|
||||
pub id: String,
|
||||
@ -43,3 +31,18 @@ pub struct Doc {
|
||||
#[pb(index = 2)]
|
||||
pub data: String,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone)]
|
||||
pub struct UpdateDocParams {
|
||||
#[pb(index = 1)]
|
||||
pub id: String,
|
||||
|
||||
#[pb(index = 2, one_of)]
|
||||
pub data: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone)]
|
||||
pub struct QueryDocParams {
|
||||
#[pb(index = 1)]
|
||||
pub doc_id: String,
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
use crate::{entities::doc::parser::*, errors::*};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(ProtoBuf, Default)]
|
||||
pub struct UpdateDocRequest {
|
||||
#[pb(index = 1)]
|
||||
pub id: String,
|
||||
|
||||
#[pb(index = 2, one_of)]
|
||||
pub data: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone)]
|
||||
pub struct UpdateDocParams {
|
||||
#[pb(index = 1)]
|
||||
pub(crate) id: String,
|
||||
|
||||
#[pb(index = 2, one_of)]
|
||||
pub(crate) data: Option<String>,
|
||||
}
|
||||
|
||||
impl TryInto<UpdateDocParams> for UpdateDocRequest {
|
||||
type Error = DocError;
|
||||
|
||||
fn try_into(self) -> Result<UpdateDocParams, Self::Error> {
|
||||
let id = DocId::parse(self.id)
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::DocIdInvalid).msg(e).build())?
|
||||
.0;
|
||||
|
||||
Ok(UpdateDocParams { id, data: self.data })
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
use crate::{entities::doc::parser::DocId, errors::*};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(Default, ProtoBuf)]
|
||||
pub struct QueryDocRequest {
|
||||
#[pb(index = 1)]
|
||||
pub doc_id: String,
|
||||
}
|
||||
|
||||
#[derive(ProtoBuf, Default, Debug, Clone)]
|
||||
pub struct QueryDocParams {
|
||||
#[pb(index = 1)]
|
||||
pub doc_id: String,
|
||||
}
|
||||
|
||||
impl TryInto<QueryDocParams> for QueryDocRequest {
|
||||
type Error = DocError;
|
||||
|
||||
fn try_into(self) -> Result<QueryDocParams, Self::Error> {
|
||||
let doc_id = DocId::parse(self.doc_id)
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::DocIdInvalid).msg(e).build())?
|
||||
.0;
|
||||
|
||||
Ok(QueryDocParams { doc_id })
|
||||
}
|
||||
}
|
@ -1,8 +1,4 @@
|
||||
mod doc_create;
|
||||
mod doc_modify;
|
||||
mod doc_query;
|
||||
mod doc;
|
||||
pub mod parser;
|
||||
|
||||
pub use doc_create::*;
|
||||
pub use doc_modify::*;
|
||||
pub use doc_query::*;
|
||||
pub use doc::*;
|
||||
|
@ -1,30 +0,0 @@
|
||||
use crate::{entities::doc::*, errors::DocError, services::doc_controller::DocController};
|
||||
use flowy_dispatch::prelude::*;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[tracing::instrument(skip(data, controller))]
|
||||
pub async fn create_doc_handler(data: Data<CreateDocRequest>, controller: Unit<DocController>) -> Result<(), DocError> {
|
||||
let params: CreateDocParams = data.into_inner().try_into()?;
|
||||
let _ = controller.create_doc(params).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(data, controller))]
|
||||
pub async fn read_doc_handler(data: Data<QueryDocRequest>, controller: Unit<DocController>) -> DataResult<Doc, DocError> {
|
||||
let params: QueryDocParams = data.into_inner().try_into()?;
|
||||
let doc_info = controller.read_doc(params).await?;
|
||||
data_result(doc_info)
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(data, controller))]
|
||||
pub async fn update_doc_handler(data: Data<UpdateDocRequest>, controller: Unit<DocController>) -> Result<(), DocError> {
|
||||
let params: UpdateDocParams = data.into_inner().try_into()?;
|
||||
let _ = controller.update_doc(params).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn delete_doc_handler(data: Data<QueryDocRequest>, controller: Unit<DocController>) -> Result<(), DocError> {
|
||||
let params: QueryDocParams = data.into_inner().try_into()?;
|
||||
let _ = controller.delete_doc(params).await?;
|
||||
Ok(())
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
mod doc_handler;
|
||||
|
||||
pub use doc_handler::*;
|
@ -1,7 +1,6 @@
|
||||
pub mod entities;
|
||||
pub mod errors;
|
||||
pub mod event;
|
||||
mod handlers;
|
||||
pub mod module;
|
||||
mod observable;
|
||||
pub mod protobuf;
|
||||
|
@ -1,7 +1,6 @@
|
||||
use crate::{
|
||||
errors::DocError,
|
||||
event::EditorEvent,
|
||||
handlers::*,
|
||||
services::{doc_controller::DocController, file_manager::FileManager, server::construct_doc_server},
|
||||
};
|
||||
use flowy_database::DBConnection;
|
||||
@ -9,27 +8,31 @@ use flowy_dispatch::prelude::*;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
pub trait DocumentDatabase: Send + Sync {
|
||||
fn db_connection(&self) -> Result<DBConnection, DocError>;
|
||||
}
|
||||
|
||||
pub trait DocumentUser: Send + Sync {
|
||||
fn user_doc_dir(&self) -> Result<String, DocError>;
|
||||
fn user_id(&self) -> Result<String, DocError>;
|
||||
fn token(&self) -> Result<String, DocError>;
|
||||
}
|
||||
|
||||
pub fn create(database: Arc<dyn DocumentDatabase>, user: Arc<dyn DocumentUser>) -> Module {
|
||||
let server = construct_doc_server();
|
||||
let file_manager = RwLock::new(FileManager::new(user.clone()));
|
||||
let doc_controller = DocController::new(database, server.clone(), user.clone());
|
||||
|
||||
Module::new()
|
||||
.name("flowy-document")
|
||||
.data(file_manager)
|
||||
.data(doc_controller)
|
||||
.event(EditorEvent::CreateDoc, create_doc_handler)
|
||||
.event(EditorEvent::UpdateDoc, update_doc_handler)
|
||||
.event(EditorEvent::ReadDoc, read_doc_handler)
|
||||
.event(EditorEvent::DeleteDoc, delete_doc_handler)
|
||||
pub enum DocumentType {
|
||||
Doc,
|
||||
}
|
||||
|
||||
pub struct Document {
|
||||
user: Arc<dyn DocumentUser>,
|
||||
file_manager: RwLock<FileManager>,
|
||||
pub doc: Arc<DocController>,
|
||||
}
|
||||
|
||||
impl Document {
|
||||
pub fn new(user: Arc<dyn DocumentUser>) -> Document {
|
||||
let server = construct_doc_server();
|
||||
let doc_controller = Arc::new(DocController::new(server.clone(), user.clone()));
|
||||
let file_manager = RwLock::new(FileManager::new(user.clone()));
|
||||
Self {
|
||||
user,
|
||||
file_manager,
|
||||
doc: doc_controller,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
use flowy_derive::ProtoBuf_Enum;
|
||||
use flowy_observable::ObservableBuilder;
|
||||
use flowy_observable::NotifyBuilder;
|
||||
const OBSERVABLE_CATEGORY: &'static str = "Doc";
|
||||
#[derive(ProtoBuf_Enum, Debug)]
|
||||
pub(crate) enum DocObservable {
|
||||
@ -11,4 +11,4 @@ impl std::convert::Into<i32> for DocObservable {
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn observable(id: &str, ty: DocObservable) -> ObservableBuilder { ObservableBuilder::new(id, ty, OBSERVABLE_CATEGORY) }
|
||||
pub(crate) fn observable(id: &str, ty: DocObservable) -> NotifyBuilder { NotifyBuilder::new(id, ty, OBSERVABLE_CATEGORY) }
|
||||
|
@ -17,213 +17,12 @@
|
||||
#![allow(trivial_casts)]
|
||||
#![allow(unused_imports)]
|
||||
#![allow(unused_results)]
|
||||
//! Generated file from `doc_create.proto`
|
||||
//! Generated file from `doc.proto`
|
||||
|
||||
/// Generated files are compatible only with the same version
|
||||
/// of protobuf runtime.
|
||||
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct CreateDocRequest {
|
||||
// message fields
|
||||
pub id: ::std::string::String,
|
||||
pub data: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a CreateDocRequest {
|
||||
fn default() -> &'a CreateDocRequest {
|
||||
<CreateDocRequest as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl CreateDocRequest {
|
||||
pub fn new() -> CreateDocRequest {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string id = 1;
|
||||
|
||||
|
||||
pub fn get_id(&self) -> &str {
|
||||
&self.id
|
||||
}
|
||||
pub fn clear_id(&mut self) {
|
||||
self.id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_id(&mut self, v: ::std::string::String) {
|
||||
self.id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.id, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string data = 2;
|
||||
|
||||
|
||||
pub fn get_data(&self) -> &str {
|
||||
&self.data
|
||||
}
|
||||
pub fn clear_data(&mut self) {
|
||||
self.data.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_data(&mut self, v: ::std::string::String) {
|
||||
self.data = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_data(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.data
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_data(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.data, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for CreateDocRequest {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
|
||||
},
|
||||
2 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.id);
|
||||
}
|
||||
if !self.data.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(2, &self.data);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.id.is_empty() {
|
||||
os.write_string(1, &self.id)?;
|
||||
}
|
||||
if !self.data.is_empty() {
|
||||
os.write_string(2, &self.data)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> CreateDocRequest {
|
||||
CreateDocRequest::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"id",
|
||||
|m: &CreateDocRequest| { &m.id },
|
||||
|m: &mut CreateDocRequest| { &mut m.id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"data",
|
||||
|m: &CreateDocRequest| { &m.data },
|
||||
|m: &mut CreateDocRequest| { &mut m.data },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateDocRequest>(
|
||||
"CreateDocRequest",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static CreateDocRequest {
|
||||
static instance: ::protobuf::rt::LazyV2<CreateDocRequest> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(CreateDocRequest::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for CreateDocRequest {
|
||||
fn clear(&mut self) {
|
||||
self.id.clear();
|
||||
self.data.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for CreateDocRequest {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for CreateDocRequest {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct CreateDocParams {
|
||||
// message fields
|
||||
@ -626,33 +425,439 @@ impl ::protobuf::reflect::ProtobufValue for Doc {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct UpdateDocParams {
|
||||
// message fields
|
||||
pub id: ::std::string::String,
|
||||
// message oneof groups
|
||||
pub one_of_data: ::std::option::Option<UpdateDocParams_oneof_one_of_data>,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a UpdateDocParams {
|
||||
fn default() -> &'a UpdateDocParams {
|
||||
<UpdateDocParams as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone,PartialEq,Debug)]
|
||||
pub enum UpdateDocParams_oneof_one_of_data {
|
||||
data(::std::string::String),
|
||||
}
|
||||
|
||||
impl UpdateDocParams {
|
||||
pub fn new() -> UpdateDocParams {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string id = 1;
|
||||
|
||||
|
||||
pub fn get_id(&self) -> &str {
|
||||
&self.id
|
||||
}
|
||||
pub fn clear_id(&mut self) {
|
||||
self.id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_id(&mut self, v: ::std::string::String) {
|
||||
self.id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.id, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string data = 2;
|
||||
|
||||
|
||||
pub fn get_data(&self) -> &str {
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(ref v)) => v,
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
pub fn clear_data(&mut self) {
|
||||
self.one_of_data = ::std::option::Option::None;
|
||||
}
|
||||
|
||||
pub fn has_data(&self) -> bool {
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(..)) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_data(&mut self, v: ::std::string::String) {
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(v))
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
pub fn mut_data(&mut self) -> &mut ::std::string::String {
|
||||
if let ::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(_)) = self.one_of_data {
|
||||
} else {
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(::std::string::String::new()));
|
||||
}
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(ref mut v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_data(&mut self) -> ::std::string::String {
|
||||
if self.has_data() {
|
||||
match self.one_of_data.take() {
|
||||
::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
} else {
|
||||
::std::string::String::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for UpdateDocParams {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
|
||||
},
|
||||
2 => {
|
||||
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
|
||||
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||
}
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(is.read_string()?));
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.id);
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_data {
|
||||
match v {
|
||||
&UpdateDocParams_oneof_one_of_data::data(ref v) => {
|
||||
my_size += ::protobuf::rt::string_size(2, &v);
|
||||
},
|
||||
};
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.id.is_empty() {
|
||||
os.write_string(1, &self.id)?;
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_data {
|
||||
match v {
|
||||
&UpdateDocParams_oneof_one_of_data::data(ref v) => {
|
||||
os.write_string(2, v)?;
|
||||
},
|
||||
};
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> UpdateDocParams {
|
||||
UpdateDocParams::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"id",
|
||||
|m: &UpdateDocParams| { &m.id },
|
||||
|m: &mut UpdateDocParams| { &mut m.id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
|
||||
"data",
|
||||
UpdateDocParams::has_data,
|
||||
UpdateDocParams::get_data,
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateDocParams>(
|
||||
"UpdateDocParams",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static UpdateDocParams {
|
||||
static instance: ::protobuf::rt::LazyV2<UpdateDocParams> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(UpdateDocParams::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for UpdateDocParams {
|
||||
fn clear(&mut self) {
|
||||
self.id.clear();
|
||||
self.one_of_data = ::std::option::Option::None;
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for UpdateDocParams {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for UpdateDocParams {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct QueryDocParams {
|
||||
// message fields
|
||||
pub doc_id: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a QueryDocParams {
|
||||
fn default() -> &'a QueryDocParams {
|
||||
<QueryDocParams as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl QueryDocParams {
|
||||
pub fn new() -> QueryDocParams {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string doc_id = 1;
|
||||
|
||||
|
||||
pub fn get_doc_id(&self) -> &str {
|
||||
&self.doc_id
|
||||
}
|
||||
pub fn clear_doc_id(&mut self) {
|
||||
self.doc_id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_doc_id(&mut self, v: ::std::string::String) {
|
||||
self.doc_id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_doc_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.doc_id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_doc_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.doc_id, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for QueryDocParams {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.doc_id)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.doc_id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.doc_id);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.doc_id.is_empty() {
|
||||
os.write_string(1, &self.doc_id)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> QueryDocParams {
|
||||
QueryDocParams::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"doc_id",
|
||||
|m: &QueryDocParams| { &m.doc_id },
|
||||
|m: &mut QueryDocParams| { &mut m.doc_id },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryDocParams>(
|
||||
"QueryDocParams",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static QueryDocParams {
|
||||
static instance: ::protobuf::rt::LazyV2<QueryDocParams> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(QueryDocParams::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for QueryDocParams {
|
||||
fn clear(&mut self) {
|
||||
self.doc_id.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for QueryDocParams {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for QueryDocParams {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x10doc_create.proto\"6\n\x10CreateDocRequest\x12\x0e\n\x02id\x18\x01\
|
||||
\x20\x01(\tR\x02id\x12\x12\n\x04data\x18\x02\x20\x01(\tR\x04data\"5\n\
|
||||
\x0fCreateDocParams\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x12\n\
|
||||
\x04data\x18\x02\x20\x01(\tR\x04data\")\n\x03Doc\x12\x0e\n\x02id\x18\x01\
|
||||
\x20\x01(\tR\x02id\x12\x12\n\x04data\x18\x02\x20\x01(\tR\x04dataJ\xa4\
|
||||
\x03\n\x06\x12\x04\0\0\r\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\
|
||||
\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x18\n\
|
||||
\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x12\n\x0c\n\x05\x04\0\x02\0\x05\
|
||||
\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\r\n\x0c\n\
|
||||
\x05\x04\0\x02\0\x03\x12\x03\x03\x10\x11\n\x0b\n\x04\x04\0\x02\x01\x12\
|
||||
\x03\x04\x04\x14\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\
|
||||
\x05\x04\0\x02\x01\x01\x12\x03\x04\x0b\x0f\n\x0c\n\x05\x04\0\x02\x01\x03\
|
||||
\x12\x03\x04\x12\x13\n\n\n\x02\x04\x01\x12\x04\x06\0\t\x01\n\n\n\x03\x04\
|
||||
\x01\x01\x12\x03\x06\x08\x17\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x07\x04\
|
||||
\x12\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x07\x04\n\n\x0c\n\x05\x04\x01\
|
||||
\x02\0\x01\x12\x03\x07\x0b\r\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x07\
|
||||
\x10\x11\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x08\x04\x14\n\x0c\n\x05\x04\
|
||||
\x01\x02\x01\x05\x12\x03\x08\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\
|
||||
\x03\x08\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x08\x12\x13\n\n\
|
||||
\n\x02\x04\x02\x12\x04\n\0\r\x01\n\n\n\x03\x04\x02\x01\x12\x03\n\x08\x0b\
|
||||
\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x0b\x04\x12\n\x0c\n\x05\x04\x02\x02\0\
|
||||
\x05\x12\x03\x0b\x04\n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x0b\x0b\r\n\
|
||||
\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x0b\x10\x11\n\x0b\n\x04\x04\x02\x02\
|
||||
\x01\x12\x03\x0c\x04\x14\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x0c\x04\
|
||||
\n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x0c\x0b\x0f\n\x0c\n\x05\x04\
|
||||
\x02\x02\x01\x03\x12\x03\x0c\x12\x13b\x06proto3\
|
||||
\n\tdoc.proto\"5\n\x0fCreateDocParams\x12\x0e\n\x02id\x18\x01\x20\x01(\t\
|
||||
R\x02id\x12\x12\n\x04data\x18\x02\x20\x01(\tR\x04data\")\n\x03Doc\x12\
|
||||
\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x12\n\x04data\x18\x02\x20\x01\
|
||||
(\tR\x04data\"F\n\x0fUpdateDocParams\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\
|
||||
\x02id\x12\x14\n\x04data\x18\x02\x20\x01(\tH\0R\x04dataB\r\n\x0bone_of_d\
|
||||
ata\"'\n\x0eQueryDocParams\x12\x15\n\x06doc_id\x18\x01\x20\x01(\tR\x05do\
|
||||
cIdJ\x8e\x04\n\x06\x12\x04\0\0\x10\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\
|
||||
\n\n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\
|
||||
\x17\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x12\n\x0c\n\x05\x04\0\x02\0\
|
||||
\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\r\n\
|
||||
\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x10\x11\n\x0b\n\x04\x04\0\x02\x01\
|
||||
\x12\x03\x04\x04\x14\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\
|
||||
\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x0b\x0f\n\x0c\n\x05\x04\0\x02\
|
||||
\x01\x03\x12\x03\x04\x12\x13\n\n\n\x02\x04\x01\x12\x04\x06\0\t\x01\n\n\n\
|
||||
\x03\x04\x01\x01\x12\x03\x06\x08\x0b\n\x0b\n\x04\x04\x01\x02\0\x12\x03\
|
||||
\x07\x04\x12\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x07\x04\n\n\x0c\n\x05\
|
||||
\x04\x01\x02\0\x01\x12\x03\x07\x0b\r\n\x0c\n\x05\x04\x01\x02\0\x03\x12\
|
||||
\x03\x07\x10\x11\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x08\x04\x14\n\x0c\n\
|
||||
\x05\x04\x01\x02\x01\x05\x12\x03\x08\x04\n\n\x0c\n\x05\x04\x01\x02\x01\
|
||||
\x01\x12\x03\x08\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x08\x12\
|
||||
\x13\n\n\n\x02\x04\x02\x12\x04\n\0\r\x01\n\n\n\x03\x04\x02\x01\x12\x03\n\
|
||||
\x08\x17\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x0b\x04\x12\n\x0c\n\x05\x04\
|
||||
\x02\x02\0\x05\x12\x03\x0b\x04\n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\
|
||||
\x0b\x0b\r\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x0b\x10\x11\n\x0b\n\x04\
|
||||
\x04\x02\x08\0\x12\x03\x0c\x04*\n\x0c\n\x05\x04\x02\x08\0\x01\x12\x03\
|
||||
\x0c\n\x15\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x0c\x18(\n\x0c\n\x05\x04\
|
||||
\x02\x02\x01\x05\x12\x03\x0c\x18\x1e\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\
|
||||
\x03\x0c\x1f#\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x0c&'\n\n\n\x02\
|
||||
\x04\x03\x12\x04\x0e\0\x10\x01\n\n\n\x03\x04\x03\x01\x12\x03\x0e\x08\x16\
|
||||
\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x0f\x04\x16\n\x0c\n\x05\x04\x03\x02\0\
|
||||
\x05\x12\x03\x0f\x04\n\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03\x0f\x0b\x11\
|
||||
\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x0f\x14\x15b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
@ -1,542 +0,0 @@
|
||||
// This file is generated by rust-protobuf 2.22.1. Do not edit
|
||||
// @generated
|
||||
|
||||
// https://github.com/rust-lang/rust-clippy/issues/702
|
||||
#![allow(unknown_lints)]
|
||||
#![allow(clippy::all)]
|
||||
|
||||
#![allow(unused_attributes)]
|
||||
#![cfg_attr(rustfmt, rustfmt::skip)]
|
||||
|
||||
#![allow(box_pointers)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(missing_docs)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(trivial_casts)]
|
||||
#![allow(unused_imports)]
|
||||
#![allow(unused_results)]
|
||||
//! Generated file from `doc_modify.proto`
|
||||
|
||||
/// Generated files are compatible only with the same version
|
||||
/// of protobuf runtime.
|
||||
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct UpdateDocRequest {
|
||||
// message fields
|
||||
pub id: ::std::string::String,
|
||||
// message oneof groups
|
||||
pub one_of_data: ::std::option::Option<UpdateDocRequest_oneof_one_of_data>,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a UpdateDocRequest {
|
||||
fn default() -> &'a UpdateDocRequest {
|
||||
<UpdateDocRequest as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone,PartialEq,Debug)]
|
||||
pub enum UpdateDocRequest_oneof_one_of_data {
|
||||
data(::std::string::String),
|
||||
}
|
||||
|
||||
impl UpdateDocRequest {
|
||||
pub fn new() -> UpdateDocRequest {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string id = 1;
|
||||
|
||||
|
||||
pub fn get_id(&self) -> &str {
|
||||
&self.id
|
||||
}
|
||||
pub fn clear_id(&mut self) {
|
||||
self.id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_id(&mut self, v: ::std::string::String) {
|
||||
self.id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.id, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string data = 2;
|
||||
|
||||
|
||||
pub fn get_data(&self) -> &str {
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocRequest_oneof_one_of_data::data(ref v)) => v,
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
pub fn clear_data(&mut self) {
|
||||
self.one_of_data = ::std::option::Option::None;
|
||||
}
|
||||
|
||||
pub fn has_data(&self) -> bool {
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocRequest_oneof_one_of_data::data(..)) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_data(&mut self, v: ::std::string::String) {
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocRequest_oneof_one_of_data::data(v))
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
pub fn mut_data(&mut self) -> &mut ::std::string::String {
|
||||
if let ::std::option::Option::Some(UpdateDocRequest_oneof_one_of_data::data(_)) = self.one_of_data {
|
||||
} else {
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocRequest_oneof_one_of_data::data(::std::string::String::new()));
|
||||
}
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocRequest_oneof_one_of_data::data(ref mut v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_data(&mut self) -> ::std::string::String {
|
||||
if self.has_data() {
|
||||
match self.one_of_data.take() {
|
||||
::std::option::Option::Some(UpdateDocRequest_oneof_one_of_data::data(v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
} else {
|
||||
::std::string::String::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for UpdateDocRequest {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
|
||||
},
|
||||
2 => {
|
||||
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
|
||||
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||
}
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocRequest_oneof_one_of_data::data(is.read_string()?));
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.id);
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_data {
|
||||
match v {
|
||||
&UpdateDocRequest_oneof_one_of_data::data(ref v) => {
|
||||
my_size += ::protobuf::rt::string_size(2, &v);
|
||||
},
|
||||
};
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.id.is_empty() {
|
||||
os.write_string(1, &self.id)?;
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_data {
|
||||
match v {
|
||||
&UpdateDocRequest_oneof_one_of_data::data(ref v) => {
|
||||
os.write_string(2, v)?;
|
||||
},
|
||||
};
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> UpdateDocRequest {
|
||||
UpdateDocRequest::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"id",
|
||||
|m: &UpdateDocRequest| { &m.id },
|
||||
|m: &mut UpdateDocRequest| { &mut m.id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
|
||||
"data",
|
||||
UpdateDocRequest::has_data,
|
||||
UpdateDocRequest::get_data,
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateDocRequest>(
|
||||
"UpdateDocRequest",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static UpdateDocRequest {
|
||||
static instance: ::protobuf::rt::LazyV2<UpdateDocRequest> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(UpdateDocRequest::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for UpdateDocRequest {
|
||||
fn clear(&mut self) {
|
||||
self.id.clear();
|
||||
self.one_of_data = ::std::option::Option::None;
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for UpdateDocRequest {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for UpdateDocRequest {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct UpdateDocParams {
|
||||
// message fields
|
||||
pub id: ::std::string::String,
|
||||
// message oneof groups
|
||||
pub one_of_data: ::std::option::Option<UpdateDocParams_oneof_one_of_data>,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a UpdateDocParams {
|
||||
fn default() -> &'a UpdateDocParams {
|
||||
<UpdateDocParams as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone,PartialEq,Debug)]
|
||||
pub enum UpdateDocParams_oneof_one_of_data {
|
||||
data(::std::string::String),
|
||||
}
|
||||
|
||||
impl UpdateDocParams {
|
||||
pub fn new() -> UpdateDocParams {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string id = 1;
|
||||
|
||||
|
||||
pub fn get_id(&self) -> &str {
|
||||
&self.id
|
||||
}
|
||||
pub fn clear_id(&mut self) {
|
||||
self.id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_id(&mut self, v: ::std::string::String) {
|
||||
self.id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.id, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string data = 2;
|
||||
|
||||
|
||||
pub fn get_data(&self) -> &str {
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(ref v)) => v,
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
pub fn clear_data(&mut self) {
|
||||
self.one_of_data = ::std::option::Option::None;
|
||||
}
|
||||
|
||||
pub fn has_data(&self) -> bool {
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(..)) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_data(&mut self, v: ::std::string::String) {
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(v))
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
pub fn mut_data(&mut self) -> &mut ::std::string::String {
|
||||
if let ::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(_)) = self.one_of_data {
|
||||
} else {
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(::std::string::String::new()));
|
||||
}
|
||||
match self.one_of_data {
|
||||
::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(ref mut v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_data(&mut self) -> ::std::string::String {
|
||||
if self.has_data() {
|
||||
match self.one_of_data.take() {
|
||||
::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(v)) => v,
|
||||
_ => panic!(),
|
||||
}
|
||||
} else {
|
||||
::std::string::String::new()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for UpdateDocParams {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.id)?;
|
||||
},
|
||||
2 => {
|
||||
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
|
||||
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||
}
|
||||
self.one_of_data = ::std::option::Option::Some(UpdateDocParams_oneof_one_of_data::data(is.read_string()?));
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.id);
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_data {
|
||||
match v {
|
||||
&UpdateDocParams_oneof_one_of_data::data(ref v) => {
|
||||
my_size += ::protobuf::rt::string_size(2, &v);
|
||||
},
|
||||
};
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.id.is_empty() {
|
||||
os.write_string(1, &self.id)?;
|
||||
}
|
||||
if let ::std::option::Option::Some(ref v) = self.one_of_data {
|
||||
match v {
|
||||
&UpdateDocParams_oneof_one_of_data::data(ref v) => {
|
||||
os.write_string(2, v)?;
|
||||
},
|
||||
};
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> UpdateDocParams {
|
||||
UpdateDocParams::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"id",
|
||||
|m: &UpdateDocParams| { &m.id },
|
||||
|m: &mut UpdateDocParams| { &mut m.id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
|
||||
"data",
|
||||
UpdateDocParams::has_data,
|
||||
UpdateDocParams::get_data,
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateDocParams>(
|
||||
"UpdateDocParams",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static UpdateDocParams {
|
||||
static instance: ::protobuf::rt::LazyV2<UpdateDocParams> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(UpdateDocParams::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for UpdateDocParams {
|
||||
fn clear(&mut self) {
|
||||
self.id.clear();
|
||||
self.one_of_data = ::std::option::Option::None;
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for UpdateDocParams {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for UpdateDocParams {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x10doc_modify.proto\"G\n\x10UpdateDocRequest\x12\x0e\n\x02id\x18\x01\
|
||||
\x20\x01(\tR\x02id\x12\x14\n\x04data\x18\x02\x20\x01(\tH\0R\x04dataB\r\n\
|
||||
\x0bone_of_data\"F\n\x0fUpdateDocParams\x12\x0e\n\x02id\x18\x01\x20\x01(\
|
||||
\tR\x02id\x12\x14\n\x04data\x18\x02\x20\x01(\tH\0R\x04dataB\r\n\x0bone_o\
|
||||
f_dataJ\xd4\x02\n\x06\x12\x04\0\0\t\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\
|
||||
\n\n\n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\
|
||||
\x08\x18\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x12\n\x0c\n\x05\x04\0\
|
||||
\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\
|
||||
\r\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x10\x11\n\x0b\n\x04\x04\0\x08\
|
||||
\0\x12\x03\x04\x04*\n\x0c\n\x05\x04\0\x08\0\x01\x12\x03\x04\n\x15\n\x0b\
|
||||
\n\x04\x04\0\x02\x01\x12\x03\x04\x18(\n\x0c\n\x05\x04\0\x02\x01\x05\x12\
|
||||
\x03\x04\x18\x1e\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x1f#\n\x0c\n\
|
||||
\x05\x04\0\x02\x01\x03\x12\x03\x04&'\n\n\n\x02\x04\x01\x12\x04\x06\0\t\
|
||||
\x01\n\n\n\x03\x04\x01\x01\x12\x03\x06\x08\x17\n\x0b\n\x04\x04\x01\x02\0\
|
||||
\x12\x03\x07\x04\x12\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x07\x04\n\n\
|
||||
\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x07\x0b\r\n\x0c\n\x05\x04\x01\x02\0\
|
||||
\x03\x12\x03\x07\x10\x11\n\x0b\n\x04\x04\x01\x08\0\x12\x03\x08\x04*\n\
|
||||
\x0c\n\x05\x04\x01\x08\0\x01\x12\x03\x08\n\x15\n\x0b\n\x04\x04\x01\x02\
|
||||
\x01\x12\x03\x08\x18(\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x08\x18\
|
||||
\x1e\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x08\x1f#\n\x0c\n\x05\x04\
|
||||
\x01\x02\x01\x03\x12\x03\x08&'b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
||||
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
|
||||
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
|
||||
}
|
||||
|
||||
pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
|
||||
file_descriptor_proto_lazy.get(|| {
|
||||
parse_descriptor_proto()
|
||||
})
|
||||
}
|
@ -1,369 +0,0 @@
|
||||
// This file is generated by rust-protobuf 2.22.1. Do not edit
|
||||
// @generated
|
||||
|
||||
// https://github.com/rust-lang/rust-clippy/issues/702
|
||||
#![allow(unknown_lints)]
|
||||
#![allow(clippy::all)]
|
||||
|
||||
#![allow(unused_attributes)]
|
||||
#![cfg_attr(rustfmt, rustfmt::skip)]
|
||||
|
||||
#![allow(box_pointers)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(missing_docs)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(trivial_casts)]
|
||||
#![allow(unused_imports)]
|
||||
#![allow(unused_results)]
|
||||
//! Generated file from `doc_query.proto`
|
||||
|
||||
/// Generated files are compatible only with the same version
|
||||
/// of protobuf runtime.
|
||||
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct QueryDocRequest {
|
||||
// message fields
|
||||
pub doc_id: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a QueryDocRequest {
|
||||
fn default() -> &'a QueryDocRequest {
|
||||
<QueryDocRequest as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl QueryDocRequest {
|
||||
pub fn new() -> QueryDocRequest {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string doc_id = 1;
|
||||
|
||||
|
||||
pub fn get_doc_id(&self) -> &str {
|
||||
&self.doc_id
|
||||
}
|
||||
pub fn clear_doc_id(&mut self) {
|
||||
self.doc_id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_doc_id(&mut self, v: ::std::string::String) {
|
||||
self.doc_id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_doc_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.doc_id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_doc_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.doc_id, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for QueryDocRequest {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.doc_id)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.doc_id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.doc_id);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.doc_id.is_empty() {
|
||||
os.write_string(1, &self.doc_id)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> QueryDocRequest {
|
||||
QueryDocRequest::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"doc_id",
|
||||
|m: &QueryDocRequest| { &m.doc_id },
|
||||
|m: &mut QueryDocRequest| { &mut m.doc_id },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryDocRequest>(
|
||||
"QueryDocRequest",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static QueryDocRequest {
|
||||
static instance: ::protobuf::rt::LazyV2<QueryDocRequest> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(QueryDocRequest::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for QueryDocRequest {
|
||||
fn clear(&mut self) {
|
||||
self.doc_id.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for QueryDocRequest {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for QueryDocRequest {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct QueryDocParams {
|
||||
// message fields
|
||||
pub doc_id: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a QueryDocParams {
|
||||
fn default() -> &'a QueryDocParams {
|
||||
<QueryDocParams as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl QueryDocParams {
|
||||
pub fn new() -> QueryDocParams {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string doc_id = 1;
|
||||
|
||||
|
||||
pub fn get_doc_id(&self) -> &str {
|
||||
&self.doc_id
|
||||
}
|
||||
pub fn clear_doc_id(&mut self) {
|
||||
self.doc_id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_doc_id(&mut self, v: ::std::string::String) {
|
||||
self.doc_id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_doc_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.doc_id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_doc_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.doc_id, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for QueryDocParams {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.doc_id)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.doc_id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.doc_id);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.doc_id.is_empty() {
|
||||
os.write_string(1, &self.doc_id)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> QueryDocParams {
|
||||
QueryDocParams::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"doc_id",
|
||||
|m: &QueryDocParams| { &m.doc_id },
|
||||
|m: &mut QueryDocParams| { &mut m.doc_id },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryDocParams>(
|
||||
"QueryDocParams",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static QueryDocParams {
|
||||
static instance: ::protobuf::rt::LazyV2<QueryDocParams> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(QueryDocParams::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for QueryDocParams {
|
||||
fn clear(&mut self) {
|
||||
self.doc_id.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for QueryDocParams {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for QueryDocParams {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x0fdoc_query.proto\"(\n\x0fQueryDocRequest\x12\x15\n\x06doc_id\x18\
|
||||
\x01\x20\x01(\tR\x05docId\"'\n\x0eQueryDocParams\x12\x15\n\x06doc_id\x18\
|
||||
\x01\x20\x01(\tR\x05docIdJ\xb0\x01\n\x06\x12\x04\0\0\x07\x01\n\x08\n\x01\
|
||||
\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x04\x01\n\n\n\x03\x04\
|
||||
\0\x01\x12\x03\x02\x08\x17\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x16\n\
|
||||
\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\
|
||||
\x12\x03\x03\x0b\x11\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x14\x15\n\n\
|
||||
\n\x02\x04\x01\x12\x04\x05\0\x07\x01\n\n\n\x03\x04\x01\x01\x12\x03\x05\
|
||||
\x08\x16\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x06\x04\x16\n\x0c\n\x05\x04\
|
||||
\x01\x02\0\x05\x12\x03\x06\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\
|
||||
\x06\x0b\x11\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x06\x14\x15b\x06proto\
|
||||
3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
||||
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
|
||||
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
|
||||
}
|
||||
|
||||
pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
|
||||
file_descriptor_proto_lazy.get(|| {
|
||||
parse_descriptor_proto()
|
||||
})
|
||||
}
|
@ -1,11 +1,5 @@
|
||||
// Auto-generated, do not edit
|
||||
|
||||
mod doc_modify;
|
||||
pub use doc_modify::*;
|
||||
|
||||
mod doc_create;
|
||||
pub use doc_create::*;
|
||||
|
||||
mod observable;
|
||||
pub use observable::*;
|
||||
|
||||
@ -15,5 +9,5 @@ pub use errors::*;
|
||||
mod event;
|
||||
pub use event::*;
|
||||
|
||||
mod doc_query;
|
||||
pub use doc_query::*;
|
||||
mod doc;
|
||||
pub use doc::*;
|
||||
|
@ -1,9 +1,5 @@
|
||||
syntax = "proto3";
|
||||
|
||||
message CreateDocRequest {
|
||||
string id = 1;
|
||||
string data = 2;
|
||||
}
|
||||
message CreateDocParams {
|
||||
string id = 1;
|
||||
string data = 2;
|
||||
@ -12,3 +8,10 @@ message Doc {
|
||||
string id = 1;
|
||||
string data = 2;
|
||||
}
|
||||
message UpdateDocParams {
|
||||
string id = 1;
|
||||
oneof one_of_data { string data = 2; };
|
||||
}
|
||||
message QueryDocParams {
|
||||
string doc_id = 1;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
message UpdateDocRequest {
|
||||
string id = 1;
|
||||
oneof one_of_data { string data = 2; };
|
||||
}
|
||||
message UpdateDocParams {
|
||||
string id = 1;
|
||||
oneof one_of_data { string data = 2; };
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
message QueryDocRequest {
|
||||
string doc_id = 1;
|
||||
}
|
||||
message QueryDocParams {
|
||||
string doc_id = 1;
|
||||
}
|
@ -1,76 +1,60 @@
|
||||
use crate::{
|
||||
entities::doc::{CreateDocParams, Doc, QueryDocParams, UpdateDocParams},
|
||||
errors::DocError,
|
||||
module::{DocumentDatabase, DocumentUser},
|
||||
module::DocumentUser,
|
||||
services::server::Server,
|
||||
sql_tables::doc::{DocTable, DocTableChangeset, DocTableSql},
|
||||
};
|
||||
use flowy_database::SqliteConnection;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct DocController {
|
||||
server: Server,
|
||||
sql: Arc<DocTableSql>,
|
||||
user: Arc<dyn DocumentUser>,
|
||||
database: Arc<dyn DocumentDatabase>,
|
||||
}
|
||||
|
||||
impl DocController {
|
||||
pub(crate) fn new(database: Arc<dyn DocumentDatabase>, server: Server, user: Arc<dyn DocumentUser>) -> Self {
|
||||
pub(crate) fn new(server: Server, user: Arc<dyn DocumentUser>) -> Self {
|
||||
let sql = Arc::new(DocTableSql {});
|
||||
Self {
|
||||
sql,
|
||||
server,
|
||||
user,
|
||||
database,
|
||||
}
|
||||
Self { sql, server, user }
|
||||
}
|
||||
|
||||
pub(crate) async fn create_doc(&self, params: CreateDocParams) -> Result<(), DocError> {
|
||||
let _ = self.create_doc_on_server(params.clone()).await?;
|
||||
#[tracing::instrument(skip(self, conn), err)]
|
||||
pub fn create(&self, params: CreateDocParams, conn: &SqliteConnection) -> Result<(), DocError> {
|
||||
let doc = Doc {
|
||||
id: params.id,
|
||||
data: params.data,
|
||||
};
|
||||
let conn = self.database.db_connection()?;
|
||||
let _ = self.sql.create_doc_table(DocTable::new(doc), &*conn)?;
|
||||
|
||||
let _ = self.sql.create_doc_table(DocTable::new(doc), conn)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn update_doc(&self, params: UpdateDocParams) -> Result<(), DocError> {
|
||||
#[tracing::instrument(level = "debug", skip(self, conn), err)]
|
||||
pub fn update(&self, params: UpdateDocParams, conn: &SqliteConnection) -> Result<(), DocError> {
|
||||
let changeset = DocTableChangeset::new(params.clone());
|
||||
let conn = self.database.db_connection()?;
|
||||
let _ = self.sql.update_doc_table(changeset, &*conn)?;
|
||||
let _ = self.update_doc_on_server(params)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn read_doc(&self, params: QueryDocParams) -> Result<Doc, DocError> {
|
||||
let conn = self.database.db_connection()?;
|
||||
let doc: Doc = self.sql.read_doc_table(¶ms.doc_id, &*conn)?.into();
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, conn), err)]
|
||||
pub fn open(&self, params: QueryDocParams, conn: &SqliteConnection) -> Result<Doc, DocError> {
|
||||
let doc: Doc = self.sql.read_doc_table(¶ms.doc_id, conn)?.into();
|
||||
let _ = self.read_doc_on_server(params)?;
|
||||
Ok(doc)
|
||||
}
|
||||
|
||||
pub(crate) async fn delete_doc(&self, params: QueryDocParams) -> Result<(), DocError> {
|
||||
let conn = self.database.db_connection()?;
|
||||
#[tracing::instrument(level = "debug", skip(self, conn), err)]
|
||||
pub fn delete(&self, params: QueryDocParams, conn: &SqliteConnection) -> Result<(), DocError> {
|
||||
let _ = self.sql.delete_doc(¶ms.doc_id, &*conn)?;
|
||||
|
||||
let _ = self.delete_doc_on_server(params)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl DocController {
|
||||
#[tracing::instrument(skip(self), err)]
|
||||
async fn create_doc_on_server(&self, params: CreateDocParams) -> Result<(), DocError> {
|
||||
let token = self.user.token()?;
|
||||
let _ = self.server.create_doc(&token, params).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self), err)]
|
||||
fn update_doc_on_server(&self, params: UpdateDocParams) -> Result<(), DocError> {
|
||||
let token = self.user.token()?;
|
||||
|
@ -1,2 +1,2 @@
|
||||
mod doc_test;
|
||||
mod helper;
|
||||
// mod doc_test;
|
||||
// mod helper;
|
||||
|
@ -21,14 +21,13 @@ pub struct ObservableSubject {
|
||||
|
||||
impl std::fmt::Display for ObservableSubject {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
let _ = f.write_str(&self.source)?;
|
||||
let _ = f.write_str(&format!("-{}", self.ty))?;
|
||||
let _ = f.write_str(&format!("{} changed: ", &self.source))?;
|
||||
if let Some(payload) = &self.payload {
|
||||
let _ = f.write_str(&format!("-{} payload", payload.len()))?;
|
||||
let _ = f.write_str(&format!("send {} payload", payload.len()))?;
|
||||
}
|
||||
|
||||
if let Some(payload) = &self.error {
|
||||
let _ = f.write_str(&format!("-{} error", payload.len()))?;
|
||||
let _ = f.write_str(&format!("receive {} error", payload.len()))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -7,7 +7,7 @@ mod protobuf;
|
||||
use crate::{dart::RustStreamSender, entities::ObservableSubject};
|
||||
use flowy_dispatch::prelude::ToBytes;
|
||||
|
||||
pub struct ObservableBuilder {
|
||||
pub struct NotifyBuilder {
|
||||
id: String,
|
||||
payload: Option<Bytes>,
|
||||
error: Option<Bytes>,
|
||||
@ -15,7 +15,7 @@ pub struct ObservableBuilder {
|
||||
ty: i32,
|
||||
}
|
||||
|
||||
impl ObservableBuilder {
|
||||
impl NotifyBuilder {
|
||||
pub fn new<T: Into<i32>>(id: &str, ty: T, source: &str) -> Self {
|
||||
Self {
|
||||
id: id.to_owned(),
|
||||
@ -53,7 +53,7 @@ impl ObservableBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn build(self) {
|
||||
pub fn send(self) {
|
||||
let payload = match self.payload {
|
||||
None => None,
|
||||
Some(bytes) => Some(bytes.to_vec()),
|
||||
@ -72,7 +72,7 @@ impl ObservableBuilder {
|
||||
error,
|
||||
};
|
||||
|
||||
log::debug!("Post {}", subject);
|
||||
log::debug!("Notify {}", subject);
|
||||
match RustStreamSender::post(subject) {
|
||||
Ok(_) => {},
|
||||
Err(error) => log::error!("Send observable subject failed: {}", error),
|
||||
|
@ -1,23 +1,12 @@
|
||||
use flowy_database::DBConnection;
|
||||
use flowy_document::{
|
||||
errors::{DocError, ErrorBuilder, ErrorCode},
|
||||
module::{DocumentDatabase, DocumentUser},
|
||||
module::DocumentUser,
|
||||
};
|
||||
use flowy_user::prelude::UserSession;
|
||||
|
||||
use flowy_user::services::user::UserSession;
|
||||
use std::{path::Path, sync::Arc};
|
||||
|
||||
pub struct EditorDatabaseImpl {
|
||||
pub(crate) user_session: Arc<UserSession>,
|
||||
}
|
||||
|
||||
impl DocumentDatabase for EditorDatabaseImpl {
|
||||
fn db_connection(&self) -> Result<DBConnection, DocError> {
|
||||
self.user_session
|
||||
.db_conn()
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::InternalError).error(e).build())
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EditorUserImpl {
|
||||
pub(crate) user_session: Arc<UserSession>,
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
use flowy_database::DBConnection;
|
||||
|
||||
use flowy_user::prelude::UserSession;
|
||||
use flowy_user::services::user::UserSession;
|
||||
use flowy_workspace::{
|
||||
errors::{ErrorBuilder, ErrorCode, WorkspaceError},
|
||||
module::{WorkspaceDatabase, WorkspaceUser},
|
||||
@ -33,6 +32,6 @@ impl WorkspaceDatabase for WorkspaceDatabaseImpl {
|
||||
fn db_connection(&self) -> Result<DBConnection, WorkspaceError> {
|
||||
self.user_session
|
||||
.db_conn()
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::DatabaseConnectionFail).error(e).build())
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::InternalError).error(e).build())
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,9 @@
|
||||
use flowy_dispatch::prelude::Module;
|
||||
use flowy_user::prelude::*;
|
||||
|
||||
use crate::deps_resolve::{
|
||||
EditorDatabaseImpl,
|
||||
EditorUserImpl,
|
||||
WorkspaceDatabaseImpl,
|
||||
WorkspaceUserImpl,
|
||||
};
|
||||
use crate::deps_resolve::{EditorUserImpl, WorkspaceDatabaseImpl, WorkspaceUserImpl};
|
||||
use flowy_document::module::Document;
|
||||
use flowy_user::services::user::UserSessionBuilder;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct ModuleConfig {
|
||||
@ -24,16 +21,14 @@ pub fn build_modules(config: ModuleConfig) -> Vec<Module> {
|
||||
user_session: user_session.clone(),
|
||||
});
|
||||
|
||||
let editor_db = Arc::new(EditorDatabaseImpl {
|
||||
user_session: user_session.clone(),
|
||||
});
|
||||
let editor_user = Arc::new(EditorUserImpl {
|
||||
user_session: user_session.clone(),
|
||||
});
|
||||
|
||||
let document = Arc::new(Document::new(editor_user));
|
||||
|
||||
vec![
|
||||
flowy_user::module::create(user_session),
|
||||
flowy_workspace::module::create(workspace_user_impl, workspace_db),
|
||||
flowy_document::module::create(editor_db, editor_user),
|
||||
flowy_workspace::module::create(workspace_user_impl, workspace_db, document),
|
||||
]
|
||||
}
|
||||
|
@ -13,13 +13,8 @@ use flowy_user::errors::UserError;
|
||||
use flowy_workspace::errors::WorkspaceError;
|
||||
use std::{convert::TryFrom, marker::PhantomData, sync::Arc};
|
||||
|
||||
pub type DocTest = Builder<DocError>;
|
||||
impl DocTest {
|
||||
pub fn new(sdk: FlowyTestSDK) -> Self { Builder::test(TestContext::new(sdk)) }
|
||||
}
|
||||
|
||||
pub type WorkspaceTest = Builder<WorkspaceError>;
|
||||
impl WorkspaceTest {
|
||||
pub type FlowyWorkspaceTest = Builder<WorkspaceError>;
|
||||
impl FlowyWorkspaceTest {
|
||||
pub fn new(sdk: FlowyTestSDK) -> Self { Builder::test(TestContext::new(sdk)) }
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ const DEFAULT_WORKSPACE_NAME: &'static str = "My workspace";
|
||||
const DEFAULT_WORKSPACE_DESC: &'static str = "This is your first workspace";
|
||||
const DEFAULT_WORKSPACE: &'static str = "Default_Workspace";
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn create_default_workspace_if_need(dispatch: Arc<EventDispatch>, user_id: &str) -> Result<(), UserError> {
|
||||
let key = format!("{}{}", user_id, DEFAULT_WORKSPACE);
|
||||
if KV::get_bool(&key).unwrap_or(false) {
|
||||
@ -96,7 +97,7 @@ pub fn sign_up(dispatch: Arc<EventDispatch>) -> SignUpContext {
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
let _ = create_default_workspace_if_need(dispatch.clone(), &user_profile.id);
|
||||
// let _ = create_default_workspace_if_need(dispatch.clone(), &user_profile.id);
|
||||
SignUpContext { user_profile, password }
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use flowy_derive::ProtoBuf_Enum;
|
||||
|
||||
use flowy_observable::ObservableBuilder;
|
||||
use flowy_observable::NotifyBuilder;
|
||||
|
||||
const OBSERVABLE_CATEGORY: &'static str = "User";
|
||||
|
||||
@ -20,4 +20,4 @@ impl std::convert::Into<i32> for UserObservable {
|
||||
fn into(self) -> i32 { self as i32 }
|
||||
}
|
||||
|
||||
pub(crate) fn observable(id: &str, ty: UserObservable) -> ObservableBuilder { ObservableBuilder::new(id, ty, OBSERVABLE_CATEGORY) }
|
||||
pub(crate) fn notify(id: &str, ty: UserObservable) -> NotifyBuilder { NotifyBuilder::new(id, ty, OBSERVABLE_CATEGORY) }
|
||||
|
@ -61,7 +61,7 @@ impl ResponseMiddleware for Middleware {
|
||||
None => {},
|
||||
Some(token) => {
|
||||
let error = UserError::new(ErrorCode::UserUnauthorized, "");
|
||||
observable(token, UserObservable::UserUnauthorized).error(error).build()
|
||||
notify(token, UserObservable::UserUnauthorized).error(error).send()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -146,11 +146,11 @@ impl UserSession {
|
||||
tokio::spawn(async move {
|
||||
match server.get_user(&token).await {
|
||||
Ok(profile) => {
|
||||
observable(&token, UserObservable::UserProfileUpdated).payload(profile).build();
|
||||
notify(&token, UserObservable::UserProfileUpdated).payload(profile).send();
|
||||
},
|
||||
Err(e) => {
|
||||
log::error!("{:?}", e);
|
||||
observable(&token, UserObservable::UserProfileUpdated).error(e).build();
|
||||
notify(&token, UserObservable::UserProfileUpdated).error(e).send();
|
||||
},
|
||||
}
|
||||
});
|
||||
|
@ -12,6 +12,7 @@ flowy-database = { path = "../flowy-database" }
|
||||
flowy-sqlite = { path = "../flowy-sqlite" }
|
||||
flowy-infra = { path = "../flowy-infra" }
|
||||
flowy-observable = { path = "../flowy-observable" }
|
||||
flowy-document = { path = "../flowy-document" }
|
||||
flowy-net = { path = "../flowy-net", features = ["flowy_request"] }
|
||||
|
||||
protobuf = {version = "2.18.0"}
|
||||
|
@ -23,13 +23,13 @@ impl QueryAppRequest {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_read_views(mut self, read_views: bool) -> Self {
|
||||
self.read_belongings = read_views;
|
||||
pub fn read_views(mut self) -> Self {
|
||||
self.read_belongings = true;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_is_trash(mut self, is_trash: bool) -> Self {
|
||||
self.is_trash = is_trash;
|
||||
pub fn trash(mut self) -> Self {
|
||||
self.is_trash = true;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ pub struct CreateViewRequest {
|
||||
pub view_type: ViewType,
|
||||
}
|
||||
|
||||
#[derive(Default, ProtoBuf, Debug)]
|
||||
#[derive(Default, ProtoBuf, Debug, Clone)]
|
||||
pub struct CreateViewParams {
|
||||
#[pb(index = 1)]
|
||||
pub belong_to_id: String,
|
||||
@ -63,6 +63,9 @@ pub struct CreateViewParams {
|
||||
|
||||
#[pb(index = 5)]
|
||||
pub view_type: ViewType,
|
||||
|
||||
#[pb(index = 6)]
|
||||
pub data: String,
|
||||
}
|
||||
|
||||
impl TryInto<CreateViewParams> for CreateViewRequest {
|
||||
@ -92,6 +95,7 @@ impl TryInto<CreateViewParams> for CreateViewRequest {
|
||||
desc: self.desc,
|
||||
thumbnail,
|
||||
view_type: self.view_type,
|
||||
data: "".to_owned(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ use crate::{
|
||||
errors::{ErrorBuilder, ErrorCode, WorkspaceError},
|
||||
};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_document::entities::doc::QueryDocParams;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(Default, ProtoBuf)]
|
||||
@ -28,3 +29,7 @@ impl TryInto<DeleteViewParams> for DeleteViewRequest {
|
||||
Ok(DeleteViewParams { view_id })
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::Into<QueryDocParams> for DeleteViewParams {
|
||||
fn into(self) -> QueryDocParams { QueryDocParams { doc_id: self.view_id } }
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ use crate::{
|
||||
errors::{ErrorBuilder, ErrorCode, WorkspaceError},
|
||||
};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_document::entities::doc::QueryDocParams;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(Default, ProtoBuf)]
|
||||
@ -26,8 +27,8 @@ impl QueryViewRequest {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_is_trash(mut self, is_trash: bool) -> Self {
|
||||
self.is_trash = is_trash;
|
||||
pub fn trash(mut self) -> Self {
|
||||
self.is_trash = true;
|
||||
self
|
||||
}
|
||||
}
|
||||
@ -63,9 +64,12 @@ impl QueryViewParams {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::Into<QueryDocParams> for QueryViewParams {
|
||||
fn into(self) -> QueryDocParams { QueryDocParams { doc_id: self.view_id } }
|
||||
}
|
||||
|
||||
impl TryInto<QueryViewParams> for QueryViewRequest {
|
||||
type Error = WorkspaceError;
|
||||
|
||||
fn try_into(self) -> Result<QueryViewParams, Self::Error> {
|
||||
let view_id = ViewId::parse(self.view_id)
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::ViewIdInvalid).msg(e).build())?
|
||||
@ -78,3 +82,20 @@ impl TryInto<QueryViewParams> for QueryViewRequest {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, ProtoBuf)]
|
||||
pub struct OpenViewRequest {
|
||||
#[pb(index = 1)]
|
||||
pub view_id: String,
|
||||
}
|
||||
|
||||
impl std::convert::TryInto<QueryDocParams> for OpenViewRequest {
|
||||
type Error = WorkspaceError;
|
||||
|
||||
fn try_into(self) -> Result<QueryDocParams, Self::Error> {
|
||||
let view_id = ViewId::parse(self.view_id)
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::ViewIdInvalid).msg(e).build())?
|
||||
.0;
|
||||
Ok(QueryDocParams { doc_id: view_id })
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ use crate::{
|
||||
errors::{ErrorBuilder, ErrorCode, WorkspaceError},
|
||||
};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use flowy_document::entities::doc::UpdateDocParams;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(Default, ProtoBuf)]
|
||||
@ -108,3 +109,26 @@ impl TryInto<UpdateViewParams> for UpdateViewRequest {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, ProtoBuf)]
|
||||
pub struct UpdateViewDataRequest {
|
||||
#[pb(index = 1)]
|
||||
pub view_id: String,
|
||||
|
||||
#[pb(index = 2)]
|
||||
pub data: String,
|
||||
}
|
||||
|
||||
impl TryInto<UpdateDocParams> for UpdateViewDataRequest {
|
||||
type Error = WorkspaceError;
|
||||
|
||||
fn try_into(self) -> Result<UpdateDocParams, Self::Error> {
|
||||
let view_id = ViewId::parse(self.view_id)
|
||||
.map_err(|e| ErrorBuilder::new(ErrorCode::ViewIdInvalid).msg(e).build())?
|
||||
.0;
|
||||
Ok(UpdateDocParams {
|
||||
id: view_id,
|
||||
data: Some(self.data),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::{entities::workspace::parser::*, errors::*};
|
||||
use flowy_derive::ProtoBuf;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(Default, ProtoBuf)]
|
||||
#[derive(Default, ProtoBuf, Clone)]
|
||||
pub struct QueryWorkspaceRequest {
|
||||
// return all workspace if workspace_id is None
|
||||
#[pb(index = 1, one_of)]
|
||||
|
@ -2,7 +2,8 @@ use bytes::Bytes;
|
||||
use derive_more::Display;
|
||||
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
|
||||
use flowy_dispatch::prelude::{EventResponse, ResponseBuilder};
|
||||
|
||||
use flowy_document::errors::DocError;
|
||||
use flowy_net::errors::ErrorCode as ServerErrorCode;
|
||||
use std::{convert::TryInto, fmt};
|
||||
|
||||
#[derive(Debug, Default, Clone, ProtoBuf)]
|
||||
@ -56,17 +57,11 @@ pub enum ErrorCode {
|
||||
#[display(fmt = "Description of the View is invalid")]
|
||||
ViewDescInvalid = 23,
|
||||
|
||||
#[display(fmt = "Get database connection failed")]
|
||||
DatabaseConnectionFail = 100,
|
||||
|
||||
#[display(fmt = "Database internal error")]
|
||||
WorkspaceDatabaseError = 101,
|
||||
|
||||
#[display(fmt = "UserIn is empty")]
|
||||
UserIdIsEmpty = 102,
|
||||
UserIdIsEmpty = 100,
|
||||
|
||||
#[display(fmt = "User unauthorized")]
|
||||
UserUnauthorized = 103,
|
||||
UserUnauthorized = 101,
|
||||
|
||||
#[display(fmt = "Server error")]
|
||||
InternalError = 1000,
|
||||
@ -78,6 +73,10 @@ impl std::default::Default for ErrorCode {
|
||||
fn default() -> Self { ErrorCode::Unknown }
|
||||
}
|
||||
|
||||
impl std::convert::From<flowy_document::errors::DocError> for WorkspaceError {
|
||||
fn from(error: DocError) -> Self { ErrorBuilder::new(ErrorCode::InternalError).error(error).build() }
|
||||
}
|
||||
|
||||
impl std::convert::From<flowy_net::errors::ServerError> for WorkspaceError {
|
||||
fn from(error: flowy_net::errors::ServerError) -> Self {
|
||||
let code = server_error_to_workspace_error(error.code);
|
||||
@ -86,7 +85,7 @@ impl std::convert::From<flowy_net::errors::ServerError> for WorkspaceError {
|
||||
}
|
||||
|
||||
impl std::convert::From<flowy_database::Error> for WorkspaceError {
|
||||
fn from(error: flowy_database::Error) -> Self { ErrorBuilder::new(ErrorCode::WorkspaceDatabaseError).error(error).build() }
|
||||
fn from(error: flowy_database::Error) -> Self { ErrorBuilder::new(ErrorCode::InternalError).error(error).build() }
|
||||
}
|
||||
|
||||
impl flowy_dispatch::Error for WorkspaceError {
|
||||
@ -106,7 +105,6 @@ impl flowy_infra::errors::Build<ErrorCode> for WorkspaceError {
|
||||
fn build(code: ErrorCode, msg: String) -> Self { WorkspaceError::new(code, &msg) }
|
||||
}
|
||||
|
||||
use flowy_net::errors::ErrorCode as ServerErrorCode;
|
||||
fn server_error_to_workspace_error(code: ServerErrorCode) -> ErrorCode {
|
||||
match code {
|
||||
ServerErrorCode::UserUnauthorized => ErrorCode::UserUnauthorized,
|
||||
|
@ -45,4 +45,10 @@ pub enum WorkspaceEvent {
|
||||
|
||||
#[event(input = "DeleteViewRequest")]
|
||||
DeleteView = 204,
|
||||
|
||||
#[event(input = "OpenViewRequest", output = "Doc")]
|
||||
OpenView = 205,
|
||||
|
||||
#[event(input = "UpdateViewDataRequest")]
|
||||
UpdateViewData = 206,
|
||||
}
|
||||
|
@ -4,8 +4,10 @@ use crate::{
|
||||
CreateViewRequest,
|
||||
DeleteViewParams,
|
||||
DeleteViewRequest,
|
||||
OpenViewRequest,
|
||||
QueryViewParams,
|
||||
QueryViewRequest,
|
||||
UpdateViewDataRequest,
|
||||
UpdateViewParams,
|
||||
UpdateViewRequest,
|
||||
View,
|
||||
@ -14,6 +16,7 @@ use crate::{
|
||||
services::ViewController,
|
||||
};
|
||||
use flowy_dispatch::prelude::{data_result, Data, DataResult, Unit};
|
||||
use flowy_document::entities::doc::{Doc, QueryDocParams, UpdateDocParams};
|
||||
use std::{convert::TryInto, sync::Arc};
|
||||
|
||||
#[tracing::instrument(skip(data, controller), err)]
|
||||
@ -58,6 +61,26 @@ pub(crate) async fn delete_view_handler(
|
||||
controller: Unit<Arc<ViewController>>,
|
||||
) -> Result<(), WorkspaceError> {
|
||||
let params: DeleteViewParams = data.into_inner().try_into()?;
|
||||
let _ = controller.delete_view(¶ms.view_id).await?;
|
||||
let _ = controller.delete_view(params).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(data, controller), err)]
|
||||
pub(crate) async fn open_view_handler(
|
||||
data: Data<OpenViewRequest>,
|
||||
controller: Unit<Arc<ViewController>>,
|
||||
) -> DataResult<Doc, WorkspaceError> {
|
||||
let params: QueryDocParams = data.into_inner().try_into()?;
|
||||
let doc = controller.open_view(params).await?;
|
||||
data_result(doc)
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(data, controller), err)]
|
||||
pub(crate) async fn update_view_data_handler(
|
||||
data: Data<UpdateViewDataRequest>,
|
||||
controller: Unit<Arc<ViewController>>,
|
||||
) -> Result<(), WorkspaceError> {
|
||||
let params: UpdateDocParams = data.into_inner().try_into()?;
|
||||
let _ = controller.update_view_data(params).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ use crate::{
|
||||
handlers::*,
|
||||
services::{server::construct_workspace_server, ViewController},
|
||||
};
|
||||
use flowy_document::module::Document;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub trait WorkspaceDeps: WorkspaceUser + WorkspaceDatabase {}
|
||||
@ -24,9 +25,9 @@ pub trait WorkspaceDatabase: Send + Sync {
|
||||
fn db_connection(&self) -> Result<DBConnection, WorkspaceError>;
|
||||
}
|
||||
|
||||
pub fn create(user: Arc<dyn WorkspaceUser>, database: Arc<dyn WorkspaceDatabase>) -> Module {
|
||||
pub fn create(user: Arc<dyn WorkspaceUser>, database: Arc<dyn WorkspaceDatabase>, document: Arc<Document>) -> Module {
|
||||
let server = construct_workspace_server();
|
||||
let view_controller = Arc::new(ViewController::new(user.clone(), database.clone(), server.clone()));
|
||||
let view_controller = Arc::new(ViewController::new(user.clone(), database.clone(), server.clone(), document));
|
||||
|
||||
let app_controller = Arc::new(AppController::new(user.clone(), database.clone(), server.clone()));
|
||||
|
||||
@ -60,7 +61,9 @@ pub fn create(user: Arc<dyn WorkspaceUser>, database: Arc<dyn WorkspaceDatabase>
|
||||
.event(WorkspaceEvent::CreateView, create_view_handler)
|
||||
.event(WorkspaceEvent::ReadView, read_view_handler)
|
||||
.event(WorkspaceEvent::UpdateView, update_view_handler)
|
||||
.event(WorkspaceEvent::DeleteView, delete_view_handler);
|
||||
.event(WorkspaceEvent::DeleteView, delete_view_handler)
|
||||
.event(WorkspaceEvent::OpenView, open_view_handler)
|
||||
.event(WorkspaceEvent::UpdateViewData, update_view_data_handler);
|
||||
|
||||
module
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
mod observable;
|
||||
pub(crate) mod observable;
|
||||
|
||||
pub(crate) use observable::*;
|
||||
|
@ -1,5 +1,5 @@
|
||||
use flowy_derive::ProtoBuf_Enum;
|
||||
use flowy_observable::ObservableBuilder;
|
||||
use flowy_observable::NotifyBuilder;
|
||||
const OBSERVABLE_CATEGORY: &'static str = "Workspace";
|
||||
|
||||
#[derive(ProtoBuf_Enum, Debug)]
|
||||
@ -26,4 +26,4 @@ impl std::convert::Into<i32> for WorkspaceObservable {
|
||||
fn into(self) -> i32 { self as i32 }
|
||||
}
|
||||
|
||||
pub(crate) fn observable(id: &str, ty: WorkspaceObservable) -> ObservableBuilder { ObservableBuilder::new(id, ty, OBSERVABLE_CATEGORY) }
|
||||
pub(crate) fn notify(id: &str, ty: WorkspaceObservable) -> NotifyBuilder { NotifyBuilder::new(id, ty, OBSERVABLE_CATEGORY) }
|
||||
|
@ -227,10 +227,8 @@ pub enum ErrorCode {
|
||||
ViewThumbnailInvalid = 21,
|
||||
ViewIdInvalid = 22,
|
||||
ViewDescInvalid = 23,
|
||||
DatabaseConnectionFail = 100,
|
||||
WorkspaceDatabaseError = 101,
|
||||
UserIdIsEmpty = 102,
|
||||
UserUnauthorized = 103,
|
||||
UserIdIsEmpty = 100,
|
||||
UserUnauthorized = 101,
|
||||
InternalError = 1000,
|
||||
RecordNotFound = 1001,
|
||||
}
|
||||
@ -254,10 +252,8 @@ impl ::protobuf::ProtobufEnum for ErrorCode {
|
||||
21 => ::std::option::Option::Some(ErrorCode::ViewThumbnailInvalid),
|
||||
22 => ::std::option::Option::Some(ErrorCode::ViewIdInvalid),
|
||||
23 => ::std::option::Option::Some(ErrorCode::ViewDescInvalid),
|
||||
100 => ::std::option::Option::Some(ErrorCode::DatabaseConnectionFail),
|
||||
101 => ::std::option::Option::Some(ErrorCode::WorkspaceDatabaseError),
|
||||
102 => ::std::option::Option::Some(ErrorCode::UserIdIsEmpty),
|
||||
103 => ::std::option::Option::Some(ErrorCode::UserUnauthorized),
|
||||
100 => ::std::option::Option::Some(ErrorCode::UserIdIsEmpty),
|
||||
101 => ::std::option::Option::Some(ErrorCode::UserUnauthorized),
|
||||
1000 => ::std::option::Option::Some(ErrorCode::InternalError),
|
||||
1001 => ::std::option::Option::Some(ErrorCode::RecordNotFound),
|
||||
_ => ::std::option::Option::None
|
||||
@ -278,8 +274,6 @@ impl ::protobuf::ProtobufEnum for ErrorCode {
|
||||
ErrorCode::ViewThumbnailInvalid,
|
||||
ErrorCode::ViewIdInvalid,
|
||||
ErrorCode::ViewDescInvalid,
|
||||
ErrorCode::DatabaseConnectionFail,
|
||||
ErrorCode::WorkspaceDatabaseError,
|
||||
ErrorCode::UserIdIsEmpty,
|
||||
ErrorCode::UserUnauthorized,
|
||||
ErrorCode::InternalError,
|
||||
@ -314,61 +308,56 @@ impl ::protobuf::reflect::ProtobufValue for ErrorCode {
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x0cerrors.proto\"B\n\x0eWorkspaceError\x12\x1e\n\x04code\x18\x01\x20\
|
||||
\x01(\x0e2\n.ErrorCodeR\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03\
|
||||
msg*\xa3\x03\n\tErrorCode\x12\x0b\n\x07Unknown\x10\0\x12\x18\n\x14Worksp\
|
||||
msg*\xeb\x02\n\tErrorCode\x12\x0b\n\x07Unknown\x10\0\x12\x18\n\x14Worksp\
|
||||
aceNameInvalid\x10\x01\x12\x16\n\x12WorkspaceIdInvalid\x10\x02\x12\x18\n\
|
||||
\x14AppColorStyleInvalid\x10\x03\x12\x18\n\x14WorkspaceDescInvalid\x10\
|
||||
\x04\x12\x1c\n\x18CurrentWorkspaceNotFound\x10\x05\x12\x10\n\x0cAppIdInv\
|
||||
alid\x10\n\x12\x12\n\x0eAppNameInvalid\x10\x0b\x12\x13\n\x0fViewNameInva\
|
||||
lid\x10\x14\x12\x18\n\x14ViewThumbnailInvalid\x10\x15\x12\x11\n\rViewIdI\
|
||||
nvalid\x10\x16\x12\x13\n\x0fViewDescInvalid\x10\x17\x12\x1a\n\x16Databas\
|
||||
eConnectionFail\x10d\x12\x1a\n\x16WorkspaceDatabaseError\x10e\x12\x11\n\
|
||||
\rUserIdIsEmpty\x10f\x12\x14\n\x10UserUnauthorized\x10g\x12\x12\n\rInter\
|
||||
nalError\x10\xe8\x07\x12\x13\n\x0eRecordNotFound\x10\xe9\x07J\x92\x07\n\
|
||||
\x06\x12\x04\0\0\x19\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\
|
||||
\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x16\n\x0b\n\
|
||||
\x04\x04\0\x02\0\x12\x03\x03\x04\x17\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\
|
||||
\x03\x04\r\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0e\x12\n\x0c\n\x05\
|
||||
\x04\0\x02\0\x03\x12\x03\x03\x15\x16\n\x0b\n\x04\x04\0\x02\x01\x12\x03\
|
||||
\x04\x04\x13\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\
|
||||
\x04\0\x02\x01\x01\x12\x03\x04\x0b\x0e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\
|
||||
\x03\x04\x11\x12\n\n\n\x02\x05\0\x12\x04\x06\0\x19\x01\n\n\n\x03\x05\0\
|
||||
\x01\x12\x03\x06\x05\x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\x04\x10\n\
|
||||
\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x07\x04\x0b\n\x0c\n\x05\x05\0\x02\0\
|
||||
\x02\x12\x03\x07\x0e\x0f\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x08\x04\x1d\n\
|
||||
\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x08\x04\x18\n\x0c\n\x05\x05\0\x02\
|
||||
\x01\x02\x12\x03\x08\x1b\x1c\n\x0b\n\x04\x05\0\x02\x02\x12\x03\t\x04\x1b\
|
||||
\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\t\x04\x16\n\x0c\n\x05\x05\0\x02\
|
||||
\x02\x02\x12\x03\t\x19\x1a\n\x0b\n\x04\x05\0\x02\x03\x12\x03\n\x04\x1d\n\
|
||||
\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\n\x04\x18\n\x0c\n\x05\x05\0\x02\x03\
|
||||
\x02\x12\x03\n\x1b\x1c\n\x0b\n\x04\x05\0\x02\x04\x12\x03\x0b\x04\x1d\n\
|
||||
\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x0b\x04\x18\n\x0c\n\x05\x05\0\x02\
|
||||
\x04\x02\x12\x03\x0b\x1b\x1c\n\x0b\n\x04\x05\0\x02\x05\x12\x03\x0c\x04!\
|
||||
\n\x0c\n\x05\x05\0\x02\x05\x01\x12\x03\x0c\x04\x1c\n\x0c\n\x05\x05\0\x02\
|
||||
\x05\x02\x12\x03\x0c\x1f\x20\n\x0b\n\x04\x05\0\x02\x06\x12\x03\r\x04\x16\
|
||||
\n\x0c\n\x05\x05\0\x02\x06\x01\x12\x03\r\x04\x10\n\x0c\n\x05\x05\0\x02\
|
||||
\x06\x02\x12\x03\r\x13\x15\n\x0b\n\x04\x05\0\x02\x07\x12\x03\x0e\x04\x18\
|
||||
\n\x0c\n\x05\x05\0\x02\x07\x01\x12\x03\x0e\x04\x12\n\x0c\n\x05\x05\0\x02\
|
||||
\x07\x02\x12\x03\x0e\x15\x17\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x0f\x04\
|
||||
\x19\n\x0c\n\x05\x05\0\x02\x08\x01\x12\x03\x0f\x04\x13\n\x0c\n\x05\x05\0\
|
||||
\x02\x08\x02\x12\x03\x0f\x16\x18\n\x0b\n\x04\x05\0\x02\t\x12\x03\x10\x04\
|
||||
\x1e\n\x0c\n\x05\x05\0\x02\t\x01\x12\x03\x10\x04\x18\n\x0c\n\x05\x05\0\
|
||||
\x02\t\x02\x12\x03\x10\x1b\x1d\n\x0b\n\x04\x05\0\x02\n\x12\x03\x11\x04\
|
||||
\x17\n\x0c\n\x05\x05\0\x02\n\x01\x12\x03\x11\x04\x11\n\x0c\n\x05\x05\0\
|
||||
\x02\n\x02\x12\x03\x11\x14\x16\n\x0b\n\x04\x05\0\x02\x0b\x12\x03\x12\x04\
|
||||
\x19\n\x0c\n\x05\x05\0\x02\x0b\x01\x12\x03\x12\x04\x13\n\x0c\n\x05\x05\0\
|
||||
\x02\x0b\x02\x12\x03\x12\x16\x18\n\x0b\n\x04\x05\0\x02\x0c\x12\x03\x13\
|
||||
\x04!\n\x0c\n\x05\x05\0\x02\x0c\x01\x12\x03\x13\x04\x1a\n\x0c\n\x05\x05\
|
||||
\0\x02\x0c\x02\x12\x03\x13\x1d\x20\n\x0b\n\x04\x05\0\x02\r\x12\x03\x14\
|
||||
\x04!\n\x0c\n\x05\x05\0\x02\r\x01\x12\x03\x14\x04\x1a\n\x0c\n\x05\x05\0\
|
||||
\x02\r\x02\x12\x03\x14\x1d\x20\n\x0b\n\x04\x05\0\x02\x0e\x12\x03\x15\x04\
|
||||
\x18\n\x0c\n\x05\x05\0\x02\x0e\x01\x12\x03\x15\x04\x11\n\x0c\n\x05\x05\0\
|
||||
\x02\x0e\x02\x12\x03\x15\x14\x17\n\x0b\n\x04\x05\0\x02\x0f\x12\x03\x16\
|
||||
\x04\x1b\n\x0c\n\x05\x05\0\x02\x0f\x01\x12\x03\x16\x04\x14\n\x0c\n\x05\
|
||||
\x05\0\x02\x0f\x02\x12\x03\x16\x17\x1a\n\x0b\n\x04\x05\0\x02\x10\x12\x03\
|
||||
\x17\x04\x19\n\x0c\n\x05\x05\0\x02\x10\x01\x12\x03\x17\x04\x11\n\x0c\n\
|
||||
\x05\x05\0\x02\x10\x02\x12\x03\x17\x14\x18\n\x0b\n\x04\x05\0\x02\x11\x12\
|
||||
\x03\x18\x04\x1a\n\x0c\n\x05\x05\0\x02\x11\x01\x12\x03\x18\x04\x12\n\x0c\
|
||||
\n\x05\x05\0\x02\x11\x02\x12\x03\x18\x15\x19b\x06proto3\
|
||||
nvalid\x10\x16\x12\x13\n\x0fViewDescInvalid\x10\x17\x12\x11\n\rUserIdIsE\
|
||||
mpty\x10d\x12\x14\n\x10UserUnauthorized\x10e\x12\x12\n\rInternalError\
|
||||
\x10\xe8\x07\x12\x13\n\x0eRecordNotFound\x10\xe9\x07J\xc0\x06\n\x06\x12\
|
||||
\x04\0\0\x17\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\
|
||||
\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x16\n\x0b\n\x04\x04\0\
|
||||
\x02\0\x12\x03\x03\x04\x17\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x03\x04\r\
|
||||
\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0e\x12\n\x0c\n\x05\x04\0\x02\0\
|
||||
\x03\x12\x03\x03\x15\x16\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x13\n\
|
||||
\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\x01\
|
||||
\x01\x12\x03\x04\x0b\x0e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x11\
|
||||
\x12\n\n\n\x02\x05\0\x12\x04\x06\0\x17\x01\n\n\n\x03\x05\0\x01\x12\x03\
|
||||
\x06\x05\x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\x04\x10\n\x0c\n\x05\x05\
|
||||
\0\x02\0\x01\x12\x03\x07\x04\x0b\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x07\
|
||||
\x0e\x0f\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x08\x04\x1d\n\x0c\n\x05\x05\0\
|
||||
\x02\x01\x01\x12\x03\x08\x04\x18\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\
|
||||
\x08\x1b\x1c\n\x0b\n\x04\x05\0\x02\x02\x12\x03\t\x04\x1b\n\x0c\n\x05\x05\
|
||||
\0\x02\x02\x01\x12\x03\t\x04\x16\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\t\
|
||||
\x19\x1a\n\x0b\n\x04\x05\0\x02\x03\x12\x03\n\x04\x1d\n\x0c\n\x05\x05\0\
|
||||
\x02\x03\x01\x12\x03\n\x04\x18\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\n\
|
||||
\x1b\x1c\n\x0b\n\x04\x05\0\x02\x04\x12\x03\x0b\x04\x1d\n\x0c\n\x05\x05\0\
|
||||
\x02\x04\x01\x12\x03\x0b\x04\x18\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\
|
||||
\x0b\x1b\x1c\n\x0b\n\x04\x05\0\x02\x05\x12\x03\x0c\x04!\n\x0c\n\x05\x05\
|
||||
\0\x02\x05\x01\x12\x03\x0c\x04\x1c\n\x0c\n\x05\x05\0\x02\x05\x02\x12\x03\
|
||||
\x0c\x1f\x20\n\x0b\n\x04\x05\0\x02\x06\x12\x03\r\x04\x16\n\x0c\n\x05\x05\
|
||||
\0\x02\x06\x01\x12\x03\r\x04\x10\n\x0c\n\x05\x05\0\x02\x06\x02\x12\x03\r\
|
||||
\x13\x15\n\x0b\n\x04\x05\0\x02\x07\x12\x03\x0e\x04\x18\n\x0c\n\x05\x05\0\
|
||||
\x02\x07\x01\x12\x03\x0e\x04\x12\n\x0c\n\x05\x05\0\x02\x07\x02\x12\x03\
|
||||
\x0e\x15\x17\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x0f\x04\x19\n\x0c\n\x05\
|
||||
\x05\0\x02\x08\x01\x12\x03\x0f\x04\x13\n\x0c\n\x05\x05\0\x02\x08\x02\x12\
|
||||
\x03\x0f\x16\x18\n\x0b\n\x04\x05\0\x02\t\x12\x03\x10\x04\x1e\n\x0c\n\x05\
|
||||
\x05\0\x02\t\x01\x12\x03\x10\x04\x18\n\x0c\n\x05\x05\0\x02\t\x02\x12\x03\
|
||||
\x10\x1b\x1d\n\x0b\n\x04\x05\0\x02\n\x12\x03\x11\x04\x17\n\x0c\n\x05\x05\
|
||||
\0\x02\n\x01\x12\x03\x11\x04\x11\n\x0c\n\x05\x05\0\x02\n\x02\x12\x03\x11\
|
||||
\x14\x16\n\x0b\n\x04\x05\0\x02\x0b\x12\x03\x12\x04\x19\n\x0c\n\x05\x05\0\
|
||||
\x02\x0b\x01\x12\x03\x12\x04\x13\n\x0c\n\x05\x05\0\x02\x0b\x02\x12\x03\
|
||||
\x12\x16\x18\n\x0b\n\x04\x05\0\x02\x0c\x12\x03\x13\x04\x18\n\x0c\n\x05\
|
||||
\x05\0\x02\x0c\x01\x12\x03\x13\x04\x11\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\
|
||||
\x03\x13\x14\x17\n\x0b\n\x04\x05\0\x02\r\x12\x03\x14\x04\x1b\n\x0c\n\x05\
|
||||
\x05\0\x02\r\x01\x12\x03\x14\x04\x14\n\x0c\n\x05\x05\0\x02\r\x02\x12\x03\
|
||||
\x14\x17\x1a\n\x0b\n\x04\x05\0\x02\x0e\x12\x03\x15\x04\x19\n\x0c\n\x05\
|
||||
\x05\0\x02\x0e\x01\x12\x03\x15\x04\x11\n\x0c\n\x05\x05\0\x02\x0e\x02\x12\
|
||||
\x03\x15\x14\x18\n\x0b\n\x04\x05\0\x02\x0f\x12\x03\x16\x04\x1a\n\x0c\n\
|
||||
\x05\x05\0\x02\x0f\x01\x12\x03\x16\x04\x12\n\x0c\n\x05\x05\0\x02\x0f\x02\
|
||||
\x12\x03\x16\x15\x19b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -39,6 +39,8 @@ pub enum WorkspaceEvent {
|
||||
ReadView = 202,
|
||||
UpdateView = 203,
|
||||
DeleteView = 204,
|
||||
OpenView = 205,
|
||||
UpdateViewData = 206,
|
||||
}
|
||||
|
||||
impl ::protobuf::ProtobufEnum for WorkspaceEvent {
|
||||
@ -62,6 +64,8 @@ impl ::protobuf::ProtobufEnum for WorkspaceEvent {
|
||||
202 => ::std::option::Option::Some(WorkspaceEvent::ReadView),
|
||||
203 => ::std::option::Option::Some(WorkspaceEvent::UpdateView),
|
||||
204 => ::std::option::Option::Some(WorkspaceEvent::DeleteView),
|
||||
205 => ::std::option::Option::Some(WorkspaceEvent::OpenView),
|
||||
206 => ::std::option::Option::Some(WorkspaceEvent::UpdateViewData),
|
||||
_ => ::std::option::Option::None
|
||||
}
|
||||
}
|
||||
@ -82,6 +86,8 @@ impl ::protobuf::ProtobufEnum for WorkspaceEvent {
|
||||
WorkspaceEvent::ReadView,
|
||||
WorkspaceEvent::UpdateView,
|
||||
WorkspaceEvent::DeleteView,
|
||||
WorkspaceEvent::OpenView,
|
||||
WorkspaceEvent::UpdateViewData,
|
||||
];
|
||||
values
|
||||
}
|
||||
@ -110,15 +116,16 @@ impl ::protobuf::reflect::ProtobufValue for WorkspaceEvent {
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x0bevent.proto*\x8a\x02\n\x0eWorkspaceEvent\x12\x13\n\x0fCreateWorksp\
|
||||
\n\x0bevent.proto*\xae\x02\n\x0eWorkspaceEvent\x12\x13\n\x0fCreateWorksp\
|
||||
ace\x10\0\x12\x14\n\x10ReadCurWorkspace\x10\x01\x12\x12\n\x0eReadWorkspa\
|
||||
ces\x10\x02\x12\x13\n\x0fDeleteWorkspace\x10\x03\x12\x11\n\rOpenWorkspac\
|
||||
e\x10\x04\x12\x15\n\x11ReadWorkspaceApps\x10\x05\x12\r\n\tCreateApp\x10e\
|
||||
\x12\r\n\tDeleteApp\x10f\x12\x0b\n\x07ReadApp\x10g\x12\r\n\tUpdateApp\
|
||||
\x10h\x12\x0f\n\nCreateView\x10\xc9\x01\x12\r\n\x08ReadView\x10\xca\x01\
|
||||
\x12\x0f\n\nUpdateView\x10\xcb\x01\x12\x0f\n\nDeleteView\x10\xcc\x01J\
|
||||
\xe8\x04\n\x06\x12\x04\0\0\x11\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\
|
||||
\x02\x05\0\x12\x04\x02\0\x11\x01\n\n\n\x03\x05\0\x01\x12\x03\x02\x05\x13\
|
||||
\x12\x0f\n\nUpdateView\x10\xcb\x01\x12\x0f\n\nDeleteView\x10\xcc\x01\x12\
|
||||
\r\n\x08OpenView\x10\xcd\x01\x12\x13\n\x0eUpdateViewData\x10\xce\x01J\
|
||||
\xba\x05\n\x06\x12\x04\0\0\x13\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\
|
||||
\x02\x05\0\x12\x04\x02\0\x13\x01\n\n\n\x03\x05\0\x01\x12\x03\x02\x05\x13\
|
||||
\n\x0b\n\x04\x05\0\x02\0\x12\x03\x03\x04\x18\n\x0c\n\x05\x05\0\x02\0\x01\
|
||||
\x12\x03\x03\x04\x13\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x03\x16\x17\n\
|
||||
\x0b\n\x04\x05\0\x02\x01\x12\x03\x04\x04\x19\n\x0c\n\x05\x05\0\x02\x01\
|
||||
@ -147,7 +154,11 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\x0c\x01\x12\x03\x0f\x04\x0e\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\x03\x0f\
|
||||
\x11\x14\n\x0b\n\x04\x05\0\x02\r\x12\x03\x10\x04\x15\n\x0c\n\x05\x05\0\
|
||||
\x02\r\x01\x12\x03\x10\x04\x0e\n\x0c\n\x05\x05\0\x02\r\x02\x12\x03\x10\
|
||||
\x11\x14b\x06proto3\
|
||||
\x11\x14\n\x0b\n\x04\x05\0\x02\x0e\x12\x03\x11\x04\x13\n\x0c\n\x05\x05\0\
|
||||
\x02\x0e\x01\x12\x03\x11\x04\x0c\n\x0c\n\x05\x05\0\x02\x0e\x02\x12\x03\
|
||||
\x11\x0f\x12\n\x0b\n\x04\x05\0\x02\x0f\x12\x03\x12\x04\x19\n\x0c\n\x05\
|
||||
\x05\0\x02\x0f\x01\x12\x03\x12\x04\x12\n\x0c\n\x05\x05\0\x02\x0f\x02\x12\
|
||||
\x03\x12\x15\x18b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -387,6 +387,7 @@ pub struct CreateViewParams {
|
||||
pub desc: ::std::string::String,
|
||||
pub thumbnail: ::std::string::String,
|
||||
pub view_type: ViewType,
|
||||
pub data: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
@ -521,6 +522,32 @@ impl CreateViewParams {
|
||||
pub fn set_view_type(&mut self, v: ViewType) {
|
||||
self.view_type = v;
|
||||
}
|
||||
|
||||
// string data = 6;
|
||||
|
||||
|
||||
pub fn get_data(&self) -> &str {
|
||||
&self.data
|
||||
}
|
||||
pub fn clear_data(&mut self) {
|
||||
self.data.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_data(&mut self, v: ::std::string::String) {
|
||||
self.data = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_data(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.data
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_data(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.data, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for CreateViewParams {
|
||||
@ -547,6 +574,9 @@ impl ::protobuf::Message for CreateViewParams {
|
||||
5 => {
|
||||
::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
|
||||
},
|
||||
6 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
@ -574,6 +604,9 @@ impl ::protobuf::Message for CreateViewParams {
|
||||
if self.view_type != ViewType::Blank {
|
||||
my_size += ::protobuf::rt::enum_size(5, self.view_type);
|
||||
}
|
||||
if !self.data.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(6, &self.data);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
@ -595,6 +628,9 @@ impl ::protobuf::Message for CreateViewParams {
|
||||
if self.view_type != ViewType::Blank {
|
||||
os.write_enum(5, ::protobuf::ProtobufEnum::value(&self.view_type))?;
|
||||
}
|
||||
if !self.data.is_empty() {
|
||||
os.write_string(6, &self.data)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
@ -658,6 +694,11 @@ impl ::protobuf::Message for CreateViewParams {
|
||||
|m: &CreateViewParams| { &m.view_type },
|
||||
|m: &mut CreateViewParams| { &mut m.view_type },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"data",
|
||||
|m: &CreateViewParams| { &m.data },
|
||||
|m: &mut CreateViewParams| { &mut m.data },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewParams>(
|
||||
"CreateViewParams",
|
||||
fields,
|
||||
@ -679,6 +720,7 @@ impl ::protobuf::Clear for CreateViewParams {
|
||||
self.desc.clear();
|
||||
self.thumbnail.clear();
|
||||
self.view_type = ViewType::Blank;
|
||||
self.data.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
@ -1394,88 +1436,92 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
long_to_id\x18\x01\x20\x01(\tR\nbelongToId\x12\x12\n\x04name\x18\x02\x20\
|
||||
\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12\x1e\n\
|
||||
\tthumbnail\x18\x04\x20\x01(\tH\0R\tthumbnail\x12&\n\tview_type\x18\x05\
|
||||
\x20\x01(\x0e2\t.ViewTypeR\x08viewTypeB\x12\n\x10one_of_thumbnail\"\xa2\
|
||||
\x20\x01(\x0e2\t.ViewTypeR\x08viewTypeB\x12\n\x10one_of_thumbnail\"\xb6\
|
||||
\x01\n\x10CreateViewParams\x12\x20\n\x0cbelong_to_id\x18\x01\x20\x01(\tR\
|
||||
\nbelongToId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04\
|
||||
desc\x18\x03\x20\x01(\tR\x04desc\x12\x1c\n\tthumbnail\x18\x04\x20\x01(\t\
|
||||
R\tthumbnail\x12&\n\tview_type\x18\x05\x20\x01(\x0e2\t.ViewTypeR\x08view\
|
||||
Type\"\x97\x02\n\x04View\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\
|
||||
\x20\n\x0cbelong_to_id\x18\x02\x20\x01(\tR\nbelongToId\x12\x12\n\x04name\
|
||||
\x18\x03\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x04\x20\x01(\tR\x04de\
|
||||
sc\x12&\n\tview_type\x18\x05\x20\x01(\x0e2\t.ViewTypeR\x08viewType\x12\
|
||||
\x18\n\x07version\x18\x06\x20\x01(\x03R\x07version\x12-\n\nbelongings\
|
||||
\x18\x07\x20\x01(\x0b2\r.RepeatedViewR\nbelongings\x12#\n\rmodified_time\
|
||||
\x18\x08\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\x18\t\
|
||||
\x20\x01(\x03R\ncreateTime\"+\n\x0cRepeatedView\x12\x1b\n\x05items\x18\
|
||||
\x01\x20\x03(\x0b2\x05.ViewR\x05items*\x1e\n\x08ViewType\x12\t\n\x05Blan\
|
||||
k\x10\0\x12\x07\n\x03Doc\x10\x01J\xd1\n\n\x06\x12\x04\0\0!\x01\n\x08\n\
|
||||
\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x08\x01\n\n\n\x03\
|
||||
\x04\0\x01\x12\x03\x02\x08\x19\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\
|
||||
\x1c\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\
|
||||
\0\x01\x12\x03\x03\x0b\x17\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x1a\
|
||||
\x1b\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x14\n\x0c\n\x05\x04\0\x02\
|
||||
\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x0b\
|
||||
\x0f\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x12\x13\n\x0b\n\x04\x04\0\
|
||||
\x02\x02\x12\x03\x05\x04\x14\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x05\
|
||||
\x04\n\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x05\x0b\x0f\n\x0c\n\x05\x04\
|
||||
\0\x02\x02\x03\x12\x03\x05\x12\x13\n\x0b\n\x04\x04\0\x08\0\x12\x03\x06\
|
||||
\x044\n\x0c\n\x05\x04\0\x08\0\x01\x12\x03\x06\n\x1a\n\x0b\n\x04\x04\0\
|
||||
\x02\x03\x12\x03\x06\x1d2\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x06\x1d#\
|
||||
\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x06$-\n\x0c\n\x05\x04\0\x02\x03\
|
||||
\x03\x12\x03\x0601\n\x0b\n\x04\x04\0\x02\x04\x12\x03\x07\x04\x1b\n\x0c\n\
|
||||
\x05\x04\0\x02\x04\x06\x12\x03\x07\x04\x0c\n\x0c\n\x05\x04\0\x02\x04\x01\
|
||||
\x12\x03\x07\r\x16\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x07\x19\x1a\n\n\
|
||||
\n\x02\x04\x01\x12\x04\t\0\x0f\x01\n\n\n\x03\x04\x01\x01\x12\x03\t\x08\
|
||||
\x18\n\x0b\n\x04\x04\x01\x02\0\x12\x03\n\x04\x1c\n\x0c\n\x05\x04\x01\x02\
|
||||
\0\x05\x12\x03\n\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\n\x0b\x17\n\
|
||||
\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\n\x1a\x1b\n\x0b\n\x04\x04\x01\x02\
|
||||
\x01\x12\x03\x0b\x04\x14\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x0b\x04\
|
||||
\n\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x0b\x0b\x0f\n\x0c\n\x05\x04\
|
||||
\x01\x02\x01\x03\x12\x03\x0b\x12\x13\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\
|
||||
\x0c\x04\x14\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\x0c\x04\n\n\x0c\n\
|
||||
\x05\x04\x01\x02\x02\x01\x12\x03\x0c\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x02\
|
||||
\x03\x12\x03\x0c\x12\x13\n\x0b\n\x04\x04\x01\x02\x03\x12\x03\r\x04\x19\n\
|
||||
\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\r\x04\n\n\x0c\n\x05\x04\x01\x02\
|
||||
\x03\x01\x12\x03\r\x0b\x14\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03\r\x17\
|
||||
\x18\n\x0b\n\x04\x04\x01\x02\x04\x12\x03\x0e\x04\x1b\n\x0c\n\x05\x04\x01\
|
||||
\x02\x04\x06\x12\x03\x0e\x04\x0c\n\x0c\n\x05\x04\x01\x02\x04\x01\x12\x03\
|
||||
\x0e\r\x16\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03\x0e\x19\x1a\n\n\n\x02\
|
||||
\x04\x02\x12\x04\x10\0\x1a\x01\n\n\n\x03\x04\x02\x01\x12\x03\x10\x08\x0c\
|
||||
\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x11\x04\x12\n\x0c\n\x05\x04\x02\x02\0\
|
||||
\x05\x12\x03\x11\x04\n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x11\x0b\r\n\
|
||||
\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x11\x10\x11\n\x0b\n\x04\x04\x02\x02\
|
||||
\x01\x12\x03\x12\x04\x1c\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x12\x04\
|
||||
\n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x12\x0b\x17\n\x0c\n\x05\x04\
|
||||
\x02\x02\x01\x03\x12\x03\x12\x1a\x1b\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\
|
||||
\x13\x04\x14\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03\x13\x04\n\n\x0c\n\
|
||||
\x05\x04\x02\x02\x02\x01\x12\x03\x13\x0b\x0f\n\x0c\n\x05\x04\x02\x02\x02\
|
||||
\x03\x12\x03\x13\x12\x13\n\x0b\n\x04\x04\x02\x02\x03\x12\x03\x14\x04\x14\
|
||||
\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\x03\x14\x04\n\n\x0c\n\x05\x04\x02\
|
||||
\x02\x03\x01\x12\x03\x14\x0b\x0f\n\x0c\n\x05\x04\x02\x02\x03\x03\x12\x03\
|
||||
\x14\x12\x13\n\x0b\n\x04\x04\x02\x02\x04\x12\x03\x15\x04\x1b\n\x0c\n\x05\
|
||||
\x04\x02\x02\x04\x06\x12\x03\x15\x04\x0c\n\x0c\n\x05\x04\x02\x02\x04\x01\
|
||||
\x12\x03\x15\r\x16\n\x0c\n\x05\x04\x02\x02\x04\x03\x12\x03\x15\x19\x1a\n\
|
||||
\x0b\n\x04\x04\x02\x02\x05\x12\x03\x16\x04\x16\n\x0c\n\x05\x04\x02\x02\
|
||||
\x05\x05\x12\x03\x16\x04\t\n\x0c\n\x05\x04\x02\x02\x05\x01\x12\x03\x16\n\
|
||||
\x11\n\x0c\n\x05\x04\x02\x02\x05\x03\x12\x03\x16\x14\x15\n\x0b\n\x04\x04\
|
||||
\x02\x02\x06\x12\x03\x17\x04\x20\n\x0c\n\x05\x04\x02\x02\x06\x06\x12\x03\
|
||||
\x17\x04\x10\n\x0c\n\x05\x04\x02\x02\x06\x01\x12\x03\x17\x11\x1b\n\x0c\n\
|
||||
\x05\x04\x02\x02\x06\x03\x12\x03\x17\x1e\x1f\n\x0b\n\x04\x04\x02\x02\x07\
|
||||
\x12\x03\x18\x04\x1c\n\x0c\n\x05\x04\x02\x02\x07\x05\x12\x03\x18\x04\t\n\
|
||||
\x0c\n\x05\x04\x02\x02\x07\x01\x12\x03\x18\n\x17\n\x0c\n\x05\x04\x02\x02\
|
||||
\x07\x03\x12\x03\x18\x1a\x1b\n\x0b\n\x04\x04\x02\x02\x08\x12\x03\x19\x04\
|
||||
\x1a\n\x0c\n\x05\x04\x02\x02\x08\x05\x12\x03\x19\x04\t\n\x0c\n\x05\x04\
|
||||
\x02\x02\x08\x01\x12\x03\x19\n\x15\n\x0c\n\x05\x04\x02\x02\x08\x03\x12\
|
||||
\x03\x19\x18\x19\n\n\n\x02\x04\x03\x12\x04\x1b\0\x1d\x01\n\n\n\x03\x04\
|
||||
\x03\x01\x12\x03\x1b\x08\x14\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x1c\x04\
|
||||
\x1c\n\x0c\n\x05\x04\x03\x02\0\x04\x12\x03\x1c\x04\x0c\n\x0c\n\x05\x04\
|
||||
\x03\x02\0\x06\x12\x03\x1c\r\x11\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03\
|
||||
\x1c\x12\x17\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x1c\x1a\x1b\n\n\n\x02\
|
||||
\x05\0\x12\x04\x1e\0!\x01\n\n\n\x03\x05\0\x01\x12\x03\x1e\x05\r\n\x0b\n\
|
||||
\x04\x05\0\x02\0\x12\x03\x1f\x04\x0e\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\
|
||||
\x1f\x04\t\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x1f\x0c\r\n\x0b\n\x04\x05\
|
||||
\0\x02\x01\x12\x03\x20\x04\x0c\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x20\
|
||||
\x04\x07\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x20\n\x0bb\x06proto3\
|
||||
Type\x12\x12\n\x04data\x18\x06\x20\x01(\tR\x04data\"\x97\x02\n\x04View\
|
||||
\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x20\n\x0cbelong_to_id\x18\
|
||||
\x02\x20\x01(\tR\nbelongToId\x12\x12\n\x04name\x18\x03\x20\x01(\tR\x04na\
|
||||
me\x12\x12\n\x04desc\x18\x04\x20\x01(\tR\x04desc\x12&\n\tview_type\x18\
|
||||
\x05\x20\x01(\x0e2\t.ViewTypeR\x08viewType\x12\x18\n\x07version\x18\x06\
|
||||
\x20\x01(\x03R\x07version\x12-\n\nbelongings\x18\x07\x20\x01(\x0b2\r.Rep\
|
||||
eatedViewR\nbelongings\x12#\n\rmodified_time\x18\x08\x20\x01(\x03R\x0cmo\
|
||||
difiedTime\x12\x1f\n\x0bcreate_time\x18\t\x20\x01(\x03R\ncreateTime\"+\n\
|
||||
\x0cRepeatedView\x12\x1b\n\x05items\x18\x01\x20\x03(\x0b2\x05.ViewR\x05i\
|
||||
tems*\x1e\n\x08ViewType\x12\t\n\x05Blank\x10\0\x12\x07\n\x03Doc\x10\x01J\
|
||||
\x88\x0b\n\x06\x12\x04\0\0\"\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\
|
||||
\x02\x04\0\x12\x04\x02\0\x08\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x19\
|
||||
\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x1c\n\x0c\n\x05\x04\0\x02\0\x05\
|
||||
\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x17\n\x0c\
|
||||
\n\x05\x04\0\x02\0\x03\x12\x03\x03\x1a\x1b\n\x0b\n\x04\x04\0\x02\x01\x12\
|
||||
\x03\x04\x04\x14\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\
|
||||
\x05\x04\0\x02\x01\x01\x12\x03\x04\x0b\x0f\n\x0c\n\x05\x04\0\x02\x01\x03\
|
||||
\x12\x03\x04\x12\x13\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x04\x14\n\x0c\
|
||||
\n\x05\x04\0\x02\x02\x05\x12\x03\x05\x04\n\n\x0c\n\x05\x04\0\x02\x02\x01\
|
||||
\x12\x03\x05\x0b\x0f\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05\x12\x13\n\
|
||||
\x0b\n\x04\x04\0\x08\0\x12\x03\x06\x044\n\x0c\n\x05\x04\0\x08\0\x01\x12\
|
||||
\x03\x06\n\x1a\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x06\x1d2\n\x0c\n\x05\
|
||||
\x04\0\x02\x03\x05\x12\x03\x06\x1d#\n\x0c\n\x05\x04\0\x02\x03\x01\x12\
|
||||
\x03\x06$-\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x0601\n\x0b\n\x04\x04\0\
|
||||
\x02\x04\x12\x03\x07\x04\x1b\n\x0c\n\x05\x04\0\x02\x04\x06\x12\x03\x07\
|
||||
\x04\x0c\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x07\r\x16\n\x0c\n\x05\x04\
|
||||
\0\x02\x04\x03\x12\x03\x07\x19\x1a\n\n\n\x02\x04\x01\x12\x04\t\0\x10\x01\
|
||||
\n\n\n\x03\x04\x01\x01\x12\x03\t\x08\x18\n\x0b\n\x04\x04\x01\x02\0\x12\
|
||||
\x03\n\x04\x1c\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\n\x04\n\n\x0c\n\x05\
|
||||
\x04\x01\x02\0\x01\x12\x03\n\x0b\x17\n\x0c\n\x05\x04\x01\x02\0\x03\x12\
|
||||
\x03\n\x1a\x1b\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x0b\x04\x14\n\x0c\n\
|
||||
\x05\x04\x01\x02\x01\x05\x12\x03\x0b\x04\n\n\x0c\n\x05\x04\x01\x02\x01\
|
||||
\x01\x12\x03\x0b\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x0b\x12\
|
||||
\x13\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\x0c\x04\x14\n\x0c\n\x05\x04\x01\
|
||||
\x02\x02\x05\x12\x03\x0c\x04\n\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\
|
||||
\x0c\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\x0c\x12\x13\n\x0b\n\
|
||||
\x04\x04\x01\x02\x03\x12\x03\r\x04\x19\n\x0c\n\x05\x04\x01\x02\x03\x05\
|
||||
\x12\x03\r\x04\n\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\r\x0b\x14\n\x0c\
|
||||
\n\x05\x04\x01\x02\x03\x03\x12\x03\r\x17\x18\n\x0b\n\x04\x04\x01\x02\x04\
|
||||
\x12\x03\x0e\x04\x1b\n\x0c\n\x05\x04\x01\x02\x04\x06\x12\x03\x0e\x04\x0c\
|
||||
\n\x0c\n\x05\x04\x01\x02\x04\x01\x12\x03\x0e\r\x16\n\x0c\n\x05\x04\x01\
|
||||
\x02\x04\x03\x12\x03\x0e\x19\x1a\n\x0b\n\x04\x04\x01\x02\x05\x12\x03\x0f\
|
||||
\x04\x14\n\x0c\n\x05\x04\x01\x02\x05\x05\x12\x03\x0f\x04\n\n\x0c\n\x05\
|
||||
\x04\x01\x02\x05\x01\x12\x03\x0f\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x05\x03\
|
||||
\x12\x03\x0f\x12\x13\n\n\n\x02\x04\x02\x12\x04\x11\0\x1b\x01\n\n\n\x03\
|
||||
\x04\x02\x01\x12\x03\x11\x08\x0c\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x12\
|
||||
\x04\x12\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x12\x04\n\n\x0c\n\x05\x04\
|
||||
\x02\x02\0\x01\x12\x03\x12\x0b\r\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\
|
||||
\x12\x10\x11\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x13\x04\x1c\n\x0c\n\x05\
|
||||
\x04\x02\x02\x01\x05\x12\x03\x13\x04\n\n\x0c\n\x05\x04\x02\x02\x01\x01\
|
||||
\x12\x03\x13\x0b\x17\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x13\x1a\x1b\
|
||||
\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\x14\x04\x14\n\x0c\n\x05\x04\x02\x02\
|
||||
\x02\x05\x12\x03\x14\x04\n\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\x14\
|
||||
\x0b\x0f\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\x14\x12\x13\n\x0b\n\x04\
|
||||
\x04\x02\x02\x03\x12\x03\x15\x04\x14\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\
|
||||
\x03\x15\x04\n\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03\x15\x0b\x0f\n\x0c\
|
||||
\n\x05\x04\x02\x02\x03\x03\x12\x03\x15\x12\x13\n\x0b\n\x04\x04\x02\x02\
|
||||
\x04\x12\x03\x16\x04\x1b\n\x0c\n\x05\x04\x02\x02\x04\x06\x12\x03\x16\x04\
|
||||
\x0c\n\x0c\n\x05\x04\x02\x02\x04\x01\x12\x03\x16\r\x16\n\x0c\n\x05\x04\
|
||||
\x02\x02\x04\x03\x12\x03\x16\x19\x1a\n\x0b\n\x04\x04\x02\x02\x05\x12\x03\
|
||||
\x17\x04\x16\n\x0c\n\x05\x04\x02\x02\x05\x05\x12\x03\x17\x04\t\n\x0c\n\
|
||||
\x05\x04\x02\x02\x05\x01\x12\x03\x17\n\x11\n\x0c\n\x05\x04\x02\x02\x05\
|
||||
\x03\x12\x03\x17\x14\x15\n\x0b\n\x04\x04\x02\x02\x06\x12\x03\x18\x04\x20\
|
||||
\n\x0c\n\x05\x04\x02\x02\x06\x06\x12\x03\x18\x04\x10\n\x0c\n\x05\x04\x02\
|
||||
\x02\x06\x01\x12\x03\x18\x11\x1b\n\x0c\n\x05\x04\x02\x02\x06\x03\x12\x03\
|
||||
\x18\x1e\x1f\n\x0b\n\x04\x04\x02\x02\x07\x12\x03\x19\x04\x1c\n\x0c\n\x05\
|
||||
\x04\x02\x02\x07\x05\x12\x03\x19\x04\t\n\x0c\n\x05\x04\x02\x02\x07\x01\
|
||||
\x12\x03\x19\n\x17\n\x0c\n\x05\x04\x02\x02\x07\x03\x12\x03\x19\x1a\x1b\n\
|
||||
\x0b\n\x04\x04\x02\x02\x08\x12\x03\x1a\x04\x1a\n\x0c\n\x05\x04\x02\x02\
|
||||
\x08\x05\x12\x03\x1a\x04\t\n\x0c\n\x05\x04\x02\x02\x08\x01\x12\x03\x1a\n\
|
||||
\x15\n\x0c\n\x05\x04\x02\x02\x08\x03\x12\x03\x1a\x18\x19\n\n\n\x02\x04\
|
||||
\x03\x12\x04\x1c\0\x1e\x01\n\n\n\x03\x04\x03\x01\x12\x03\x1c\x08\x14\n\
|
||||
\x0b\n\x04\x04\x03\x02\0\x12\x03\x1d\x04\x1c\n\x0c\n\x05\x04\x03\x02\0\
|
||||
\x04\x12\x03\x1d\x04\x0c\n\x0c\n\x05\x04\x03\x02\0\x06\x12\x03\x1d\r\x11\
|
||||
\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03\x1d\x12\x17\n\x0c\n\x05\x04\x03\
|
||||
\x02\0\x03\x12\x03\x1d\x1a\x1b\n\n\n\x02\x05\0\x12\x04\x1f\0\"\x01\n\n\n\
|
||||
\x03\x05\0\x01\x12\x03\x1f\x05\r\n\x0b\n\x04\x05\0\x02\0\x12\x03\x20\x04\
|
||||
\x0e\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x20\x04\t\n\x0c\n\x05\x05\0\x02\
|
||||
\0\x02\x12\x03\x20\x0c\r\n\x0b\n\x04\x05\0\x02\x01\x12\x03!\x04\x0c\n\
|
||||
\x0c\n\x05\x05\0\x02\x01\x01\x12\x03!\x04\x07\n\x0c\n\x05\x05\0\x02\x01\
|
||||
\x02\x12\x03!\n\x0bb\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -481,15 +481,175 @@ impl ::protobuf::reflect::ProtobufValue for QueryViewParams {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct OpenViewRequest {
|
||||
// message fields
|
||||
pub view_id: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a OpenViewRequest {
|
||||
fn default() -> &'a OpenViewRequest {
|
||||
<OpenViewRequest as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl OpenViewRequest {
|
||||
pub fn new() -> OpenViewRequest {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string view_id = 1;
|
||||
|
||||
|
||||
pub fn get_view_id(&self) -> &str {
|
||||
&self.view_id
|
||||
}
|
||||
pub fn clear_view_id(&mut self) {
|
||||
self.view_id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_view_id(&mut self, v: ::std::string::String) {
|
||||
self.view_id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.view_id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_view_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.view_id, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for OpenViewRequest {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.view_id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.view_id);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.view_id.is_empty() {
|
||||
os.write_string(1, &self.view_id)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> OpenViewRequest {
|
||||
OpenViewRequest::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"view_id",
|
||||
|m: &OpenViewRequest| { &m.view_id },
|
||||
|m: &mut OpenViewRequest| { &mut m.view_id },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<OpenViewRequest>(
|
||||
"OpenViewRequest",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static OpenViewRequest {
|
||||
static instance: ::protobuf::rt::LazyV2<OpenViewRequest> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(OpenViewRequest::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for OpenViewRequest {
|
||||
fn clear(&mut self) {
|
||||
self.view_id.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for OpenViewRequest {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for OpenViewRequest {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x10view_query.proto\"o\n\x10QueryViewRequest\x12\x17\n\x07view_id\x18\
|
||||
\x01\x20\x01(\tR\x06viewId\x12\x19\n\x08is_trash\x18\x02\x20\x01(\x08R\
|
||||
\x07isTrash\x12'\n\x0fread_belongings\x18\x03\x20\x01(\x08R\x0ereadBelon\
|
||||
gings\"n\n\x0fQueryViewParams\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\
|
||||
\x06viewId\x12\x19\n\x08is_trash\x18\x02\x20\x01(\x08R\x07isTrash\x12'\n\
|
||||
\x0fread_belongings\x18\x03\x20\x01(\x08R\x0ereadBelongingsJ\x8c\x03\n\
|
||||
\x06\x12\x04\0\0\x0b\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\
|
||||
\x12\x04\x02\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x18\n\x0b\n\
|
||||
\x0fread_belongings\x18\x03\x20\x01(\x08R\x0ereadBelongings\"*\n\x0fOpen\
|
||||
ViewRequest\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewIdJ\xdb\x03\
|
||||
\n\x06\x12\x04\0\0\x0e\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\
|
||||
\0\x12\x04\x02\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x18\n\x0b\n\
|
||||
\x04\x04\0\x02\0\x12\x03\x03\x04\x17\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\
|
||||
\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x12\n\x0c\n\x05\
|
||||
\x04\0\x02\0\x03\x12\x03\x03\x15\x16\n\x0b\n\x04\x04\0\x02\x01\x12\x03\
|
||||
@ -507,7 +667,11 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x05\x04\x01\x02\x01\x03\x12\x03\t\x14\x15\n\x0b\n\x04\x04\x01\x02\x02\
|
||||
\x12\x03\n\x04\x1d\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\n\x04\x08\n\
|
||||
\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\n\t\x18\n\x0c\n\x05\x04\x01\x02\
|
||||
\x02\x03\x12\x03\n\x1b\x1cb\x06proto3\
|
||||
\x02\x03\x12\x03\n\x1b\x1c\n\n\n\x02\x04\x02\x12\x04\x0c\0\x0e\x01\n\n\n\
|
||||
\x03\x04\x02\x01\x12\x03\x0c\x08\x17\n\x0b\n\x04\x04\x02\x02\0\x12\x03\r\
|
||||
\x04\x17\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\r\x04\n\n\x0c\n\x05\x04\
|
||||
\x02\x02\0\x01\x12\x03\r\x0b\x12\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\r\
|
||||
\x15\x16b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -943,6 +943,207 @@ impl ::protobuf::reflect::ProtobufValue for UpdateViewParams {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct UpdateViewDataRequest {
|
||||
// message fields
|
||||
pub view_id: ::std::string::String,
|
||||
pub data: ::std::string::String,
|
||||
// special fields
|
||||
pub unknown_fields: ::protobuf::UnknownFields,
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a UpdateViewDataRequest {
|
||||
fn default() -> &'a UpdateViewDataRequest {
|
||||
<UpdateViewDataRequest as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl UpdateViewDataRequest {
|
||||
pub fn new() -> UpdateViewDataRequest {
|
||||
::std::default::Default::default()
|
||||
}
|
||||
|
||||
// string view_id = 1;
|
||||
|
||||
|
||||
pub fn get_view_id(&self) -> &str {
|
||||
&self.view_id
|
||||
}
|
||||
pub fn clear_view_id(&mut self) {
|
||||
self.view_id.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_view_id(&mut self, v: ::std::string::String) {
|
||||
self.view_id = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.view_id
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_view_id(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.view_id, ::std::string::String::new())
|
||||
}
|
||||
|
||||
// string data = 2;
|
||||
|
||||
|
||||
pub fn get_data(&self) -> &str {
|
||||
&self.data
|
||||
}
|
||||
pub fn clear_data(&mut self) {
|
||||
self.data.clear();
|
||||
}
|
||||
|
||||
// Param is passed by value, moved
|
||||
pub fn set_data(&mut self, v: ::std::string::String) {
|
||||
self.data = v;
|
||||
}
|
||||
|
||||
// Mutable pointer to the field.
|
||||
// If field is not initialized, it is initialized with default value first.
|
||||
pub fn mut_data(&mut self) -> &mut ::std::string::String {
|
||||
&mut self.data
|
||||
}
|
||||
|
||||
// Take field
|
||||
pub fn take_data(&mut self) -> ::std::string::String {
|
||||
::std::mem::replace(&mut self.data, ::std::string::String::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for UpdateViewDataRequest {
|
||||
fn is_initialized(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
while !is.eof()? {
|
||||
let (field_number, wire_type) = is.read_tag_unpack()?;
|
||||
match field_number {
|
||||
1 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
|
||||
},
|
||||
2 => {
|
||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?;
|
||||
},
|
||||
_ => {
|
||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||
},
|
||||
};
|
||||
}
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
// Compute sizes of nested messages
|
||||
#[allow(unused_variables)]
|
||||
fn compute_size(&self) -> u32 {
|
||||
let mut my_size = 0;
|
||||
if !self.view_id.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(1, &self.view_id);
|
||||
}
|
||||
if !self.data.is_empty() {
|
||||
my_size += ::protobuf::rt::string_size(2, &self.data);
|
||||
}
|
||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||
self.cached_size.set(my_size);
|
||||
my_size
|
||||
}
|
||||
|
||||
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
|
||||
if !self.view_id.is_empty() {
|
||||
os.write_string(1, &self.view_id)?;
|
||||
}
|
||||
if !self.data.is_empty() {
|
||||
os.write_string(2, &self.data)?;
|
||||
}
|
||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||
::std::result::Result::Ok(())
|
||||
}
|
||||
|
||||
fn get_cached_size(&self) -> u32 {
|
||||
self.cached_size.get()
|
||||
}
|
||||
|
||||
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
|
||||
&self.unknown_fields
|
||||
}
|
||||
|
||||
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
|
||||
&mut self.unknown_fields
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn (::std::any::Any) {
|
||||
self as &dyn (::std::any::Any)
|
||||
}
|
||||
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
|
||||
self as &mut dyn (::std::any::Any)
|
||||
}
|
||||
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
|
||||
self
|
||||
}
|
||||
|
||||
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
Self::descriptor_static()
|
||||
}
|
||||
|
||||
fn new() -> UpdateViewDataRequest {
|
||||
UpdateViewDataRequest::new()
|
||||
}
|
||||
|
||||
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
|
||||
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
|
||||
descriptor.get(|| {
|
||||
let mut fields = ::std::vec::Vec::new();
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"view_id",
|
||||
|m: &UpdateViewDataRequest| { &m.view_id },
|
||||
|m: &mut UpdateViewDataRequest| { &mut m.view_id },
|
||||
));
|
||||
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
|
||||
"data",
|
||||
|m: &UpdateViewDataRequest| { &m.data },
|
||||
|m: &mut UpdateViewDataRequest| { &mut m.data },
|
||||
));
|
||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateViewDataRequest>(
|
||||
"UpdateViewDataRequest",
|
||||
fields,
|
||||
file_descriptor_proto()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn default_instance() -> &'static UpdateViewDataRequest {
|
||||
static instance: ::protobuf::rt::LazyV2<UpdateViewDataRequest> = ::protobuf::rt::LazyV2::INIT;
|
||||
instance.get(UpdateViewDataRequest::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Clear for UpdateViewDataRequest {
|
||||
fn clear(&mut self) {
|
||||
self.view_id.clear();
|
||||
self.data.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for UpdateViewDataRequest {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
||||
::protobuf::text_format::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for UpdateViewDataRequest {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
|
||||
::protobuf::reflect::ReflectValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\x11view_update.proto\"\xda\x01\n\x11UpdateViewRequest\x12\x17\n\x07vi\
|
||||
ew_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\x01(\t\
|
||||
@ -955,47 +1156,55 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\x03\x20\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\
|
||||
\x02R\tthumbnail\x12\x1b\n\x08is_trash\x18\x05\x20\x01(\x08H\x03R\x07isT\
|
||||
rashB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnailB\
|
||||
\x11\n\x0fone_of_is_trashJ\xc0\x06\n\x06\x12\x04\0\0\x0f\x01\n\x08\n\x01\
|
||||
\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x08\x01\n\n\n\x03\x04\
|
||||
\0\x01\x12\x03\x02\x08\x19\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x17\n\
|
||||
\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\
|
||||
\x12\x03\x03\x0b\x12\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x15\x16\n\
|
||||
\x0b\n\x04\x04\0\x08\0\x12\x03\x04\x04*\n\x0c\n\x05\x04\0\x08\0\x01\x12\
|
||||
\x03\x04\n\x15\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x18(\n\x0c\n\x05\
|
||||
\x04\0\x02\x01\x05\x12\x03\x04\x18\x1e\n\x0c\n\x05\x04\0\x02\x01\x01\x12\
|
||||
\x03\x04\x1f#\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04&'\n\x0b\n\x04\
|
||||
\x04\0\x08\x01\x12\x03\x05\x04*\n\x0c\n\x05\x04\0\x08\x01\x01\x12\x03\
|
||||
\x05\n\x15\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x18(\n\x0c\n\x05\x04\0\
|
||||
\x02\x02\x05\x12\x03\x05\x18\x1e\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\
|
||||
\x05\x1f#\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05&'\n\x0b\n\x04\x04\0\
|
||||
\x08\x02\x12\x03\x06\x044\n\x0c\n\x05\x04\0\x08\x02\x01\x12\x03\x06\n\
|
||||
\x1a\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x06\x1d2\n\x0c\n\x05\x04\0\x02\
|
||||
\x03\x05\x12\x03\x06\x1d#\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x06$-\n\
|
||||
\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x0601\n\x0b\n\x04\x04\0\x08\x03\x12\
|
||||
\x03\x07\x040\n\x0c\n\x05\x04\0\x08\x03\x01\x12\x03\x07\n\x19\n\x0b\n\
|
||||
\x04\x04\0\x02\x04\x12\x03\x07\x1c.\n\x0c\n\x05\x04\0\x02\x04\x05\x12\
|
||||
\x03\x07\x1c\x20\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x07!)\n\x0c\n\x05\
|
||||
\x04\0\x02\x04\x03\x12\x03\x07,-\n\n\n\x02\x04\x01\x12\x04\t\0\x0f\x01\n\
|
||||
\n\n\x03\x04\x01\x01\x12\x03\t\x08\x18\n\x0b\n\x04\x04\x01\x02\0\x12\x03\
|
||||
\n\x04\x17\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\n\x04\n\n\x0c\n\x05\x04\
|
||||
\x01\x02\0\x01\x12\x03\n\x0b\x12\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\n\
|
||||
\x15\x16\n\x0b\n\x04\x04\x01\x08\0\x12\x03\x0b\x04*\n\x0c\n\x05\x04\x01\
|
||||
\x08\0\x01\x12\x03\x0b\n\x15\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x0b\x18\
|
||||
(\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x0b\x18\x1e\n\x0c\n\x05\x04\
|
||||
\x01\x02\x01\x01\x12\x03\x0b\x1f#\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\
|
||||
\x03\x0b&'\n\x0b\n\x04\x04\x01\x08\x01\x12\x03\x0c\x04*\n\x0c\n\x05\x04\
|
||||
\x01\x08\x01\x01\x12\x03\x0c\n\x15\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\
|
||||
\x0c\x18(\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\x0c\x18\x1e\n\x0c\n\
|
||||
\x05\x04\x01\x02\x02\x01\x12\x03\x0c\x1f#\n\x0c\n\x05\x04\x01\x02\x02\
|
||||
\x03\x12\x03\x0c&'\n\x0b\n\x04\x04\x01\x08\x02\x12\x03\r\x044\n\x0c\n\
|
||||
\x05\x04\x01\x08\x02\x01\x12\x03\r\n\x1a\n\x0b\n\x04\x04\x01\x02\x03\x12\
|
||||
\x03\r\x1d2\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\x03\r\x1d#\n\x0c\n\x05\
|
||||
\x04\x01\x02\x03\x01\x12\x03\r$-\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03\
|
||||
\r01\n\x0b\n\x04\x04\x01\x08\x03\x12\x03\x0e\x040\n\x0c\n\x05\x04\x01\
|
||||
\x08\x03\x01\x12\x03\x0e\n\x19\n\x0b\n\x04\x04\x01\x02\x04\x12\x03\x0e\
|
||||
\x1c.\n\x0c\n\x05\x04\x01\x02\x04\x05\x12\x03\x0e\x1c\x20\n\x0c\n\x05\
|
||||
\x04\x01\x02\x04\x01\x12\x03\x0e!)\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\
|
||||
\x03\x0e,-b\x06proto3\
|
||||
\x11\n\x0fone_of_is_trash\"D\n\x15UpdateViewDataRequest\x12\x17\n\x07vie\
|
||||
w_id\x18\x01\x20\x01(\tR\x06viewId\x12\x12\n\x04data\x18\x02\x20\x01(\tR\
|
||||
\x04dataJ\xc6\x07\n\x06\x12\x04\0\0\x13\x01\n\x08\n\x01\x0c\x12\x03\0\0\
|
||||
\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x08\x01\n\n\n\x03\x04\0\x01\x12\x03\
|
||||
\x02\x08\x19\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x17\n\x0c\n\x05\x04\
|
||||
\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\
|
||||
\x0b\x12\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x15\x16\n\x0b\n\x04\x04\
|
||||
\0\x08\0\x12\x03\x04\x04*\n\x0c\n\x05\x04\0\x08\0\x01\x12\x03\x04\n\x15\
|
||||
\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x18(\n\x0c\n\x05\x04\0\x02\x01\
|
||||
\x05\x12\x03\x04\x18\x1e\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x1f#\
|
||||
\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04&'\n\x0b\n\x04\x04\0\x08\x01\
|
||||
\x12\x03\x05\x04*\n\x0c\n\x05\x04\0\x08\x01\x01\x12\x03\x05\n\x15\n\x0b\
|
||||
\n\x04\x04\0\x02\x02\x12\x03\x05\x18(\n\x0c\n\x05\x04\0\x02\x02\x05\x12\
|
||||
\x03\x05\x18\x1e\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x05\x1f#\n\x0c\n\
|
||||
\x05\x04\0\x02\x02\x03\x12\x03\x05&'\n\x0b\n\x04\x04\0\x08\x02\x12\x03\
|
||||
\x06\x044\n\x0c\n\x05\x04\0\x08\x02\x01\x12\x03\x06\n\x1a\n\x0b\n\x04\
|
||||
\x04\0\x02\x03\x12\x03\x06\x1d2\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\
|
||||
\x06\x1d#\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x06$-\n\x0c\n\x05\x04\0\
|
||||
\x02\x03\x03\x12\x03\x0601\n\x0b\n\x04\x04\0\x08\x03\x12\x03\x07\x040\n\
|
||||
\x0c\n\x05\x04\0\x08\x03\x01\x12\x03\x07\n\x19\n\x0b\n\x04\x04\0\x02\x04\
|
||||
\x12\x03\x07\x1c.\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\x07\x1c\x20\n\
|
||||
\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x07!)\n\x0c\n\x05\x04\0\x02\x04\x03\
|
||||
\x12\x03\x07,-\n\n\n\x02\x04\x01\x12\x04\t\0\x0f\x01\n\n\n\x03\x04\x01\
|
||||
\x01\x12\x03\t\x08\x18\n\x0b\n\x04\x04\x01\x02\0\x12\x03\n\x04\x17\n\x0c\
|
||||
\n\x05\x04\x01\x02\0\x05\x12\x03\n\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\
|
||||
\x12\x03\n\x0b\x12\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\n\x15\x16\n\x0b\
|
||||
\n\x04\x04\x01\x08\0\x12\x03\x0b\x04*\n\x0c\n\x05\x04\x01\x08\0\x01\x12\
|
||||
\x03\x0b\n\x15\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x0b\x18(\n\x0c\n\x05\
|
||||
\x04\x01\x02\x01\x05\x12\x03\x0b\x18\x1e\n\x0c\n\x05\x04\x01\x02\x01\x01\
|
||||
\x12\x03\x0b\x1f#\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x0b&'\n\x0b\n\
|
||||
\x04\x04\x01\x08\x01\x12\x03\x0c\x04*\n\x0c\n\x05\x04\x01\x08\x01\x01\
|
||||
\x12\x03\x0c\n\x15\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\x0c\x18(\n\x0c\n\
|
||||
\x05\x04\x01\x02\x02\x05\x12\x03\x0c\x18\x1e\n\x0c\n\x05\x04\x01\x02\x02\
|
||||
\x01\x12\x03\x0c\x1f#\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\x0c&'\n\
|
||||
\x0b\n\x04\x04\x01\x08\x02\x12\x03\r\x044\n\x0c\n\x05\x04\x01\x08\x02\
|
||||
\x01\x12\x03\r\n\x1a\n\x0b\n\x04\x04\x01\x02\x03\x12\x03\r\x1d2\n\x0c\n\
|
||||
\x05\x04\x01\x02\x03\x05\x12\x03\r\x1d#\n\x0c\n\x05\x04\x01\x02\x03\x01\
|
||||
\x12\x03\r$-\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03\r01\n\x0b\n\x04\x04\
|
||||
\x01\x08\x03\x12\x03\x0e\x040\n\x0c\n\x05\x04\x01\x08\x03\x01\x12\x03\
|
||||
\x0e\n\x19\n\x0b\n\x04\x04\x01\x02\x04\x12\x03\x0e\x1c.\n\x0c\n\x05\x04\
|
||||
\x01\x02\x04\x05\x12\x03\x0e\x1c\x20\n\x0c\n\x05\x04\x01\x02\x04\x01\x12\
|
||||
\x03\x0e!)\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03\x0e,-\n\n\n\x02\x04\
|
||||
\x02\x12\x04\x10\0\x13\x01\n\n\n\x03\x04\x02\x01\x12\x03\x10\x08\x1d\n\
|
||||
\x0b\n\x04\x04\x02\x02\0\x12\x03\x11\x04\x17\n\x0c\n\x05\x04\x02\x02\0\
|
||||
\x05\x12\x03\x11\x04\n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x11\x0b\x12\
|
||||
\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x11\x15\x16\n\x0b\n\x04\x04\x02\
|
||||
\x02\x01\x12\x03\x12\x04\x14\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x12\
|
||||
\x04\n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x12\x0b\x0f\n\x0c\n\x05\
|
||||
\x04\x02\x02\x01\x03\x12\x03\x12\x12\x13b\x06proto3\
|
||||
";
|
||||
|
||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||
|
@ -17,10 +17,8 @@ enum ErrorCode {
|
||||
ViewThumbnailInvalid = 21;
|
||||
ViewIdInvalid = 22;
|
||||
ViewDescInvalid = 23;
|
||||
DatabaseConnectionFail = 100;
|
||||
WorkspaceDatabaseError = 101;
|
||||
UserIdIsEmpty = 102;
|
||||
UserUnauthorized = 103;
|
||||
UserIdIsEmpty = 100;
|
||||
UserUnauthorized = 101;
|
||||
InternalError = 1000;
|
||||
RecordNotFound = 1001;
|
||||
}
|
||||
|
@ -15,4 +15,6 @@ enum WorkspaceEvent {
|
||||
ReadView = 202;
|
||||
UpdateView = 203;
|
||||
DeleteView = 204;
|
||||
OpenView = 205;
|
||||
UpdateViewData = 206;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ message CreateViewParams {
|
||||
string desc = 3;
|
||||
string thumbnail = 4;
|
||||
ViewType view_type = 5;
|
||||
string data = 6;
|
||||
}
|
||||
message View {
|
||||
string id = 1;
|
||||
|
@ -10,3 +10,6 @@ message QueryViewParams {
|
||||
bool is_trash = 2;
|
||||
bool read_belongings = 3;
|
||||
}
|
||||
message OpenViewRequest {
|
||||
string view_id = 1;
|
||||
}
|
||||
|
@ -14,3 +14,7 @@ message UpdateViewParams {
|
||||
oneof one_of_thumbnail { string thumbnail = 4; };
|
||||
oneof one_of_is_trash { bool is_trash = 5; };
|
||||
}
|
||||
message UpdateViewDataRequest {
|
||||
string view_id = 1;
|
||||
string data = 2;
|
||||
}
|
||||
|
@ -37,9 +37,9 @@ impl AppController {
|
||||
conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
let _ = self.sql.create_app(app_table, &*conn)?;
|
||||
let apps = self.read_local_apps(&app.workspace_id, &*conn)?;
|
||||
observable(&app.workspace_id, WorkspaceObservable::WorkspaceCreateApp)
|
||||
notify(&app.workspace_id, WorkspaceObservable::WorkspaceCreateApp)
|
||||
.payload(apps)
|
||||
.build();
|
||||
.send();
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
@ -49,7 +49,7 @@ impl AppController {
|
||||
pub(crate) async fn read_app(&self, params: QueryAppParams) -> Result<App, WorkspaceError> {
|
||||
let app_table = self
|
||||
.sql
|
||||
.read_app(¶ms.app_id, params.is_trash, &*self.database.db_connection()?)?;
|
||||
.read_app(¶ms.app_id, Some(params.is_trash), &*self.database.db_connection()?)?;
|
||||
let _ = self.read_app_on_server(params)?;
|
||||
Ok(app_table.into())
|
||||
}
|
||||
@ -59,9 +59,9 @@ impl AppController {
|
||||
conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
let app = self.sql.delete_app(app_id, &*conn)?;
|
||||
let apps = self.read_local_apps(&app.workspace_id, &*conn)?;
|
||||
observable(&app.workspace_id, WorkspaceObservable::WorkspaceDeleteApp)
|
||||
notify(&app.workspace_id, WorkspaceObservable::WorkspaceDeleteApp)
|
||||
.payload(apps)
|
||||
.build();
|
||||
.send();
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
@ -81,8 +81,8 @@ impl AppController {
|
||||
let conn = &*self.database.db_connection()?;
|
||||
conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
let _ = self.sql.update_app(changeset, conn)?;
|
||||
let app: App = self.sql.read_app(&app_id, false, conn)?.into();
|
||||
observable(&app_id, WorkspaceObservable::AppUpdated).payload(app).build();
|
||||
let app: App = self.sql.read_app(&app_id, None, conn)?.into();
|
||||
notify(&app_id, WorkspaceObservable::AppUpdated).payload(app).send();
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
|
@ -21,7 +21,7 @@ impl ResponseMiddleware for WorkspaceMiddleware {
|
||||
None => {},
|
||||
Some(token) => {
|
||||
let error = WorkspaceError::new(ErrorCode::UserUnauthorized, "");
|
||||
observable(token, WorkspaceObservable::UserUnauthorized).error(error).build()
|
||||
notify(token, WorkspaceObservable::UserUnauthorized).error(error).send()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::{
|
||||
entities::view::{CreateViewParams, UpdateViewParams, View},
|
||||
errors::WorkspaceError,
|
||||
module::WorkspaceDatabase,
|
||||
observable::observable,
|
||||
observable::notify,
|
||||
services::{helper::spawn, server::Server},
|
||||
sql_tables::view::{ViewTable, ViewTableChangeset, ViewTableSql},
|
||||
};
|
||||
@ -13,6 +13,10 @@ use crate::{
|
||||
observable::WorkspaceObservable,
|
||||
};
|
||||
use flowy_database::SqliteConnection;
|
||||
use flowy_document::{
|
||||
entities::doc::{CreateDocParams, Doc, QueryDocParams, UpdateDocParams},
|
||||
module::Document,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub(crate) struct ViewController {
|
||||
@ -20,30 +24,35 @@ pub(crate) struct ViewController {
|
||||
sql: Arc<ViewTableSql>,
|
||||
server: Server,
|
||||
database: Arc<dyn WorkspaceDatabase>,
|
||||
document: Arc<Document>,
|
||||
}
|
||||
|
||||
impl ViewController {
|
||||
pub(crate) fn new(user: Arc<dyn WorkspaceUser>, database: Arc<dyn WorkspaceDatabase>, server: Server) -> Self {
|
||||
pub(crate) fn new(user: Arc<dyn WorkspaceUser>, database: Arc<dyn WorkspaceDatabase>, server: Server, document: Arc<Document>) -> Self {
|
||||
let sql = Arc::new(ViewTableSql {});
|
||||
Self {
|
||||
user,
|
||||
sql,
|
||||
server,
|
||||
database,
|
||||
document,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn create_view(&self, params: CreateViewParams) -> Result<View, WorkspaceError> {
|
||||
let view = self.create_view_on_server(params).await?;
|
||||
let view = self.create_view_on_server(params.clone()).await?;
|
||||
let conn = &*self.database.db_connection()?;
|
||||
let view_table = ViewTable::new(view.clone());
|
||||
|
||||
// TODO: rollback anything created before if failed?
|
||||
conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
let _ = self.sql.create_view(view_table, conn)?;
|
||||
self.document.doc.create(CreateDocParams::new(&view.id, ¶ms.data), conn)?;
|
||||
|
||||
let repeated_view = self.read_local_views_belong_to(&view.belong_to_id, conn)?;
|
||||
observable(&view.belong_to_id, WorkspaceObservable::AppCreateView)
|
||||
notify(&view.belong_to_id, WorkspaceObservable::AppCreateView)
|
||||
.payload(repeated_view)
|
||||
.build();
|
||||
.send();
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
@ -58,20 +67,27 @@ impl ViewController {
|
||||
Ok(view)
|
||||
}
|
||||
|
||||
pub(crate) async fn delete_view(&self, view_id: &str) -> Result<(), WorkspaceError> {
|
||||
pub(crate) async fn open_view(&self, params: QueryDocParams) -> Result<Doc, WorkspaceError> {
|
||||
let conn = self.database.db_connection()?;
|
||||
let doc = self.document.doc.open(params, &*conn)?;
|
||||
Ok(doc)
|
||||
}
|
||||
|
||||
pub(crate) async fn delete_view(&self, params: DeleteViewParams) -> Result<(), WorkspaceError> {
|
||||
let conn = &*self.database.db_connection()?;
|
||||
let _ = self.delete_view_on_server(¶ms.view_id);
|
||||
|
||||
conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
let view_table = self.sql.delete_view(view_id, conn)?;
|
||||
let view_table = self.sql.delete_view(¶ms.view_id, conn)?;
|
||||
let _ = self.document.doc.delete(params.into(), conn)?;
|
||||
|
||||
let repeated_view = self.read_local_views_belong_to(&view_table.belong_to_id, conn)?;
|
||||
observable(&view_table.belong_to_id, WorkspaceObservable::AppDeleteView)
|
||||
notify(&view_table.belong_to_id, WorkspaceObservable::AppDeleteView)
|
||||
.payload(repeated_view)
|
||||
.build();
|
||||
.send();
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
let _ = self.delete_view_on_server(view_id);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -92,13 +108,19 @@ impl ViewController {
|
||||
conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
let _ = self.sql.update_view(changeset, conn)?;
|
||||
let view: View = self.sql.read_view(&view_id, None, conn)?.into();
|
||||
observable(&view_id, WorkspaceObservable::ViewUpdated).payload(view).build();
|
||||
notify(&view_id, WorkspaceObservable::ViewUpdated).payload(view).send();
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
let _ = self.update_view_on_server(params);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) async fn update_view_data(&self, params: UpdateDocParams) -> Result<(), WorkspaceError> {
|
||||
let conn = &*self.database.db_connection()?;
|
||||
let _ = self.document.doc.update(params, &*conn)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl ViewController {
|
||||
|
@ -68,9 +68,9 @@ impl WorkspaceController {
|
||||
conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
self.workspace_sql.create_workspace(workspace_table, conn)?;
|
||||
let repeated_workspace = self.read_local_workspaces(None, &user_id, conn)?;
|
||||
observable(&token, WorkspaceObservable::UserCreateWorkspace)
|
||||
notify(&token, WorkspaceObservable::UserCreateWorkspace)
|
||||
.payload(repeated_workspace)
|
||||
.build();
|
||||
.send();
|
||||
|
||||
Ok(())
|
||||
})?;
|
||||
@ -86,9 +86,9 @@ impl WorkspaceController {
|
||||
let _ = self.workspace_sql.update_workspace(changeset, conn)?;
|
||||
let user_id = self.user.user_id()?;
|
||||
let workspace = self.read_local_workspace(workspace_id.clone(), &user_id, conn)?;
|
||||
observable(&workspace_id, WorkspaceObservable::WorkspaceUpdated)
|
||||
notify(&workspace_id, WorkspaceObservable::WorkspaceUpdated)
|
||||
.payload(workspace)
|
||||
.build();
|
||||
.send();
|
||||
|
||||
Ok(())
|
||||
})?;
|
||||
@ -105,9 +105,9 @@ impl WorkspaceController {
|
||||
conn.immediate_transaction::<_, WorkspaceError, _>(|| {
|
||||
let _ = self.workspace_sql.delete_workspace(workspace_id, conn)?;
|
||||
let repeated_workspace = self.read_local_workspaces(None, &user_id, conn)?;
|
||||
observable(&token, WorkspaceObservable::UserDeleteWorkspace)
|
||||
notify(&token, WorkspaceObservable::UserDeleteWorkspace)
|
||||
.payload(repeated_workspace)
|
||||
.build();
|
||||
.send();
|
||||
|
||||
Ok(())
|
||||
})?;
|
||||
@ -287,9 +287,7 @@ impl WorkspaceController {
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
observable(&token, WorkspaceObservable::WorkspaceListUpdated)
|
||||
.payload(workspaces)
|
||||
.build();
|
||||
notify(&token, WorkspaceObservable::WorkspaceListUpdated).payload(workspaces).send();
|
||||
Result::<(), WorkspaceError>::Ok(())
|
||||
});
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user