mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: show plugin
This commit is contained in:
parent
8747457836
commit
b6de0caad6
@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart';
|
|||||||
|
|
||||||
export "./src/sandbox.dart";
|
export "./src/sandbox.dart";
|
||||||
|
|
||||||
typedef PluginType = String;
|
typedef PluginType = int;
|
||||||
|
|
||||||
typedef PluginDataType = ViewDataType;
|
typedef PluginDataType = ViewDataType;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ abstract class PluginBuilder {
|
|||||||
|
|
||||||
PluginType get pluginType;
|
PluginType get pluginType;
|
||||||
|
|
||||||
ViewDataType get dataType;
|
ViewDataType get dataType => ViewDataType.PlainText;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class PluginDisplay with NavigationItem {
|
abstract class PluginDisplay with NavigationItem {
|
||||||
@ -50,7 +50,7 @@ void registerPlugin({required PluginBuilder builder}) {
|
|||||||
getIt<PluginSandbox>().registerPlugin(builder.pluginType, builder);
|
getIt<PluginSandbox>().registerPlugin(builder.pluginType, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
Plugin makePlugin({required String pluginType, dynamic data}) {
|
Plugin makePlugin({required PluginType pluginType, dynamic data}) {
|
||||||
final plugin = getIt<PluginSandbox>().buildPlugin(pluginType, data);
|
final plugin = getIt<PluginSandbox>().buildPlugin(pluginType, data);
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,14 @@ import '../plugin.dart';
|
|||||||
import 'runner.dart';
|
import 'runner.dart';
|
||||||
|
|
||||||
class PluginSandbox {
|
class PluginSandbox {
|
||||||
final LinkedHashMap<String, PluginBuilder> _pluginMap = LinkedHashMap();
|
final LinkedHashMap<PluginType, PluginBuilder> _pluginMap = LinkedHashMap();
|
||||||
late PluginRunner pluginRunner;
|
late PluginRunner pluginRunner;
|
||||||
|
|
||||||
PluginSandbox() {
|
PluginSandbox() {
|
||||||
pluginRunner = PluginRunner();
|
pluginRunner = PluginRunner();
|
||||||
}
|
}
|
||||||
|
|
||||||
int indexOf(String pluginType) {
|
int indexOf(PluginType pluginType) {
|
||||||
final index = _pluginMap.keys.toList().indexWhere((ty) => ty == pluginType);
|
final index = _pluginMap.keys.toList().indexWhere((ty) => ty == pluginType);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
throw PlatformException(code: '-1', message: "Can't find the flowy plugin type: $pluginType");
|
throw PlatformException(code: '-1', message: "Can't find the flowy plugin type: $pluginType");
|
||||||
@ -21,20 +21,19 @@ class PluginSandbox {
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Plugin buildPlugin(String pluginType, dynamic data) {
|
Plugin buildPlugin(PluginType pluginType, dynamic data) {
|
||||||
final index = indexOf(pluginType);
|
final plugin = _pluginMap[pluginType]!.build(data);
|
||||||
final plugin = _pluginMap[index]!.build(data);
|
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
void registerPlugin(String pluginType, PluginBuilder builder) {
|
void registerPlugin(PluginType pluginType, PluginBuilder builder) {
|
||||||
if (_pluginMap.containsKey(pluginType)) {
|
if (_pluginMap.containsKey(pluginType)) {
|
||||||
throw PlatformException(code: '-1', message: "$pluginType was registered before");
|
throw PlatformException(code: '-1', message: "$pluginType was registered before");
|
||||||
}
|
}
|
||||||
_pluginMap[pluginType] = builder;
|
_pluginMap[pluginType] = builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> get supportPluginTypes => _pluginMap.keys.toList();
|
List<int> get supportPluginTypes => _pluginMap.keys.toList();
|
||||||
|
|
||||||
List<PluginBuilder> get builders => _pluginMap.values.toList();
|
List<PluginBuilder> get builders => _pluginMap.values.toList();
|
||||||
}
|
}
|
||||||
|
@ -4,24 +4,27 @@ import 'package:app_flowy/workspace/presentation/stack_page/blank/blank_page.dar
|
|||||||
import 'package:app_flowy/workspace/presentation/stack_page/doc/doc_stack_page.dart';
|
import 'package:app_flowy/workspace/presentation/stack_page/doc/doc_stack_page.dart';
|
||||||
import 'package:app_flowy/workspace/presentation/stack_page/trash/trash_page.dart';
|
import 'package:app_flowy/workspace/presentation/stack_page/trash/trash_page.dart';
|
||||||
|
|
||||||
enum DefaultPluginEnum {
|
enum DefaultPlugin {
|
||||||
|
quillEditor,
|
||||||
blank,
|
blank,
|
||||||
trash,
|
trash,
|
||||||
}
|
}
|
||||||
|
|
||||||
extension FlowyDefaultPluginExt on DefaultPluginEnum {
|
extension FlowyDefaultPluginExt on DefaultPlugin {
|
||||||
String type() {
|
int type() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case DefaultPluginEnum.blank:
|
case DefaultPlugin.quillEditor:
|
||||||
return "Blank";
|
return 0;
|
||||||
case DefaultPluginEnum.trash:
|
case DefaultPlugin.blank:
|
||||||
return "Trash";
|
return 1;
|
||||||
|
case DefaultPlugin.trash:
|
||||||
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isDefaultPlugin(String pluginType) {
|
bool isDefaultPlugin(PluginType pluginType) {
|
||||||
return DefaultPluginEnum.values.map((e) => e.type()).contains(pluginType);
|
return DefaultPlugin.values.map((e) => e.type()).contains(pluginType);
|
||||||
}
|
}
|
||||||
|
|
||||||
class PluginLoadTask extends LaunchTask {
|
class PluginLoadTask extends LaunchTask {
|
||||||
@ -30,10 +33,8 @@ class PluginLoadTask extends LaunchTask {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initialize(LaunchContext context) async {
|
Future<void> initialize(LaunchContext context) async {
|
||||||
registerPlugin(builder: DocumentPluginBuilder());
|
|
||||||
|
|
||||||
registerPlugin(builder: TrashPluginBuilder());
|
|
||||||
|
|
||||||
registerPlugin(builder: BlankPluginBuilder());
|
registerPlugin(builder: BlankPluginBuilder());
|
||||||
|
registerPlugin(builder: TrashPluginBuilder());
|
||||||
|
registerPlugin(builder: DocumentPluginBuilder());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ class AppearanceSettingModel extends ChangeNotifier with EquatableMixin {
|
|||||||
void setLocale(BuildContext context, Locale newLocale) {
|
void setLocale(BuildContext context, Locale newLocale) {
|
||||||
if (_locale != newLocale) {
|
if (_locale != newLocale) {
|
||||||
if (!context.supportedLocales.contains(newLocale)) {
|
if (!context.supportedLocales.contains(newLocale)) {
|
||||||
Log.error("Unsupported locale: $newLocale");
|
Log.warn("Unsupported locale: $newLocale");
|
||||||
newLocale = const Locale('en');
|
newLocale = const Locale('en');
|
||||||
Log.debug("Fallback to locale: $newLocale");
|
Log.debug("Fallback to locale: $newLocale");
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,6 @@ class MenuState with _$MenuState {
|
|||||||
isCollapse: false,
|
isCollapse: false,
|
||||||
apps: none(),
|
apps: none(),
|
||||||
successOrFailure: left(unit),
|
successOrFailure: left(unit),
|
||||||
plugin: makePlugin(pluginType: DefaultPluginEnum.blank.type()),
|
plugin: makePlugin(pluginType: DefaultPlugin.blank.type()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ class HomeStackNotifier extends ChangeNotifier {
|
|||||||
|
|
||||||
Widget get titleWidget => _plugin.display.leftBarItem;
|
Widget get titleWidget => _plugin.display.leftBarItem;
|
||||||
|
|
||||||
HomeStackNotifier({Plugin? plugin}) : _plugin = plugin ?? makePlugin(pluginType: DefaultPluginEnum.blank.type());
|
HomeStackNotifier({Plugin? plugin}) : _plugin = plugin ?? makePlugin(pluginType: DefaultPlugin.blank.type());
|
||||||
|
|
||||||
set plugin(Plugin newPlugin) {
|
set plugin(Plugin newPlugin) {
|
||||||
if (newPlugin.pluginId == _plugin.pluginId) {
|
if (newPlugin.pluginId == _plugin.pluginId) {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:app_flowy/plugin/plugin.dart';
|
||||||
import 'package:flowy_infra/image.dart';
|
import 'package:flowy_infra/image.dart';
|
||||||
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
|
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -41,4 +42,9 @@ extension ViewExtension on View {
|
|||||||
final Widget widget = svg(thumbnail, color: iconColor);
|
final Widget widget = svg(thumbnail, color: iconColor);
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Plugin plugin() {
|
||||||
|
final plugin = makePlugin(pluginType: pluginType, data: this);
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ import 'package:flowy_sdk/protobuf/flowy-folder-data-model/protobuf.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
import 'package:app_flowy/workspace/domain/view_ext.dart';
|
|
||||||
|
|
||||||
import 'home_layout.dart';
|
import 'home_layout.dart';
|
||||||
|
|
||||||
@ -110,7 +109,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
Widget _buildHomeMenu({required HomeLayout layout, required BuildContext context}) {
|
Widget _buildHomeMenu({required HomeLayout layout, required BuildContext context}) {
|
||||||
if (initialView == null && widget.workspaceSetting.hasLatestView()) {
|
if (initialView == null && widget.workspaceSetting.hasLatestView()) {
|
||||||
initialView = widget.workspaceSetting.latestView;
|
initialView = widget.workspaceSetting.latestView;
|
||||||
final plugin = makePlugin(pluginType: "RichText", data: initialView);
|
final plugin = makePlugin(pluginType: initialView!.pluginType, data: initialView);
|
||||||
getIt<HomeStackManager>().setPlugin(plugin);
|
getIt<HomeStackManager>().setPlugin(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
import 'package:app_flowy/startup/tasks/load_plugin.dart';
|
import 'package:app_flowy/startup/tasks/load_plugin.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
import 'package:flowy_infra_ui/style_widget/text.dart';
|
||||||
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pbenum.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:app_flowy/generated/locale_keys.g.dart';
|
import 'package:app_flowy/generated/locale_keys.g.dart';
|
||||||
import 'package:app_flowy/plugin/plugin.dart';
|
import 'package:app_flowy/plugin/plugin.dart';
|
||||||
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
|
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
|
||||||
|
|
||||||
class BlankPluginBuilder implements PluginBuilder {
|
class BlankPluginBuilder extends PluginBuilder {
|
||||||
@override
|
@override
|
||||||
Plugin build(dynamic data) {
|
Plugin build(dynamic data) {
|
||||||
return BlankPagePlugin(pluginType: pluginType);
|
return BlankPagePlugin(pluginType: pluginType);
|
||||||
@ -18,19 +17,14 @@ class BlankPluginBuilder implements PluginBuilder {
|
|||||||
String get pluginName => "Blank";
|
String get pluginName => "Blank";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
PluginType get pluginType => DefaultPluginEnum.blank.type();
|
PluginType get pluginType => DefaultPlugin.blank.type();
|
||||||
|
|
||||||
@override
|
|
||||||
ViewDataType get dataType => ViewDataType.PlainText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class BlankPagePlugin implements Plugin {
|
class BlankPagePlugin implements Plugin {
|
||||||
late PluginType _pluginType;
|
final PluginType _pluginType;
|
||||||
BlankPagePlugin({
|
BlankPagePlugin({
|
||||||
required String pluginType,
|
required PluginType pluginType,
|
||||||
}) {
|
}) : _pluginType = pluginType;
|
||||||
_pluginType = pluginType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {}
|
void dispose() {}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:app_flowy/plugin/plugin.dart';
|
import 'package:app_flowy/plugin/plugin.dart';
|
||||||
import 'package:app_flowy/startup/startup.dart';
|
import 'package:app_flowy/startup/startup.dart';
|
||||||
|
import 'package:app_flowy/startup/tasks/load_plugin.dart';
|
||||||
import 'package:app_flowy/workspace/application/appearance.dart';
|
import 'package:app_flowy/workspace/application/appearance.dart';
|
||||||
import 'package:app_flowy/workspace/application/doc/share_bloc.dart';
|
import 'package:app_flowy/workspace/application/doc/share_bloc.dart';
|
||||||
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
|
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
|
||||||
@ -38,7 +39,7 @@ class DocumentPluginBuilder implements PluginBuilder {
|
|||||||
String get pluginName => "Doc";
|
String get pluginName => "Doc";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
PluginType get pluginType => "RichText";
|
PluginType get pluginType => DefaultPlugin.quillEditor.type();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ViewDataType get dataType => ViewDataType.RichText;
|
ViewDataType get dataType => ViewDataType.RichText;
|
||||||
|
@ -14,7 +14,6 @@ import 'package:flowy_infra_ui/style_widget/scrolling/styled_scrollview.dart';
|
|||||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
import 'package:flowy_infra_ui/style_widget/text.dart';
|
||||||
import 'package:flowy_infra_ui/style_widget/button.dart';
|
import 'package:flowy_infra_ui/style_widget/button.dart';
|
||||||
import 'package:flowy_infra_ui/widget/spacing.dart';
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
||||||
import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pbenum.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
@ -22,7 +21,7 @@ import 'package:app_flowy/generated/locale_keys.g.dart';
|
|||||||
|
|
||||||
import 'widget/trash_header.dart';
|
import 'widget/trash_header.dart';
|
||||||
|
|
||||||
class TrashPluginBuilder implements PluginBuilder {
|
class TrashPluginBuilder extends PluginBuilder {
|
||||||
@override
|
@override
|
||||||
Plugin build(dynamic data) {
|
Plugin build(dynamic data) {
|
||||||
return TrashPlugin(pluginType: pluginType);
|
return TrashPlugin(pluginType: pluginType);
|
||||||
@ -32,18 +31,13 @@ class TrashPluginBuilder implements PluginBuilder {
|
|||||||
String get pluginName => "Trash";
|
String get pluginName => "Trash";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
PluginType get pluginType => DefaultPluginEnum.trash.type();
|
PluginType get pluginType => DefaultPlugin.trash.type();
|
||||||
|
|
||||||
@override
|
|
||||||
ViewDataType get dataType => ViewDataType.PlainText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class TrashPlugin implements Plugin {
|
class TrashPlugin implements Plugin {
|
||||||
late PluginType _pluginType;
|
final PluginType _pluginType;
|
||||||
|
|
||||||
TrashPlugin({required PluginType pluginType}) {
|
TrashPlugin({required PluginType pluginType}) : _pluginType = pluginType;
|
||||||
_pluginType = pluginType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {}
|
void dispose() {}
|
||||||
|
@ -106,7 +106,7 @@ class ViewSectionNotifier with ChangeNotifier {
|
|||||||
|
|
||||||
if (view != null) {
|
if (view != null) {
|
||||||
WidgetsBinding.instance?.addPostFrameCallback((_) {
|
WidgetsBinding.instance?.addPostFrameCallback((_) {
|
||||||
getIt<HomeStackManager>().setPlugin(view.stackContext());
|
getIt<HomeStackManager>().setPlugin(view.plugin());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@ -23,7 +23,7 @@ class MenuTrash extends StatelessWidget {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Provider.of<MenuSharedState>(context, listen: false).selectedView.value = null;
|
Provider.of<MenuSharedState>(context, listen: false).selectedView.value = null;
|
||||||
getIt<HomeStackManager>().setPlugin(makePlugin(pluginType: DefaultPluginEnum.trash.type()));
|
getIt<HomeStackManager>().setPlugin(makePlugin(pluginType: DefaultPlugin.trash.type()));
|
||||||
},
|
},
|
||||||
child: _render(context),
|
child: _render(context),
|
||||||
),
|
),
|
||||||
|
@ -27,6 +27,7 @@ class View extends $pb.GeneratedMessage {
|
|||||||
..aInt64(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'createTime')
|
..aInt64(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'createTime')
|
||||||
..aOS(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'extData')
|
..aOS(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'extData')
|
||||||
..aOS(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
..aOS(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
||||||
|
..a<$core.int>(12, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pluginType', $pb.PbFieldType.O3)
|
||||||
..hasRequiredFields = false
|
..hasRequiredFields = false
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -43,6 +44,7 @@ class View extends $pb.GeneratedMessage {
|
|||||||
$fixnum.Int64? createTime,
|
$fixnum.Int64? createTime,
|
||||||
$core.String? extData,
|
$core.String? extData,
|
||||||
$core.String? thumbnail,
|
$core.String? thumbnail,
|
||||||
|
$core.int? pluginType,
|
||||||
}) {
|
}) {
|
||||||
final _result = create();
|
final _result = create();
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
@ -78,6 +80,9 @@ class View extends $pb.GeneratedMessage {
|
|||||||
if (thumbnail != null) {
|
if (thumbnail != null) {
|
||||||
_result.thumbnail = thumbnail;
|
_result.thumbnail = thumbnail;
|
||||||
}
|
}
|
||||||
|
if (pluginType != null) {
|
||||||
|
_result.pluginType = pluginType;
|
||||||
|
}
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
factory View.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
factory View.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||||
@ -201,6 +206,15 @@ class View extends $pb.GeneratedMessage {
|
|||||||
$core.bool hasThumbnail() => $_has(10);
|
$core.bool hasThumbnail() => $_has(10);
|
||||||
@$pb.TagNumber(11)
|
@$pb.TagNumber(11)
|
||||||
void clearThumbnail() => clearField(11);
|
void clearThumbnail() => clearField(11);
|
||||||
|
|
||||||
|
@$pb.TagNumber(12)
|
||||||
|
$core.int get pluginType => $_getIZ(11);
|
||||||
|
@$pb.TagNumber(12)
|
||||||
|
set pluginType($core.int v) { $_setSignedInt32(11, v); }
|
||||||
|
@$pb.TagNumber(12)
|
||||||
|
$core.bool hasPluginType() => $_has(11);
|
||||||
|
@$pb.TagNumber(12)
|
||||||
|
void clearPluginType() => clearField(12);
|
||||||
}
|
}
|
||||||
|
|
||||||
class RepeatedView extends $pb.GeneratedMessage {
|
class RepeatedView extends $pb.GeneratedMessage {
|
||||||
@ -262,6 +276,7 @@ class CreateViewPayload extends $pb.GeneratedMessage {
|
|||||||
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'thumbnail')
|
||||||
..e<ViewDataType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dataType', $pb.PbFieldType.OE, defaultOrMaker: ViewDataType.RichText, valueOf: ViewDataType.valueOf, enumValues: ViewDataType.values)
|
..e<ViewDataType>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dataType', $pb.PbFieldType.OE, defaultOrMaker: ViewDataType.RichText, valueOf: ViewDataType.valueOf, enumValues: ViewDataType.values)
|
||||||
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'extData')
|
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'extData')
|
||||||
|
..a<$core.int>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pluginType', $pb.PbFieldType.O3)
|
||||||
..hasRequiredFields = false
|
..hasRequiredFields = false
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -273,6 +288,7 @@ class CreateViewPayload extends $pb.GeneratedMessage {
|
|||||||
$core.String? thumbnail,
|
$core.String? thumbnail,
|
||||||
ViewDataType? dataType,
|
ViewDataType? dataType,
|
||||||
$core.String? extData,
|
$core.String? extData,
|
||||||
|
$core.int? pluginType,
|
||||||
}) {
|
}) {
|
||||||
final _result = create();
|
final _result = create();
|
||||||
if (belongToId != null) {
|
if (belongToId != null) {
|
||||||
@ -293,6 +309,9 @@ class CreateViewPayload extends $pb.GeneratedMessage {
|
|||||||
if (extData != null) {
|
if (extData != null) {
|
||||||
_result.extData = extData;
|
_result.extData = extData;
|
||||||
}
|
}
|
||||||
|
if (pluginType != null) {
|
||||||
|
_result.pluginType = pluginType;
|
||||||
|
}
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
factory CreateViewPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
factory CreateViewPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||||
@ -372,6 +391,15 @@ class CreateViewPayload extends $pb.GeneratedMessage {
|
|||||||
$core.bool hasExtData() => $_has(5);
|
$core.bool hasExtData() => $_has(5);
|
||||||
@$pb.TagNumber(6)
|
@$pb.TagNumber(6)
|
||||||
void clearExtData() => clearField(6);
|
void clearExtData() => clearField(6);
|
||||||
|
|
||||||
|
@$pb.TagNumber(7)
|
||||||
|
$core.int get pluginType => $_getIZ(6);
|
||||||
|
@$pb.TagNumber(7)
|
||||||
|
set pluginType($core.int v) { $_setSignedInt32(6, v); }
|
||||||
|
@$pb.TagNumber(7)
|
||||||
|
$core.bool hasPluginType() => $_has(6);
|
||||||
|
@$pb.TagNumber(7)
|
||||||
|
void clearPluginType() => clearField(7);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CreateViewParams extends $pb.GeneratedMessage {
|
class CreateViewParams extends $pb.GeneratedMessage {
|
||||||
@ -384,6 +412,7 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
|||||||
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'extData')
|
..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'extData')
|
||||||
..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId')
|
..aOS(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId')
|
||||||
..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
..aOS(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data')
|
||||||
|
..a<$core.int>(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'pluginType', $pb.PbFieldType.O3)
|
||||||
..hasRequiredFields = false
|
..hasRequiredFields = false
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -397,6 +426,7 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
|||||||
$core.String? extData,
|
$core.String? extData,
|
||||||
$core.String? viewId,
|
$core.String? viewId,
|
||||||
$core.String? data,
|
$core.String? data,
|
||||||
|
$core.int? pluginType,
|
||||||
}) {
|
}) {
|
||||||
final _result = create();
|
final _result = create();
|
||||||
if (belongToId != null) {
|
if (belongToId != null) {
|
||||||
@ -423,6 +453,9 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
|||||||
if (data != null) {
|
if (data != null) {
|
||||||
_result.data = data;
|
_result.data = data;
|
||||||
}
|
}
|
||||||
|
if (pluginType != null) {
|
||||||
|
_result.pluginType = pluginType;
|
||||||
|
}
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
factory CreateViewParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
factory CreateViewParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
|
||||||
@ -517,6 +550,15 @@ class CreateViewParams extends $pb.GeneratedMessage {
|
|||||||
$core.bool hasData() => $_has(7);
|
$core.bool hasData() => $_has(7);
|
||||||
@$pb.TagNumber(8)
|
@$pb.TagNumber(8)
|
||||||
void clearData() => clearField(8);
|
void clearData() => clearField(8);
|
||||||
|
|
||||||
|
@$pb.TagNumber(9)
|
||||||
|
$core.int get pluginType => $_getIZ(8);
|
||||||
|
@$pb.TagNumber(9)
|
||||||
|
set pluginType($core.int v) { $_setSignedInt32(8, v); }
|
||||||
|
@$pb.TagNumber(9)
|
||||||
|
$core.bool hasPluginType() => $_has(8);
|
||||||
|
@$pb.TagNumber(9)
|
||||||
|
void clearPluginType() => clearField(9);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewId extends $pb.GeneratedMessage {
|
class ViewId extends $pb.GeneratedMessage {
|
||||||
|
@ -34,11 +34,12 @@ const View$json = const {
|
|||||||
const {'1': 'create_time', '3': 9, '4': 1, '5': 3, '10': 'createTime'},
|
const {'1': 'create_time', '3': 9, '4': 1, '5': 3, '10': 'createTime'},
|
||||||
const {'1': 'ext_data', '3': 10, '4': 1, '5': 9, '10': 'extData'},
|
const {'1': 'ext_data', '3': 10, '4': 1, '5': 9, '10': 'extData'},
|
||||||
const {'1': 'thumbnail', '3': 11, '4': 1, '5': 9, '10': 'thumbnail'},
|
const {'1': 'thumbnail', '3': 11, '4': 1, '5': 9, '10': 'thumbnail'},
|
||||||
|
const {'1': 'plugin_type', '3': 12, '4': 1, '5': 5, '10': 'pluginType'},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `View`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `View`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List viewDescriptor = $convert.base64Decode('CgRWaWV3Eg4KAmlkGAEgASgJUgJpZBIgCgxiZWxvbmdfdG9faWQYAiABKAlSCmJlbG9uZ1RvSWQSEgoEbmFtZRgDIAEoCVIEbmFtZRISCgRkZXNjGAQgASgJUgRkZXNjEioKCWRhdGFfdHlwZRgFIAEoDjINLlZpZXdEYXRhVHlwZVIIZGF0YVR5cGUSGAoHdmVyc2lvbhgGIAEoA1IHdmVyc2lvbhItCgpiZWxvbmdpbmdzGAcgASgLMg0uUmVwZWF0ZWRWaWV3UgpiZWxvbmdpbmdzEiMKDW1vZGlmaWVkX3RpbWUYCCABKANSDG1vZGlmaWVkVGltZRIfCgtjcmVhdGVfdGltZRgJIAEoA1IKY3JlYXRlVGltZRIZCghleHRfZGF0YRgKIAEoCVIHZXh0RGF0YRIcCgl0aHVtYm5haWwYCyABKAlSCXRodW1ibmFpbA==');
|
final $typed_data.Uint8List viewDescriptor = $convert.base64Decode('CgRWaWV3Eg4KAmlkGAEgASgJUgJpZBIgCgxiZWxvbmdfdG9faWQYAiABKAlSCmJlbG9uZ1RvSWQSEgoEbmFtZRgDIAEoCVIEbmFtZRISCgRkZXNjGAQgASgJUgRkZXNjEioKCWRhdGFfdHlwZRgFIAEoDjINLlZpZXdEYXRhVHlwZVIIZGF0YVR5cGUSGAoHdmVyc2lvbhgGIAEoA1IHdmVyc2lvbhItCgpiZWxvbmdpbmdzGAcgASgLMg0uUmVwZWF0ZWRWaWV3UgpiZWxvbmdpbmdzEiMKDW1vZGlmaWVkX3RpbWUYCCABKANSDG1vZGlmaWVkVGltZRIfCgtjcmVhdGVfdGltZRgJIAEoA1IKY3JlYXRlVGltZRIZCghleHRfZGF0YRgKIAEoCVIHZXh0RGF0YRIcCgl0aHVtYm5haWwYCyABKAlSCXRodW1ibmFpbBIfCgtwbHVnaW5fdHlwZRgMIAEoBVIKcGx1Z2luVHlwZQ==');
|
||||||
@$core.Deprecated('Use repeatedViewDescriptor instead')
|
@$core.Deprecated('Use repeatedViewDescriptor instead')
|
||||||
const RepeatedView$json = const {
|
const RepeatedView$json = const {
|
||||||
'1': 'RepeatedView',
|
'1': 'RepeatedView',
|
||||||
@ -59,6 +60,7 @@ const CreateViewPayload$json = const {
|
|||||||
const {'1': 'thumbnail', '3': 4, '4': 1, '5': 9, '9': 0, '10': 'thumbnail'},
|
const {'1': 'thumbnail', '3': 4, '4': 1, '5': 9, '9': 0, '10': 'thumbnail'},
|
||||||
const {'1': 'data_type', '3': 5, '4': 1, '5': 14, '6': '.ViewDataType', '10': 'dataType'},
|
const {'1': 'data_type', '3': 5, '4': 1, '5': 14, '6': '.ViewDataType', '10': 'dataType'},
|
||||||
const {'1': 'ext_data', '3': 6, '4': 1, '5': 9, '10': 'extData'},
|
const {'1': 'ext_data', '3': 6, '4': 1, '5': 9, '10': 'extData'},
|
||||||
|
const {'1': 'plugin_type', '3': 7, '4': 1, '5': 5, '10': 'pluginType'},
|
||||||
],
|
],
|
||||||
'8': const [
|
'8': const [
|
||||||
const {'1': 'one_of_thumbnail'},
|
const {'1': 'one_of_thumbnail'},
|
||||||
@ -66,7 +68,7 @@ const CreateViewPayload$json = const {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `CreateViewPayload`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `CreateViewPayload`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List createViewPayloadDescriptor = $convert.base64Decode('ChFDcmVhdGVWaWV3UGF5bG9hZBIgCgxiZWxvbmdfdG9faWQYASABKAlSCmJlbG9uZ1RvSWQSEgoEbmFtZRgCIAEoCVIEbmFtZRISCgRkZXNjGAMgASgJUgRkZXNjEh4KCXRodW1ibmFpbBgEIAEoCUgAUgl0aHVtYm5haWwSKgoJZGF0YV90eXBlGAUgASgOMg0uVmlld0RhdGFUeXBlUghkYXRhVHlwZRIZCghleHRfZGF0YRgGIAEoCVIHZXh0RGF0YUISChBvbmVfb2ZfdGh1bWJuYWls');
|
final $typed_data.Uint8List createViewPayloadDescriptor = $convert.base64Decode('ChFDcmVhdGVWaWV3UGF5bG9hZBIgCgxiZWxvbmdfdG9faWQYASABKAlSCmJlbG9uZ1RvSWQSEgoEbmFtZRgCIAEoCVIEbmFtZRISCgRkZXNjGAMgASgJUgRkZXNjEh4KCXRodW1ibmFpbBgEIAEoCUgAUgl0aHVtYm5haWwSKgoJZGF0YV90eXBlGAUgASgOMg0uVmlld0RhdGFUeXBlUghkYXRhVHlwZRIZCghleHRfZGF0YRgGIAEoCVIHZXh0RGF0YRIfCgtwbHVnaW5fdHlwZRgHIAEoBVIKcGx1Z2luVHlwZUISChBvbmVfb2ZfdGh1bWJuYWls');
|
||||||
@$core.Deprecated('Use createViewParamsDescriptor instead')
|
@$core.Deprecated('Use createViewParamsDescriptor instead')
|
||||||
const CreateViewParams$json = const {
|
const CreateViewParams$json = const {
|
||||||
'1': 'CreateViewParams',
|
'1': 'CreateViewParams',
|
||||||
@ -79,11 +81,12 @@ const CreateViewParams$json = const {
|
|||||||
const {'1': 'ext_data', '3': 6, '4': 1, '5': 9, '10': 'extData'},
|
const {'1': 'ext_data', '3': 6, '4': 1, '5': 9, '10': 'extData'},
|
||||||
const {'1': 'view_id', '3': 7, '4': 1, '5': 9, '10': 'viewId'},
|
const {'1': 'view_id', '3': 7, '4': 1, '5': 9, '10': 'viewId'},
|
||||||
const {'1': 'data', '3': 8, '4': 1, '5': 9, '10': 'data'},
|
const {'1': 'data', '3': 8, '4': 1, '5': 9, '10': 'data'},
|
||||||
|
const {'1': 'plugin_type', '3': 9, '4': 1, '5': 5, '10': 'pluginType'},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Descriptor for `CreateViewParams`. Decode as a `google.protobuf.DescriptorProto`.
|
/// Descriptor for `CreateViewParams`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
final $typed_data.Uint8List createViewParamsDescriptor = $convert.base64Decode('ChBDcmVhdGVWaWV3UGFyYW1zEiAKDGJlbG9uZ190b19pZBgBIAEoCVIKYmVsb25nVG9JZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2MSHAoJdGh1bWJuYWlsGAQgASgJUgl0aHVtYm5haWwSKgoJZGF0YV90eXBlGAUgASgOMg0uVmlld0RhdGFUeXBlUghkYXRhVHlwZRIZCghleHRfZGF0YRgGIAEoCVIHZXh0RGF0YRIXCgd2aWV3X2lkGAcgASgJUgZ2aWV3SWQSEgoEZGF0YRgIIAEoCVIEZGF0YQ==');
|
final $typed_data.Uint8List createViewParamsDescriptor = $convert.base64Decode('ChBDcmVhdGVWaWV3UGFyYW1zEiAKDGJlbG9uZ190b19pZBgBIAEoCVIKYmVsb25nVG9JZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2MSHAoJdGh1bWJuYWlsGAQgASgJUgl0aHVtYm5haWwSKgoJZGF0YV90eXBlGAUgASgOMg0uVmlld0RhdGFUeXBlUghkYXRhVHlwZRIZCghleHRfZGF0YRgGIAEoCVIHZXh0RGF0YRIXCgd2aWV3X2lkGAcgASgJUgZ2aWV3SWQSEgoEZGF0YRgIIAEoCVIEZGF0YRIfCgtwbHVnaW5fdHlwZRgJIAEoBVIKcGx1Z2luVHlwZQ==');
|
||||||
@$core.Deprecated('Use viewIdDescriptor instead')
|
@$core.Deprecated('Use viewIdDescriptor instead')
|
||||||
const ViewId$json = const {
|
const ViewId$json = const {
|
||||||
'1': 'ViewId',
|
'1': 'ViewId',
|
||||||
|
@ -65,49 +65,6 @@ impl ViewTableSql {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub(crate) fn read_views(
|
|
||||||
// belong_to_id: &str,
|
|
||||||
// is_trash: Option<bool>,
|
|
||||||
// conn: &SqliteConnection,
|
|
||||||
// ) -> Result<RepeatedView, FlowyError> {
|
|
||||||
// let views = dsl::view_table
|
|
||||||
// .inner_join(trash_table::dsl::trash_table.on(trash_id.ne(view_table::
|
|
||||||
// id))) .filter(view_table::belong_to_id.eq(belong_to_id))
|
|
||||||
// .select((
|
|
||||||
// view_table::id,
|
|
||||||
// view_table::belong_to_id,
|
|
||||||
// view_table::name,
|
|
||||||
// view_table::desc,
|
|
||||||
// view_table::modified_time,
|
|
||||||
// view_table::create_time,
|
|
||||||
// view_table::thumbnail,
|
|
||||||
// view_table::view_type,
|
|
||||||
// view_table::version,
|
|
||||||
// ))
|
|
||||||
// .load(conn)?
|
|
||||||
// .into_iter()
|
|
||||||
// .map(
|
|
||||||
// |(id, belong_to_id, name, desc, create_time, modified_time,
|
|
||||||
// thumbnail, view_type, version)| { ViewTable {
|
|
||||||
// id,
|
|
||||||
// belong_to_id,
|
|
||||||
// name,
|
|
||||||
// desc,
|
|
||||||
// modified_time,
|
|
||||||
// create_time,
|
|
||||||
// thumbnail,
|
|
||||||
// view_type,
|
|
||||||
// version,
|
|
||||||
// is_trash: false,
|
|
||||||
// }
|
|
||||||
// .into()
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// .collect::<Vec<View>>();
|
|
||||||
//
|
|
||||||
// Ok(RepeatedView { items: views })
|
|
||||||
// }
|
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Debug, Queryable, Identifiable, Insertable, Associations)]
|
#[derive(PartialEq, Clone, Debug, Queryable, Identifiable, Insertable, Associations)]
|
||||||
#[belongs_to(AppTable, foreign_key = "belong_to_id")]
|
#[belongs_to(AppTable, foreign_key = "belong_to_id")]
|
||||||
#[table_name = "view_table"]
|
#[table_name = "view_table"]
|
||||||
@ -165,6 +122,9 @@ impl std::convert::From<ViewTable> for View {
|
|||||||
create_time: table.create_time,
|
create_time: table.create_time,
|
||||||
ext_data: "".to_string(),
|
ext_data: "".to_string(),
|
||||||
thumbnail: table.thumbnail,
|
thumbnail: table.thumbnail,
|
||||||
|
// Store the view in ViewTable was deprecated since v0.0.2.
|
||||||
|
// No need worry about plugin_type.
|
||||||
|
plugin_type: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -178,6 +178,7 @@ impl ViewController {
|
|||||||
data: document_json,
|
data: document_json,
|
||||||
view_id: uuid_string(),
|
view_id: uuid_string(),
|
||||||
ext_data: view.ext_data,
|
ext_data: view.ext_data,
|
||||||
|
plugin_type: view.plugin_type,
|
||||||
};
|
};
|
||||||
|
|
||||||
let _ = self.create_view_from_params(duplicate_params).await?;
|
let _ = self.create_view_from_params(duplicate_params).await?;
|
||||||
|
@ -307,6 +307,7 @@ impl FolderCouldServiceV1 for LocalServer {
|
|||||||
create_time: time,
|
create_time: time,
|
||||||
ext_data: params.ext_data,
|
ext_data: params.ext_data,
|
||||||
thumbnail: params.thumbnail,
|
thumbnail: params.thumbnail,
|
||||||
|
plugin_type: params.plugin_type,
|
||||||
};
|
};
|
||||||
FutureResult::new(async { Ok(view) })
|
FutureResult::new(async { Ok(view) })
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,14 @@ pub struct View {
|
|||||||
|
|
||||||
#[pb(index = 11)]
|
#[pb(index = 11)]
|
||||||
pub thumbnail: String,
|
pub thumbnail: String,
|
||||||
|
|
||||||
|
#[pb(index = 12)]
|
||||||
|
#[serde(default = "default_plugin_type")]
|
||||||
|
pub plugin_type: i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn default_plugin_type() -> i32 {
|
||||||
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Eq, PartialEq, Debug, Default, ProtoBuf, Clone, Serialize, Deserialize)]
|
#[derive(Eq, PartialEq, Debug, Default, ProtoBuf, Clone, Serialize, Deserialize)]
|
||||||
@ -115,6 +123,9 @@ pub struct CreateViewPayload {
|
|||||||
|
|
||||||
#[pb(index = 6)]
|
#[pb(index = 6)]
|
||||||
pub ext_data: String,
|
pub ext_data: String,
|
||||||
|
|
||||||
|
#[pb(index = 7)]
|
||||||
|
pub plugin_type: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, ProtoBuf, Debug, Clone)]
|
#[derive(Default, ProtoBuf, Debug, Clone)]
|
||||||
@ -142,6 +153,9 @@ pub struct CreateViewParams {
|
|||||||
|
|
||||||
#[pb(index = 8)]
|
#[pb(index = 8)]
|
||||||
pub data: String,
|
pub data: String,
|
||||||
|
|
||||||
|
#[pb(index = 9)]
|
||||||
|
pub plugin_type: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryInto<CreateViewParams> for CreateViewPayload {
|
impl TryInto<CreateViewParams> for CreateViewPayload {
|
||||||
@ -156,6 +170,7 @@ impl TryInto<CreateViewParams> for CreateViewPayload {
|
|||||||
None => "".to_string(),
|
None => "".to_string(),
|
||||||
Some(thumbnail) => ViewThumbnail::parse(thumbnail)?.0,
|
Some(thumbnail) => ViewThumbnail::parse(thumbnail)?.0,
|
||||||
};
|
};
|
||||||
|
let data = "".to_string();
|
||||||
|
|
||||||
Ok(CreateViewParams {
|
Ok(CreateViewParams {
|
||||||
belong_to_id,
|
belong_to_id,
|
||||||
@ -165,7 +180,8 @@ impl TryInto<CreateViewParams> for CreateViewPayload {
|
|||||||
thumbnail,
|
thumbnail,
|
||||||
ext_data,
|
ext_data,
|
||||||
view_id,
|
view_id,
|
||||||
data: "".to_string(),
|
data,
|
||||||
|
plugin_type: self.plugin_type,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ pub struct View {
|
|||||||
pub create_time: i64,
|
pub create_time: i64,
|
||||||
pub ext_data: ::std::string::String,
|
pub ext_data: ::std::string::String,
|
||||||
pub thumbnail: ::std::string::String,
|
pub thumbnail: ::std::string::String,
|
||||||
|
pub plugin_type: i32,
|
||||||
// special fields
|
// special fields
|
||||||
pub unknown_fields: ::protobuf::UnknownFields,
|
pub unknown_fields: ::protobuf::UnknownFields,
|
||||||
pub cached_size: ::protobuf::CachedSize,
|
pub cached_size: ::protobuf::CachedSize,
|
||||||
@ -301,6 +302,21 @@ impl View {
|
|||||||
pub fn take_thumbnail(&mut self) -> ::std::string::String {
|
pub fn take_thumbnail(&mut self) -> ::std::string::String {
|
||||||
::std::mem::replace(&mut self.thumbnail, ::std::string::String::new())
|
::std::mem::replace(&mut self.thumbnail, ::std::string::String::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// int32 plugin_type = 12;
|
||||||
|
|
||||||
|
|
||||||
|
pub fn get_plugin_type(&self) -> i32 {
|
||||||
|
self.plugin_type
|
||||||
|
}
|
||||||
|
pub fn clear_plugin_type(&mut self) {
|
||||||
|
self.plugin_type = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_plugin_type(&mut self, v: i32) {
|
||||||
|
self.plugin_type = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::protobuf::Message for View {
|
impl ::protobuf::Message for View {
|
||||||
@ -362,6 +378,13 @@ impl ::protobuf::Message for View {
|
|||||||
11 => {
|
11 => {
|
||||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.thumbnail)?;
|
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.thumbnail)?;
|
||||||
},
|
},
|
||||||
|
12 => {
|
||||||
|
if wire_type != ::protobuf::wire_format::WireTypeVarint {
|
||||||
|
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||||
|
}
|
||||||
|
let tmp = is.read_int32()?;
|
||||||
|
self.plugin_type = tmp;
|
||||||
|
},
|
||||||
_ => {
|
_ => {
|
||||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||||
},
|
},
|
||||||
@ -408,6 +431,9 @@ impl ::protobuf::Message for View {
|
|||||||
if !self.thumbnail.is_empty() {
|
if !self.thumbnail.is_empty() {
|
||||||
my_size += ::protobuf::rt::string_size(11, &self.thumbnail);
|
my_size += ::protobuf::rt::string_size(11, &self.thumbnail);
|
||||||
}
|
}
|
||||||
|
if self.plugin_type != 0 {
|
||||||
|
my_size += ::protobuf::rt::value_size(12, self.plugin_type, ::protobuf::wire_format::WireTypeVarint);
|
||||||
|
}
|
||||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||||
self.cached_size.set(my_size);
|
self.cached_size.set(my_size);
|
||||||
my_size
|
my_size
|
||||||
@ -449,6 +475,9 @@ impl ::protobuf::Message for View {
|
|||||||
if !self.thumbnail.is_empty() {
|
if !self.thumbnail.is_empty() {
|
||||||
os.write_string(11, &self.thumbnail)?;
|
os.write_string(11, &self.thumbnail)?;
|
||||||
}
|
}
|
||||||
|
if self.plugin_type != 0 {
|
||||||
|
os.write_int32(12, self.plugin_type)?;
|
||||||
|
}
|
||||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||||
::std::result::Result::Ok(())
|
::std::result::Result::Ok(())
|
||||||
}
|
}
|
||||||
@ -542,6 +571,11 @@ impl ::protobuf::Message for View {
|
|||||||
|m: &View| { &m.thumbnail },
|
|m: &View| { &m.thumbnail },
|
||||||
|m: &mut View| { &mut m.thumbnail },
|
|m: &mut View| { &mut m.thumbnail },
|
||||||
));
|
));
|
||||||
|
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
|
||||||
|
"plugin_type",
|
||||||
|
|m: &View| { &m.plugin_type },
|
||||||
|
|m: &mut View| { &mut m.plugin_type },
|
||||||
|
));
|
||||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<View>(
|
::protobuf::reflect::MessageDescriptor::new_pb_name::<View>(
|
||||||
"View",
|
"View",
|
||||||
fields,
|
fields,
|
||||||
@ -569,6 +603,7 @@ impl ::protobuf::Clear for View {
|
|||||||
self.create_time = 0;
|
self.create_time = 0;
|
||||||
self.ext_data.clear();
|
self.ext_data.clear();
|
||||||
self.thumbnail.clear();
|
self.thumbnail.clear();
|
||||||
|
self.plugin_type = 0;
|
||||||
self.unknown_fields.clear();
|
self.unknown_fields.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -759,6 +794,7 @@ pub struct CreateViewPayload {
|
|||||||
pub desc: ::std::string::String,
|
pub desc: ::std::string::String,
|
||||||
pub data_type: ViewDataType,
|
pub data_type: ViewDataType,
|
||||||
pub ext_data: ::std::string::String,
|
pub ext_data: ::std::string::String,
|
||||||
|
pub plugin_type: i32,
|
||||||
// message oneof groups
|
// message oneof groups
|
||||||
pub one_of_thumbnail: ::std::option::Option<CreateViewPayload_oneof_one_of_thumbnail>,
|
pub one_of_thumbnail: ::std::option::Option<CreateViewPayload_oneof_one_of_thumbnail>,
|
||||||
// special fields
|
// special fields
|
||||||
@ -949,6 +985,21 @@ impl CreateViewPayload {
|
|||||||
pub fn take_ext_data(&mut self) -> ::std::string::String {
|
pub fn take_ext_data(&mut self) -> ::std::string::String {
|
||||||
::std::mem::replace(&mut self.ext_data, ::std::string::String::new())
|
::std::mem::replace(&mut self.ext_data, ::std::string::String::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// int32 plugin_type = 7;
|
||||||
|
|
||||||
|
|
||||||
|
pub fn get_plugin_type(&self) -> i32 {
|
||||||
|
self.plugin_type
|
||||||
|
}
|
||||||
|
pub fn clear_plugin_type(&mut self) {
|
||||||
|
self.plugin_type = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_plugin_type(&mut self, v: i32) {
|
||||||
|
self.plugin_type = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::protobuf::Message for CreateViewPayload {
|
impl ::protobuf::Message for CreateViewPayload {
|
||||||
@ -981,6 +1032,13 @@ impl ::protobuf::Message for CreateViewPayload {
|
|||||||
6 => {
|
6 => {
|
||||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.ext_data)?;
|
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.ext_data)?;
|
||||||
},
|
},
|
||||||
|
7 => {
|
||||||
|
if wire_type != ::protobuf::wire_format::WireTypeVarint {
|
||||||
|
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||||
|
}
|
||||||
|
let tmp = is.read_int32()?;
|
||||||
|
self.plugin_type = tmp;
|
||||||
|
},
|
||||||
_ => {
|
_ => {
|
||||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||||
},
|
},
|
||||||
@ -1008,6 +1066,9 @@ impl ::protobuf::Message for CreateViewPayload {
|
|||||||
if !self.ext_data.is_empty() {
|
if !self.ext_data.is_empty() {
|
||||||
my_size += ::protobuf::rt::string_size(6, &self.ext_data);
|
my_size += ::protobuf::rt::string_size(6, &self.ext_data);
|
||||||
}
|
}
|
||||||
|
if self.plugin_type != 0 {
|
||||||
|
my_size += ::protobuf::rt::value_size(7, self.plugin_type, ::protobuf::wire_format::WireTypeVarint);
|
||||||
|
}
|
||||||
if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
|
if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
|
||||||
match v {
|
match v {
|
||||||
&CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
|
&CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
|
||||||
@ -1036,6 +1097,9 @@ impl ::protobuf::Message for CreateViewPayload {
|
|||||||
if !self.ext_data.is_empty() {
|
if !self.ext_data.is_empty() {
|
||||||
os.write_string(6, &self.ext_data)?;
|
os.write_string(6, &self.ext_data)?;
|
||||||
}
|
}
|
||||||
|
if self.plugin_type != 0 {
|
||||||
|
os.write_int32(7, self.plugin_type)?;
|
||||||
|
}
|
||||||
if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
|
if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
|
||||||
match v {
|
match v {
|
||||||
&CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
|
&CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
|
||||||
@ -1111,6 +1175,11 @@ impl ::protobuf::Message for CreateViewPayload {
|
|||||||
|m: &CreateViewPayload| { &m.ext_data },
|
|m: &CreateViewPayload| { &m.ext_data },
|
||||||
|m: &mut CreateViewPayload| { &mut m.ext_data },
|
|m: &mut CreateViewPayload| { &mut m.ext_data },
|
||||||
));
|
));
|
||||||
|
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
|
||||||
|
"plugin_type",
|
||||||
|
|m: &CreateViewPayload| { &m.plugin_type },
|
||||||
|
|m: &mut CreateViewPayload| { &mut m.plugin_type },
|
||||||
|
));
|
||||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewPayload>(
|
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewPayload>(
|
||||||
"CreateViewPayload",
|
"CreateViewPayload",
|
||||||
fields,
|
fields,
|
||||||
@ -1133,6 +1202,7 @@ impl ::protobuf::Clear for CreateViewPayload {
|
|||||||
self.one_of_thumbnail = ::std::option::Option::None;
|
self.one_of_thumbnail = ::std::option::Option::None;
|
||||||
self.data_type = ViewDataType::RichText;
|
self.data_type = ViewDataType::RichText;
|
||||||
self.ext_data.clear();
|
self.ext_data.clear();
|
||||||
|
self.plugin_type = 0;
|
||||||
self.unknown_fields.clear();
|
self.unknown_fields.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1160,6 +1230,7 @@ pub struct CreateViewParams {
|
|||||||
pub ext_data: ::std::string::String,
|
pub ext_data: ::std::string::String,
|
||||||
pub view_id: ::std::string::String,
|
pub view_id: ::std::string::String,
|
||||||
pub data: ::std::string::String,
|
pub data: ::std::string::String,
|
||||||
|
pub plugin_type: i32,
|
||||||
// special fields
|
// special fields
|
||||||
pub unknown_fields: ::protobuf::UnknownFields,
|
pub unknown_fields: ::protobuf::UnknownFields,
|
||||||
pub cached_size: ::protobuf::CachedSize,
|
pub cached_size: ::protobuf::CachedSize,
|
||||||
@ -1372,6 +1443,21 @@ impl CreateViewParams {
|
|||||||
pub fn take_data(&mut self) -> ::std::string::String {
|
pub fn take_data(&mut self) -> ::std::string::String {
|
||||||
::std::mem::replace(&mut self.data, ::std::string::String::new())
|
::std::mem::replace(&mut self.data, ::std::string::String::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// int32 plugin_type = 9;
|
||||||
|
|
||||||
|
|
||||||
|
pub fn get_plugin_type(&self) -> i32 {
|
||||||
|
self.plugin_type
|
||||||
|
}
|
||||||
|
pub fn clear_plugin_type(&mut self) {
|
||||||
|
self.plugin_type = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Param is passed by value, moved
|
||||||
|
pub fn set_plugin_type(&mut self, v: i32) {
|
||||||
|
self.plugin_type = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::protobuf::Message for CreateViewParams {
|
impl ::protobuf::Message for CreateViewParams {
|
||||||
@ -1407,6 +1493,13 @@ impl ::protobuf::Message for CreateViewParams {
|
|||||||
8 => {
|
8 => {
|
||||||
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?;
|
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.data)?;
|
||||||
},
|
},
|
||||||
|
9 => {
|
||||||
|
if wire_type != ::protobuf::wire_format::WireTypeVarint {
|
||||||
|
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
|
||||||
|
}
|
||||||
|
let tmp = is.read_int32()?;
|
||||||
|
self.plugin_type = tmp;
|
||||||
|
},
|
||||||
_ => {
|
_ => {
|
||||||
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
|
||||||
},
|
},
|
||||||
@ -1443,6 +1536,9 @@ impl ::protobuf::Message for CreateViewParams {
|
|||||||
if !self.data.is_empty() {
|
if !self.data.is_empty() {
|
||||||
my_size += ::protobuf::rt::string_size(8, &self.data);
|
my_size += ::protobuf::rt::string_size(8, &self.data);
|
||||||
}
|
}
|
||||||
|
if self.plugin_type != 0 {
|
||||||
|
my_size += ::protobuf::rt::value_size(9, self.plugin_type, ::protobuf::wire_format::WireTypeVarint);
|
||||||
|
}
|
||||||
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
|
||||||
self.cached_size.set(my_size);
|
self.cached_size.set(my_size);
|
||||||
my_size
|
my_size
|
||||||
@ -1473,6 +1569,9 @@ impl ::protobuf::Message for CreateViewParams {
|
|||||||
if !self.data.is_empty() {
|
if !self.data.is_empty() {
|
||||||
os.write_string(8, &self.data)?;
|
os.write_string(8, &self.data)?;
|
||||||
}
|
}
|
||||||
|
if self.plugin_type != 0 {
|
||||||
|
os.write_int32(9, self.plugin_type)?;
|
||||||
|
}
|
||||||
os.write_unknown_fields(self.get_unknown_fields())?;
|
os.write_unknown_fields(self.get_unknown_fields())?;
|
||||||
::std::result::Result::Ok(())
|
::std::result::Result::Ok(())
|
||||||
}
|
}
|
||||||
@ -1551,6 +1650,11 @@ impl ::protobuf::Message for CreateViewParams {
|
|||||||
|m: &CreateViewParams| { &m.data },
|
|m: &CreateViewParams| { &m.data },
|
||||||
|m: &mut CreateViewParams| { &mut m.data },
|
|m: &mut CreateViewParams| { &mut m.data },
|
||||||
));
|
));
|
||||||
|
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
|
||||||
|
"plugin_type",
|
||||||
|
|m: &CreateViewParams| { &m.plugin_type },
|
||||||
|
|m: &mut CreateViewParams| { &mut m.plugin_type },
|
||||||
|
));
|
||||||
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewParams>(
|
::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewParams>(
|
||||||
"CreateViewParams",
|
"CreateViewParams",
|
||||||
fields,
|
fields,
|
||||||
@ -1575,6 +1679,7 @@ impl ::protobuf::Clear for CreateViewParams {
|
|||||||
self.ext_data.clear();
|
self.ext_data.clear();
|
||||||
self.view_id.clear();
|
self.view_id.clear();
|
||||||
self.data.clear();
|
self.data.clear();
|
||||||
|
self.plugin_type = 0;
|
||||||
self.unknown_fields.clear();
|
self.unknown_fields.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2765,7 +2870,7 @@ impl ::protobuf::reflect::ProtobufValue for ViewDataType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||||
\n\nview.proto\"\xd4\x02\n\x04View\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\
|
\n\nview.proto\"\xf5\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\
|
\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\
|
\n\x04name\x18\x03\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x04\x20\x01\
|
||||||
(\tR\x04desc\x12*\n\tdata_type\x18\x05\x20\x01(\x0e2\r.ViewDataTypeR\x08\
|
(\tR\x04desc\x12*\n\tdata_type\x18\x05\x20\x01(\x0e2\r.ViewDataTypeR\x08\
|
||||||
@ -2773,32 +2878,35 @@ static file_descriptor_proto_data: &'static [u8] = b"\
|
|||||||
elongings\x18\x07\x20\x01(\x0b2\r.RepeatedViewR\nbelongings\x12#\n\rmodi\
|
elongings\x18\x07\x20\x01(\x0b2\r.RepeatedViewR\nbelongings\x12#\n\rmodi\
|
||||||
fied_time\x18\x08\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\
|
fied_time\x18\x08\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\
|
||||||
\x18\t\x20\x01(\x03R\ncreateTime\x12\x19\n\x08ext_data\x18\n\x20\x01(\tR\
|
\x18\t\x20\x01(\x03R\ncreateTime\x12\x19\n\x08ext_data\x18\n\x20\x01(\tR\
|
||||||
\x07extData\x12\x1c\n\tthumbnail\x18\x0b\x20\x01(\tR\tthumbnail\"+\n\x0c\
|
\x07extData\x12\x1c\n\tthumbnail\x18\x0b\x20\x01(\tR\tthumbnail\x12\x1f\
|
||||||
RepeatedView\x12\x1b\n\x05items\x18\x01\x20\x03(\x0b2\x05.ViewR\x05items\
|
\n\x0bplugin_type\x18\x0c\x20\x01(\x05R\npluginType\"+\n\x0cRepeatedView\
|
||||||
\"\xd8\x01\n\x11CreateViewPayload\x12\x20\n\x0cbelong_to_id\x18\x01\x20\
|
\x12\x1b\n\x05items\x18\x01\x20\x03(\x0b2\x05.ViewR\x05items\"\xf9\x01\n\
|
||||||
\x01(\tR\nbelongToId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\
|
\x11CreateViewPayload\x12\x20\n\x0cbelong_to_id\x18\x01\x20\x01(\tR\nbel\
|
||||||
\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12\x1e\n\tthumbnail\x18\x04\
|
ongToId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\
|
||||||
\x20\x01(\tH\0R\tthumbnail\x12*\n\tdata_type\x18\x05\x20\x01(\x0e2\r.Vie\
|
\x18\x03\x20\x01(\tR\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\0R\
|
||||||
wDataTypeR\x08dataType\x12\x19\n\x08ext_data\x18\x06\x20\x01(\tR\x07extD\
|
\tthumbnail\x12*\n\tdata_type\x18\x05\x20\x01(\x0e2\r.ViewDataTypeR\x08d\
|
||||||
ataB\x12\n\x10one_of_thumbnail\"\xee\x01\n\x10CreateViewParams\x12\x20\n\
|
ataType\x12\x19\n\x08ext_data\x18\x06\x20\x01(\tR\x07extData\x12\x1f\n\
|
||||||
\x0cbelong_to_id\x18\x01\x20\x01(\tR\nbelongToId\x12\x12\n\x04name\x18\
|
\x0bplugin_type\x18\x07\x20\x01(\x05R\npluginTypeB\x12\n\x10one_of_thumb\
|
||||||
\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\
|
nail\"\x8f\x02\n\x10CreateViewParams\x12\x20\n\x0cbelong_to_id\x18\x01\
|
||||||
\x12\x1c\n\tthumbnail\x18\x04\x20\x01(\tR\tthumbnail\x12*\n\tdata_type\
|
\x20\x01(\tR\nbelongToId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\
|
||||||
\x18\x05\x20\x01(\x0e2\r.ViewDataTypeR\x08dataType\x12\x19\n\x08ext_data\
|
\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12\x1c\n\tthumbnail\x18\
|
||||||
\x18\x06\x20\x01(\tR\x07extData\x12\x17\n\x07view_id\x18\x07\x20\x01(\tR\
|
\x04\x20\x01(\tR\tthumbnail\x12*\n\tdata_type\x18\x05\x20\x01(\x0e2\r.Vi\
|
||||||
\x06viewId\x12\x12\n\x04data\x18\x08\x20\x01(\tR\x04data\"\x1e\n\x06View\
|
ewDataTypeR\x08dataType\x12\x19\n\x08ext_data\x18\x06\x20\x01(\tR\x07ext\
|
||||||
Id\x12\x14\n\x05value\x18\x01\x20\x01(\tR\x05value\"&\n\x0eRepeatedViewI\
|
Data\x12\x17\n\x07view_id\x18\x07\x20\x01(\tR\x06viewId\x12\x12\n\x04dat\
|
||||||
d\x12\x14\n\x05items\x18\x01\x20\x03(\tR\x05items\"\xaa\x01\n\x11UpdateV\
|
a\x18\x08\x20\x01(\tR\x04data\x12\x1f\n\x0bplugin_type\x18\t\x20\x01(\
|
||||||
iewPayload\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\n\
|
\x05R\npluginType\"\x1e\n\x06ViewId\x12\x14\n\x05value\x18\x01\x20\x01(\
|
||||||
\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\x04desc\x18\x03\x20\
|
\tR\x05value\"&\n\x0eRepeatedViewId\x12\x14\n\x05items\x18\x01\x20\x03(\
|
||||||
\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\x02R\tthu\
|
\tR\x05items\"\xaa\x01\n\x11UpdateViewPayload\x12\x17\n\x07view_id\x18\
|
||||||
mbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnai\
|
\x01\x20\x01(\tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04n\
|
||||||
l\"\xa9\x01\n\x10UpdateViewParams\x12\x17\n\x07view_id\x18\x01\x20\x01(\
|
ame\x12\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbn\
|
||||||
\tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\
|
ail\x18\x04\x20\x01(\tH\x02R\tthumbnailB\r\n\x0bone_of_nameB\r\n\x0bone_\
|
||||||
\x04desc\x18\x03\x20\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\
|
of_descB\x12\n\x10one_of_thumbnail\"\xa9\x01\n\x10UpdateViewParams\x12\
|
||||||
\x20\x01(\tH\x02R\tthumbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\
|
\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\n\x04name\x18\
|
||||||
\x12\n\x10one_of_thumbnail*+\n\x0cViewDataType\x12\x0c\n\x08RichText\x10\
|
\x02\x20\x01(\tH\0R\x04name\x12\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\
|
||||||
\0\x12\r\n\tPlainText\x10\x01b\x06proto3\
|
\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\x02R\tthumbnailB\r\n\
|
||||||
|
\x0bone_of_nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnail*+\n\x0cVi\
|
||||||
|
ewDataType\x12\x0c\n\x08RichText\x10\0\x12\r\n\tPlainText\x10\x01b\x06pr\
|
||||||
|
oto3\
|
||||||
";
|
";
|
||||||
|
|
||||||
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
|
||||||
|
@ -12,6 +12,7 @@ message View {
|
|||||||
int64 create_time = 9;
|
int64 create_time = 9;
|
||||||
string ext_data = 10;
|
string ext_data = 10;
|
||||||
string thumbnail = 11;
|
string thumbnail = 11;
|
||||||
|
int32 plugin_type = 12;
|
||||||
}
|
}
|
||||||
message RepeatedView {
|
message RepeatedView {
|
||||||
repeated View items = 1;
|
repeated View items = 1;
|
||||||
@ -23,6 +24,7 @@ message CreateViewPayload {
|
|||||||
oneof one_of_thumbnail { string thumbnail = 4; };
|
oneof one_of_thumbnail { string thumbnail = 4; };
|
||||||
ViewDataType data_type = 5;
|
ViewDataType data_type = 5;
|
||||||
string ext_data = 6;
|
string ext_data = 6;
|
||||||
|
int32 plugin_type = 7;
|
||||||
}
|
}
|
||||||
message CreateViewParams {
|
message CreateViewParams {
|
||||||
string belong_to_id = 1;
|
string belong_to_id = 1;
|
||||||
@ -33,6 +35,7 @@ message CreateViewParams {
|
|||||||
string ext_data = 6;
|
string ext_data = 6;
|
||||||
string view_id = 7;
|
string view_id = 7;
|
||||||
string data = 8;
|
string data = 8;
|
||||||
|
int32 plugin_type = 9;
|
||||||
}
|
}
|
||||||
message ViewId {
|
message ViewId {
|
||||||
string value = 1;
|
string value = 1;
|
||||||
|
@ -63,5 +63,6 @@ fn create_default_view(app_id: String, time: chrono::DateTime<Utc>) -> View {
|
|||||||
create_time: time.timestamp(),
|
create_time: time.timestamp(),
|
||||||
ext_data: "".to_string(),
|
ext_data: "".to_string(),
|
||||||
thumbnail: "".to_string(),
|
thumbnail: "".to_string(),
|
||||||
|
plugin_type: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user