[backend]: save active user

This commit is contained in:
appflowy 2021-08-31 17:25:08 +08:00
parent 4c93b04f3d
commit 92d7d6f60a
54 changed files with 4144 additions and 3660 deletions

View File

@ -0,0 +1,494 @@
///
// Generated code. Do not modify.
// source: auth.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 SignInRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignInRequest', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
SignInRequest._() : super();
factory SignInRequest({
$core.String? email,
$core.String? password,
}) {
final _result = create();
if (email != null) {
_result.email = email;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory SignInRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignInRequest.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')
SignInRequest clone() => SignInRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignInRequest copyWith(void Function(SignInRequest) updates) => super.copyWith((message) => updates(message as SignInRequest)) as SignInRequest; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignInRequest create() => SignInRequest._();
SignInRequest createEmptyInstance() => create();
static $pb.PbList<SignInRequest> createRepeated() => $pb.PbList<SignInRequest>();
@$core.pragma('dart2js:noInline')
static SignInRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignInRequest>(create);
static SignInRequest? _defaultInstance;
@$pb.TagNumber(1)
$core.String get email => $_getSZ(0);
@$pb.TagNumber(1)
set email($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEmail() => $_has(0);
@$pb.TagNumber(1)
void clearEmail() => clearField(1);
@$pb.TagNumber(2)
$core.String get password => $_getSZ(1);
@$pb.TagNumber(2)
set password($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasPassword() => $_has(1);
@$pb.TagNumber(2)
void clearPassword() => clearField(2);
}
class SignInParams extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignInParams', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
SignInParams._() : super();
factory SignInParams({
$core.String? email,
$core.String? password,
}) {
final _result = create();
if (email != null) {
_result.email = email;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory SignInParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignInParams.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')
SignInParams clone() => SignInParams()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignInParams copyWith(void Function(SignInParams) updates) => super.copyWith((message) => updates(message as SignInParams)) as SignInParams; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignInParams create() => SignInParams._();
SignInParams createEmptyInstance() => create();
static $pb.PbList<SignInParams> createRepeated() => $pb.PbList<SignInParams>();
@$core.pragma('dart2js:noInline')
static SignInParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignInParams>(create);
static SignInParams? _defaultInstance;
@$pb.TagNumber(1)
$core.String get email => $_getSZ(0);
@$pb.TagNumber(1)
set email($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEmail() => $_has(0);
@$pb.TagNumber(1)
void clearEmail() => clearField(1);
@$pb.TagNumber(2)
$core.String get password => $_getSZ(1);
@$pb.TagNumber(2)
set password($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasPassword() => $_has(1);
@$pb.TagNumber(2)
void clearPassword() => clearField(2);
}
class SignInResponse extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignInResponse', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uid')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'token')
..hasRequiredFields = false
;
SignInResponse._() : super();
factory SignInResponse({
$core.String? uid,
$core.String? name,
$core.String? email,
$core.String? token,
}) {
final _result = create();
if (uid != null) {
_result.uid = uid;
}
if (name != null) {
_result.name = name;
}
if (email != null) {
_result.email = email;
}
if (token != null) {
_result.token = token;
}
return _result;
}
factory SignInResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignInResponse.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')
SignInResponse clone() => SignInResponse()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignInResponse copyWith(void Function(SignInResponse) updates) => super.copyWith((message) => updates(message as SignInResponse)) as SignInResponse; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignInResponse create() => SignInResponse._();
SignInResponse createEmptyInstance() => create();
static $pb.PbList<SignInResponse> createRepeated() => $pb.PbList<SignInResponse>();
@$core.pragma('dart2js:noInline')
static SignInResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignInResponse>(create);
static SignInResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.String get uid => $_getSZ(0);
@$pb.TagNumber(1)
set uid($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasUid() => $_has(0);
@$pb.TagNumber(1)
void clearUid() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get email => $_getSZ(2);
@$pb.TagNumber(3)
set email($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasEmail() => $_has(2);
@$pb.TagNumber(3)
void clearEmail() => clearField(3);
@$pb.TagNumber(4)
$core.String get token => $_getSZ(3);
@$pb.TagNumber(4)
set token($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasToken() => $_has(3);
@$pb.TagNumber(4)
void clearToken() => clearField(4);
}
class SignUpRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignUpRequest', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
SignUpRequest._() : super();
factory SignUpRequest({
$core.String? email,
$core.String? name,
$core.String? password,
}) {
final _result = create();
if (email != null) {
_result.email = email;
}
if (name != null) {
_result.name = name;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory SignUpRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignUpRequest.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')
SignUpRequest clone() => SignUpRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignUpRequest copyWith(void Function(SignUpRequest) updates) => super.copyWith((message) => updates(message as SignUpRequest)) as SignUpRequest; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignUpRequest create() => SignUpRequest._();
SignUpRequest createEmptyInstance() => create();
static $pb.PbList<SignUpRequest> createRepeated() => $pb.PbList<SignUpRequest>();
@$core.pragma('dart2js:noInline')
static SignUpRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignUpRequest>(create);
static SignUpRequest? _defaultInstance;
@$pb.TagNumber(1)
$core.String get email => $_getSZ(0);
@$pb.TagNumber(1)
set email($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEmail() => $_has(0);
@$pb.TagNumber(1)
void clearEmail() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get password => $_getSZ(2);
@$pb.TagNumber(3)
set password($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasPassword() => $_has(2);
@$pb.TagNumber(3)
void clearPassword() => clearField(3);
}
class SignUpParams extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignUpParams', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
SignUpParams._() : super();
factory SignUpParams({
$core.String? email,
$core.String? name,
$core.String? password,
}) {
final _result = create();
if (email != null) {
_result.email = email;
}
if (name != null) {
_result.name = name;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory SignUpParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignUpParams.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')
SignUpParams clone() => SignUpParams()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignUpParams copyWith(void Function(SignUpParams) updates) => super.copyWith((message) => updates(message as SignUpParams)) as SignUpParams; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignUpParams create() => SignUpParams._();
SignUpParams createEmptyInstance() => create();
static $pb.PbList<SignUpParams> createRepeated() => $pb.PbList<SignUpParams>();
@$core.pragma('dart2js:noInline')
static SignUpParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignUpParams>(create);
static SignUpParams? _defaultInstance;
@$pb.TagNumber(1)
$core.String get email => $_getSZ(0);
@$pb.TagNumber(1)
set email($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEmail() => $_has(0);
@$pb.TagNumber(1)
void clearEmail() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get password => $_getSZ(2);
@$pb.TagNumber(3)
set password($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasPassword() => $_has(2);
@$pb.TagNumber(3)
void clearPassword() => clearField(3);
}
class SignUpResponse extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignUpResponse', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uid')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..hasRequiredFields = false
;
SignUpResponse._() : super();
factory SignUpResponse({
$core.String? uid,
$core.String? name,
$core.String? email,
}) {
final _result = create();
if (uid != null) {
_result.uid = uid;
}
if (name != null) {
_result.name = name;
}
if (email != null) {
_result.email = email;
}
return _result;
}
factory SignUpResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignUpResponse.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')
SignUpResponse clone() => SignUpResponse()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignUpResponse copyWith(void Function(SignUpResponse) updates) => super.copyWith((message) => updates(message as SignUpResponse)) as SignUpResponse; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignUpResponse create() => SignUpResponse._();
SignUpResponse createEmptyInstance() => create();
static $pb.PbList<SignUpResponse> createRepeated() => $pb.PbList<SignUpResponse>();
@$core.pragma('dart2js:noInline')
static SignUpResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignUpResponse>(create);
static SignUpResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.String get uid => $_getSZ(0);
@$pb.TagNumber(1)
set uid($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasUid() => $_has(0);
@$pb.TagNumber(1)
void clearUid() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get email => $_getSZ(2);
@$pb.TagNumber(3)
set email($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasEmail() => $_has(2);
@$pb.TagNumber(3)
void clearEmail() => clearField(3);
}
class SignOutParams extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignOutParams', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'token')
..hasRequiredFields = false
;
SignOutParams._() : super();
factory SignOutParams({
$core.String? token,
}) {
final _result = create();
if (token != null) {
_result.token = token;
}
return _result;
}
factory SignOutParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignOutParams.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')
SignOutParams clone() => SignOutParams()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignOutParams copyWith(void Function(SignOutParams) updates) => super.copyWith((message) => updates(message as SignOutParams)) as SignOutParams; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignOutParams create() => SignOutParams._();
SignOutParams createEmptyInstance() => create();
static $pb.PbList<SignOutParams> createRepeated() => $pb.PbList<SignOutParams>();
@$core.pragma('dart2js:noInline')
static SignOutParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignOutParams>(create);
static SignOutParams? _defaultInstance;
@$pb.TagNumber(1)
$core.String get token => $_getSZ(0);
@$pb.TagNumber(1)
set token($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasToken() => $_has(0);
@$pb.TagNumber(1)
void clearToken() => clearField(1);
}

View File

@ -1,6 +1,6 @@
///
// Generated code. Do not modify.
// source: sign_up.proto
// source: auth.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

View File

@ -1,6 +1,6 @@
///
// Generated code. Do not modify.
// source: sign_up.proto
// source: auth.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,6 +8,41 @@
import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use signInRequestDescriptor instead')
const SignInRequest$json = const {
'1': 'SignInRequest',
'2': const [
const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'},
const {'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'},
],
};
/// Descriptor for `SignInRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signInRequestDescriptor = $convert.base64Decode('Cg1TaWduSW5SZXF1ZXN0EhQKBWVtYWlsGAEgASgJUgVlbWFpbBIaCghwYXNzd29yZBgCIAEoCVIIcGFzc3dvcmQ=');
@$core.Deprecated('Use signInParamsDescriptor instead')
const SignInParams$json = const {
'1': 'SignInParams',
'2': const [
const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'},
const {'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'},
],
};
/// Descriptor for `SignInParams`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signInParamsDescriptor = $convert.base64Decode('CgxTaWduSW5QYXJhbXMSFAoFZW1haWwYASABKAlSBWVtYWlsEhoKCHBhc3N3b3JkGAIgASgJUghwYXNzd29yZA==');
@$core.Deprecated('Use signInResponseDescriptor instead')
const SignInResponse$json = const {
'1': 'SignInResponse',
'2': const [
const {'1': 'uid', '3': 1, '4': 1, '5': 9, '10': 'uid'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
const {'1': 'email', '3': 3, '4': 1, '5': 9, '10': 'email'},
const {'1': 'token', '3': 4, '4': 1, '5': 9, '10': 'token'},
],
};
/// Descriptor for `SignInResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signInResponseDescriptor = $convert.base64Decode('Cg5TaWduSW5SZXNwb25zZRIQCgN1aWQYASABKAlSA3VpZBISCgRuYW1lGAIgASgJUgRuYW1lEhQKBWVtYWlsGAMgASgJUgVlbWFpbBIUCgV0b2tlbhgEIAEoCVIFdG9rZW4=');
@$core.Deprecated('Use signUpRequestDescriptor instead')
const SignUpRequest$json = const {
'1': 'SignUpRequest',
@ -44,3 +79,13 @@ const SignUpResponse$json = const {
/// Descriptor for `SignUpResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signUpResponseDescriptor = $convert.base64Decode('Cg5TaWduVXBSZXNwb25zZRIQCgN1aWQYASABKAlSA3VpZBISCgRuYW1lGAIgASgJUgRuYW1lEhQKBWVtYWlsGAMgASgJUgVlbWFpbA==');
@$core.Deprecated('Use signOutParamsDescriptor instead')
const SignOutParams$json = const {
'1': 'SignOutParams',
'2': const [
const {'1': 'token', '3': 1, '4': 1, '5': 9, '10': 'token'},
],
};
/// Descriptor for `SignOutParams`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signOutParamsDescriptor = $convert.base64Decode('Cg1TaWduT3V0UGFyYW1zEhQKBXRva2VuGAEgASgJUgV0b2tlbg==');

View File

@ -1,9 +1,9 @@
///
// Generated code. Do not modify.
// source: sign_up.proto
// source: auth.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 'sign_up.pb.dart';
export 'auth.pb.dart';

View File

@ -1,8 +1,6 @@
// Auto-generated, do not edit
export './sign_up.pb.dart';
export './sign_in.pb.dart';
export './user_table.pb.dart';
export './errors.pb.dart';
export './user_detail.pb.dart';
export './user_update.pb.dart';
export './event.pb.dart';
export './auth.pb.dart';

View File

@ -1,222 +0,0 @@
///
// Generated code. Do not modify.
// source: sign_in.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 SignInRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignInRequest', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
SignInRequest._() : super();
factory SignInRequest({
$core.String? email,
$core.String? password,
}) {
final _result = create();
if (email != null) {
_result.email = email;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory SignInRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignInRequest.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')
SignInRequest clone() => SignInRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignInRequest copyWith(void Function(SignInRequest) updates) => super.copyWith((message) => updates(message as SignInRequest)) as SignInRequest; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignInRequest create() => SignInRequest._();
SignInRequest createEmptyInstance() => create();
static $pb.PbList<SignInRequest> createRepeated() => $pb.PbList<SignInRequest>();
@$core.pragma('dart2js:noInline')
static SignInRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignInRequest>(create);
static SignInRequest? _defaultInstance;
@$pb.TagNumber(1)
$core.String get email => $_getSZ(0);
@$pb.TagNumber(1)
set email($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEmail() => $_has(0);
@$pb.TagNumber(1)
void clearEmail() => clearField(1);
@$pb.TagNumber(2)
$core.String get password => $_getSZ(1);
@$pb.TagNumber(2)
set password($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasPassword() => $_has(1);
@$pb.TagNumber(2)
void clearPassword() => clearField(2);
}
class SignInParams extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignInParams', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
SignInParams._() : super();
factory SignInParams({
$core.String? email,
$core.String? password,
}) {
final _result = create();
if (email != null) {
_result.email = email;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory SignInParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignInParams.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')
SignInParams clone() => SignInParams()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignInParams copyWith(void Function(SignInParams) updates) => super.copyWith((message) => updates(message as SignInParams)) as SignInParams; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignInParams create() => SignInParams._();
SignInParams createEmptyInstance() => create();
static $pb.PbList<SignInParams> createRepeated() => $pb.PbList<SignInParams>();
@$core.pragma('dart2js:noInline')
static SignInParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignInParams>(create);
static SignInParams? _defaultInstance;
@$pb.TagNumber(1)
$core.String get email => $_getSZ(0);
@$pb.TagNumber(1)
set email($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEmail() => $_has(0);
@$pb.TagNumber(1)
void clearEmail() => clearField(1);
@$pb.TagNumber(2)
$core.String get password => $_getSZ(1);
@$pb.TagNumber(2)
set password($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasPassword() => $_has(1);
@$pb.TagNumber(2)
void clearPassword() => clearField(2);
}
class SignInResponse extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignInResponse', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uid')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'token')
..hasRequiredFields = false
;
SignInResponse._() : super();
factory SignInResponse({
$core.String? uid,
$core.String? name,
$core.String? email,
$core.String? token,
}) {
final _result = create();
if (uid != null) {
_result.uid = uid;
}
if (name != null) {
_result.name = name;
}
if (email != null) {
_result.email = email;
}
if (token != null) {
_result.token = token;
}
return _result;
}
factory SignInResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignInResponse.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')
SignInResponse clone() => SignInResponse()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignInResponse copyWith(void Function(SignInResponse) updates) => super.copyWith((message) => updates(message as SignInResponse)) as SignInResponse; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignInResponse create() => SignInResponse._();
SignInResponse createEmptyInstance() => create();
static $pb.PbList<SignInResponse> createRepeated() => $pb.PbList<SignInResponse>();
@$core.pragma('dart2js:noInline')
static SignInResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignInResponse>(create);
static SignInResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.String get uid => $_getSZ(0);
@$pb.TagNumber(1)
set uid($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasUid() => $_has(0);
@$pb.TagNumber(1)
void clearUid() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get email => $_getSZ(2);
@$pb.TagNumber(3)
set email($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasEmail() => $_has(2);
@$pb.TagNumber(3)
void clearEmail() => clearField(3);
@$pb.TagNumber(4)
$core.String get token => $_getSZ(3);
@$pb.TagNumber(4)
set token($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasToken() => $_has(3);
@$pb.TagNumber(4)
void clearToken() => clearField(4);
}

View File

@ -1,7 +0,0 @@
///
// Generated code. Do not modify.
// source: sign_in.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

View File

@ -1,45 +0,0 @@
///
// Generated code. Do not modify.
// source: sign_in.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 signInRequestDescriptor instead')
const SignInRequest$json = const {
'1': 'SignInRequest',
'2': const [
const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'},
const {'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'},
],
};
/// Descriptor for `SignInRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signInRequestDescriptor = $convert.base64Decode('Cg1TaWduSW5SZXF1ZXN0EhQKBWVtYWlsGAEgASgJUgVlbWFpbBIaCghwYXNzd29yZBgCIAEoCVIIcGFzc3dvcmQ=');
@$core.Deprecated('Use signInParamsDescriptor instead')
const SignInParams$json = const {
'1': 'SignInParams',
'2': const [
const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'},
const {'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'},
],
};
/// Descriptor for `SignInParams`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signInParamsDescriptor = $convert.base64Decode('CgxTaWduSW5QYXJhbXMSFAoFZW1haWwYASABKAlSBWVtYWlsEhoKCHBhc3N3b3JkGAIgASgJUghwYXNzd29yZA==');
@$core.Deprecated('Use signInResponseDescriptor instead')
const SignInResponse$json = const {
'1': 'SignInResponse',
'2': const [
const {'1': 'uid', '3': 1, '4': 1, '5': 9, '10': 'uid'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
const {'1': 'email', '3': 3, '4': 1, '5': 9, '10': 'email'},
const {'1': 'token', '3': 4, '4': 1, '5': 9, '10': 'token'},
],
};
/// Descriptor for `SignInResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signInResponseDescriptor = $convert.base64Decode('Cg5TaWduSW5SZXNwb25zZRIQCgN1aWQYASABKAlSA3VpZBISCgRuYW1lGAIgASgJUgRuYW1lEhQKBWVtYWlsGAMgASgJUgVlbWFpbBIUCgV0b2tlbhgEIAEoCVIFdG9rZW4=');

View File

@ -1,9 +0,0 @@
///
// Generated code. Do not modify.
// source: sign_in.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 'sign_in.pb.dart';

View File

@ -1,236 +0,0 @@
///
// Generated code. Do not modify.
// source: sign_up.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 SignUpRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignUpRequest', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
SignUpRequest._() : super();
factory SignUpRequest({
$core.String? email,
$core.String? name,
$core.String? password,
}) {
final _result = create();
if (email != null) {
_result.email = email;
}
if (name != null) {
_result.name = name;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory SignUpRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignUpRequest.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')
SignUpRequest clone() => SignUpRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignUpRequest copyWith(void Function(SignUpRequest) updates) => super.copyWith((message) => updates(message as SignUpRequest)) as SignUpRequest; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignUpRequest create() => SignUpRequest._();
SignUpRequest createEmptyInstance() => create();
static $pb.PbList<SignUpRequest> createRepeated() => $pb.PbList<SignUpRequest>();
@$core.pragma('dart2js:noInline')
static SignUpRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignUpRequest>(create);
static SignUpRequest? _defaultInstance;
@$pb.TagNumber(1)
$core.String get email => $_getSZ(0);
@$pb.TagNumber(1)
set email($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEmail() => $_has(0);
@$pb.TagNumber(1)
void clearEmail() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get password => $_getSZ(2);
@$pb.TagNumber(3)
set password($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasPassword() => $_has(2);
@$pb.TagNumber(3)
void clearPassword() => clearField(3);
}
class SignUpParams extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignUpParams', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
SignUpParams._() : super();
factory SignUpParams({
$core.String? email,
$core.String? name,
$core.String? password,
}) {
final _result = create();
if (email != null) {
_result.email = email;
}
if (name != null) {
_result.name = name;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory SignUpParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignUpParams.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')
SignUpParams clone() => SignUpParams()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignUpParams copyWith(void Function(SignUpParams) updates) => super.copyWith((message) => updates(message as SignUpParams)) as SignUpParams; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignUpParams create() => SignUpParams._();
SignUpParams createEmptyInstance() => create();
static $pb.PbList<SignUpParams> createRepeated() => $pb.PbList<SignUpParams>();
@$core.pragma('dart2js:noInline')
static SignUpParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignUpParams>(create);
static SignUpParams? _defaultInstance;
@$pb.TagNumber(1)
$core.String get email => $_getSZ(0);
@$pb.TagNumber(1)
set email($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasEmail() => $_has(0);
@$pb.TagNumber(1)
void clearEmail() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get password => $_getSZ(2);
@$pb.TagNumber(3)
set password($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasPassword() => $_has(2);
@$pb.TagNumber(3)
void clearPassword() => clearField(3);
}
class SignUpResponse extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignUpResponse', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'uid')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..hasRequiredFields = false
;
SignUpResponse._() : super();
factory SignUpResponse({
$core.String? uid,
$core.String? name,
$core.String? email,
}) {
final _result = create();
if (uid != null) {
_result.uid = uid;
}
if (name != null) {
_result.name = name;
}
if (email != null) {
_result.email = email;
}
return _result;
}
factory SignUpResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SignUpResponse.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')
SignUpResponse clone() => SignUpResponse()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SignUpResponse copyWith(void Function(SignUpResponse) updates) => super.copyWith((message) => updates(message as SignUpResponse)) as SignUpResponse; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SignUpResponse create() => SignUpResponse._();
SignUpResponse createEmptyInstance() => create();
static $pb.PbList<SignUpResponse> createRepeated() => $pb.PbList<SignUpResponse>();
@$core.pragma('dart2js:noInline')
static SignUpResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignUpResponse>(create);
static SignUpResponse? _defaultInstance;
@$pb.TagNumber(1)
$core.String get uid => $_getSZ(0);
@$pb.TagNumber(1)
set uid($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasUid() => $_has(0);
@$pb.TagNumber(1)
void clearUid() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get email => $_getSZ(2);
@$pb.TagNumber(3)
set email($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasEmail() => $_has(2);
@$pb.TagNumber(3)
void clearEmail() => clearField(3);
}

View File

@ -9,16 +9,61 @@ import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
import 'user_detail.pbenum.dart';
export 'user_detail.pbenum.dart';
class QueryUserDetailParams extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'QueryUserDetailParams', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'token')
..hasRequiredFields = false
;
QueryUserDetailParams._() : super();
factory QueryUserDetailParams({
$core.String? token,
}) {
final _result = create();
if (token != null) {
_result.token = token;
}
return _result;
}
factory QueryUserDetailParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory QueryUserDetailParams.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')
QueryUserDetailParams clone() => QueryUserDetailParams()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
QueryUserDetailParams copyWith(void Function(QueryUserDetailParams) updates) => super.copyWith((message) => updates(message as QueryUserDetailParams)) as QueryUserDetailParams; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static QueryUserDetailParams create() => QueryUserDetailParams._();
QueryUserDetailParams createEmptyInstance() => create();
static $pb.PbList<QueryUserDetailParams> createRepeated() => $pb.PbList<QueryUserDetailParams>();
@$core.pragma('dart2js:noInline')
static QueryUserDetailParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<QueryUserDetailParams>(create);
static QueryUserDetailParams? _defaultInstance;
@$pb.TagNumber(1)
$core.String get token => $_getSZ(0);
@$pb.TagNumber(1)
set token($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasToken() => $_has(0);
@$pb.TagNumber(1)
void clearToken() => clearField(1);
}
class UserDetail extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UserDetail', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..e<UserStatus>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'status', $pb.PbFieldType.OE, defaultOrMaker: UserStatus.Unknown, valueOf: UserStatus.valueOf, enumValues: UserStatus.values)
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'token')
..hasRequiredFields = false
;
@ -27,7 +72,7 @@ class UserDetail extends $pb.GeneratedMessage {
$core.String? id,
$core.String? email,
$core.String? name,
UserStatus? status,
$core.String? token,
}) {
final _result = create();
if (id != null) {
@ -39,8 +84,8 @@ class UserDetail extends $pb.GeneratedMessage {
if (name != null) {
_result.name = name;
}
if (status != null) {
_result.status = status;
if (token != null) {
_result.token = token;
}
return _result;
}
@ -93,12 +138,268 @@ class UserDetail extends $pb.GeneratedMessage {
void clearName() => clearField(3);
@$pb.TagNumber(4)
UserStatus get status => $_getN(3);
$core.String get token => $_getSZ(3);
@$pb.TagNumber(4)
set status(UserStatus v) { setField(4, v); }
set token($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasStatus() => $_has(3);
$core.bool hasToken() => $_has(3);
@$pb.TagNumber(4)
void clearStatus() => clearField(4);
void clearToken() => clearField(4);
}
enum UpdateUserRequest_OneOfName {
name,
notSet
}
enum UpdateUserRequest_OneOfEmail {
email,
notSet
}
enum UpdateUserRequest_OneOfPassword {
password,
notSet
}
class UpdateUserRequest extends $pb.GeneratedMessage {
static const $core.Map<$core.int, UpdateUserRequest_OneOfName> _UpdateUserRequest_OneOfNameByTag = {
2 : UpdateUserRequest_OneOfName.name,
0 : UpdateUserRequest_OneOfName.notSet
};
static const $core.Map<$core.int, UpdateUserRequest_OneOfEmail> _UpdateUserRequest_OneOfEmailByTag = {
3 : UpdateUserRequest_OneOfEmail.email,
0 : UpdateUserRequest_OneOfEmail.notSet
};
static const $core.Map<$core.int, UpdateUserRequest_OneOfPassword> _UpdateUserRequest_OneOfPasswordByTag = {
4 : UpdateUserRequest_OneOfPassword.password,
0 : UpdateUserRequest_OneOfPassword.notSet
};
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateUserRequest', createEmptyInstance: create)
..oo(0, [2])
..oo(1, [3])
..oo(2, [4])
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
UpdateUserRequest._() : super();
factory UpdateUserRequest({
$core.String? id,
$core.String? name,
$core.String? email,
$core.String? password,
}) {
final _result = create();
if (id != null) {
_result.id = id;
}
if (name != null) {
_result.name = name;
}
if (email != null) {
_result.email = email;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory UpdateUserRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory UpdateUserRequest.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')
UpdateUserRequest clone() => UpdateUserRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
UpdateUserRequest copyWith(void Function(UpdateUserRequest) updates) => super.copyWith((message) => updates(message as UpdateUserRequest)) as UpdateUserRequest; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UpdateUserRequest create() => UpdateUserRequest._();
UpdateUserRequest createEmptyInstance() => create();
static $pb.PbList<UpdateUserRequest> createRepeated() => $pb.PbList<UpdateUserRequest>();
@$core.pragma('dart2js:noInline')
static UpdateUserRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateUserRequest>(create);
static UpdateUserRequest? _defaultInstance;
UpdateUserRequest_OneOfName whichOneOfName() => _UpdateUserRequest_OneOfNameByTag[$_whichOneof(0)]!;
void clearOneOfName() => clearField($_whichOneof(0));
UpdateUserRequest_OneOfEmail whichOneOfEmail() => _UpdateUserRequest_OneOfEmailByTag[$_whichOneof(1)]!;
void clearOneOfEmail() => clearField($_whichOneof(1));
UpdateUserRequest_OneOfPassword whichOneOfPassword() => _UpdateUserRequest_OneOfPasswordByTag[$_whichOneof(2)]!;
void clearOneOfPassword() => clearField($_whichOneof(2));
@$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 name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get email => $_getSZ(2);
@$pb.TagNumber(3)
set email($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasEmail() => $_has(2);
@$pb.TagNumber(3)
void clearEmail() => clearField(3);
@$pb.TagNumber(4)
$core.String get password => $_getSZ(3);
@$pb.TagNumber(4)
set password($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasPassword() => $_has(3);
@$pb.TagNumber(4)
void clearPassword() => clearField(4);
}
enum UpdateUserParams_OneOfName {
name,
notSet
}
enum UpdateUserParams_OneOfEmail {
email,
notSet
}
enum UpdateUserParams_OneOfPassword {
password,
notSet
}
class UpdateUserParams extends $pb.GeneratedMessage {
static const $core.Map<$core.int, UpdateUserParams_OneOfName> _UpdateUserParams_OneOfNameByTag = {
2 : UpdateUserParams_OneOfName.name,
0 : UpdateUserParams_OneOfName.notSet
};
static const $core.Map<$core.int, UpdateUserParams_OneOfEmail> _UpdateUserParams_OneOfEmailByTag = {
3 : UpdateUserParams_OneOfEmail.email,
0 : UpdateUserParams_OneOfEmail.notSet
};
static const $core.Map<$core.int, UpdateUserParams_OneOfPassword> _UpdateUserParams_OneOfPasswordByTag = {
4 : UpdateUserParams_OneOfPassword.password,
0 : UpdateUserParams_OneOfPassword.notSet
};
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateUserParams', createEmptyInstance: create)
..oo(0, [2])
..oo(1, [3])
..oo(2, [4])
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
UpdateUserParams._() : super();
factory UpdateUserParams({
$core.String? id,
$core.String? name,
$core.String? email,
$core.String? password,
}) {
final _result = create();
if (id != null) {
_result.id = id;
}
if (name != null) {
_result.name = name;
}
if (email != null) {
_result.email = email;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory UpdateUserParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory UpdateUserParams.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')
UpdateUserParams clone() => UpdateUserParams()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
UpdateUserParams copyWith(void Function(UpdateUserParams) updates) => super.copyWith((message) => updates(message as UpdateUserParams)) as UpdateUserParams; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UpdateUserParams create() => UpdateUserParams._();
UpdateUserParams createEmptyInstance() => create();
static $pb.PbList<UpdateUserParams> createRepeated() => $pb.PbList<UpdateUserParams>();
@$core.pragma('dart2js:noInline')
static UpdateUserParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateUserParams>(create);
static UpdateUserParams? _defaultInstance;
UpdateUserParams_OneOfName whichOneOfName() => _UpdateUserParams_OneOfNameByTag[$_whichOneof(0)]!;
void clearOneOfName() => clearField($_whichOneof(0));
UpdateUserParams_OneOfEmail whichOneOfEmail() => _UpdateUserParams_OneOfEmailByTag[$_whichOneof(1)]!;
void clearOneOfEmail() => clearField($_whichOneof(1));
UpdateUserParams_OneOfPassword whichOneOfPassword() => _UpdateUserParams_OneOfPasswordByTag[$_whichOneof(2)]!;
void clearOneOfPassword() => clearField($_whichOneof(2));
@$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 name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get email => $_getSZ(2);
@$pb.TagNumber(3)
set email($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasEmail() => $_has(2);
@$pb.TagNumber(3)
void clearEmail() => clearField(3);
@$pb.TagNumber(4)
$core.String get password => $_getSZ(3);
@$pb.TagNumber(4)
set password($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasPassword() => $_has(3);
@$pb.TagNumber(4)
void clearPassword() => clearField(4);
}

View File

@ -20,6 +20,16 @@ const UserStatus$json = const {
/// Descriptor for `UserStatus`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List userStatusDescriptor = $convert.base64Decode('CgpVc2VyU3RhdHVzEgsKB1Vua25vd24QABIJCgVMb2dpbhABEgsKB0V4cGlyZWQQAg==');
@$core.Deprecated('Use queryUserDetailParamsDescriptor instead')
const QueryUserDetailParams$json = const {
'1': 'QueryUserDetailParams',
'2': const [
const {'1': 'token', '3': 1, '4': 1, '5': 9, '10': 'token'},
],
};
/// Descriptor for `QueryUserDetailParams`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List queryUserDetailParamsDescriptor = $convert.base64Decode('ChVRdWVyeVVzZXJEZXRhaWxQYXJhbXMSFAoFdG9rZW4YASABKAlSBXRva2Vu');
@$core.Deprecated('Use userDetailDescriptor instead')
const UserDetail$json = const {
'1': 'UserDetail',
@ -27,9 +37,45 @@ const UserDetail$json = const {
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
const {'1': 'email', '3': 2, '4': 1, '5': 9, '10': 'email'},
const {'1': 'name', '3': 3, '4': 1, '5': 9, '10': 'name'},
const {'1': 'status', '3': 4, '4': 1, '5': 14, '6': '.UserStatus', '10': 'status'},
const {'1': 'token', '3': 4, '4': 1, '5': 9, '10': 'token'},
],
};
/// Descriptor for `UserDetail`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List userDetailDescriptor = $convert.base64Decode('CgpVc2VyRGV0YWlsEg4KAmlkGAEgASgJUgJpZBIUCgVlbWFpbBgCIAEoCVIFZW1haWwSEgoEbmFtZRgDIAEoCVIEbmFtZRIjCgZzdGF0dXMYBCABKA4yCy5Vc2VyU3RhdHVzUgZzdGF0dXM=');
final $typed_data.Uint8List userDetailDescriptor = $convert.base64Decode('CgpVc2VyRGV0YWlsEg4KAmlkGAEgASgJUgJpZBIUCgVlbWFpbBgCIAEoCVIFZW1haWwSEgoEbmFtZRgDIAEoCVIEbmFtZRIUCgV0b2tlbhgEIAEoCVIFdG9rZW4=');
@$core.Deprecated('Use updateUserRequestDescriptor instead')
const UpdateUserRequest$json = const {
'1': 'UpdateUserRequest',
'2': const [
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'name'},
const {'1': 'email', '3': 3, '4': 1, '5': 9, '9': 1, '10': 'email'},
const {'1': 'password', '3': 4, '4': 1, '5': 9, '9': 2, '10': 'password'},
],
'8': const [
const {'1': 'one_of_name'},
const {'1': 'one_of_email'},
const {'1': 'one_of_password'},
],
};
/// Descriptor for `UpdateUserRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List updateUserRequestDescriptor = $convert.base64Decode('ChFVcGRhdGVVc2VyUmVxdWVzdBIOCgJpZBgBIAEoCVICaWQSFAoEbmFtZRgCIAEoCUgAUgRuYW1lEhYKBWVtYWlsGAMgASgJSAFSBWVtYWlsEhwKCHBhc3N3b3JkGAQgASgJSAJSCHBhc3N3b3JkQg0KC29uZV9vZl9uYW1lQg4KDG9uZV9vZl9lbWFpbEIRCg9vbmVfb2ZfcGFzc3dvcmQ=');
@$core.Deprecated('Use updateUserParamsDescriptor instead')
const UpdateUserParams$json = const {
'1': 'UpdateUserParams',
'2': const [
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'name'},
const {'1': 'email', '3': 3, '4': 1, '5': 9, '9': 1, '10': 'email'},
const {'1': 'password', '3': 4, '4': 1, '5': 9, '9': 2, '10': 'password'},
],
'8': const [
const {'1': 'one_of_name'},
const {'1': 'one_of_email'},
const {'1': 'one_of_password'},
],
};
/// Descriptor for `UpdateUserParams`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List updateUserParamsDescriptor = $convert.base64Decode('ChBVcGRhdGVVc2VyUGFyYW1zEg4KAmlkGAEgASgJUgJpZBIUCgRuYW1lGAIgASgJSABSBG5hbWUSFgoFZW1haWwYAyABKAlIAVIFZW1haWwSHAoIcGFzc3dvcmQYBCABKAlIAlIIcGFzc3dvcmRCDQoLb25lX29mX25hbWVCDgoMb25lX29mX2VtYWlsQhEKD29uZV9vZl9wYXNzd29yZA==');

View File

@ -1,267 +0,0 @@
///
// Generated code. Do not modify.
// source: user_update.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 UpdateUserRequest_OneOfName {
name,
notSet
}
enum UpdateUserRequest_OneOfEmail {
email,
notSet
}
enum UpdateUserRequest_OneOfPassword {
password,
notSet
}
class UpdateUserRequest extends $pb.GeneratedMessage {
static const $core.Map<$core.int, UpdateUserRequest_OneOfName> _UpdateUserRequest_OneOfNameByTag = {
2 : UpdateUserRequest_OneOfName.name,
0 : UpdateUserRequest_OneOfName.notSet
};
static const $core.Map<$core.int, UpdateUserRequest_OneOfEmail> _UpdateUserRequest_OneOfEmailByTag = {
3 : UpdateUserRequest_OneOfEmail.email,
0 : UpdateUserRequest_OneOfEmail.notSet
};
static const $core.Map<$core.int, UpdateUserRequest_OneOfPassword> _UpdateUserRequest_OneOfPasswordByTag = {
4 : UpdateUserRequest_OneOfPassword.password,
0 : UpdateUserRequest_OneOfPassword.notSet
};
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateUserRequest', createEmptyInstance: create)
..oo(0, [2])
..oo(1, [3])
..oo(2, [4])
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
UpdateUserRequest._() : super();
factory UpdateUserRequest({
$core.String? id,
$core.String? name,
$core.String? email,
$core.String? password,
}) {
final _result = create();
if (id != null) {
_result.id = id;
}
if (name != null) {
_result.name = name;
}
if (email != null) {
_result.email = email;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory UpdateUserRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory UpdateUserRequest.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')
UpdateUserRequest clone() => UpdateUserRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
UpdateUserRequest copyWith(void Function(UpdateUserRequest) updates) => super.copyWith((message) => updates(message as UpdateUserRequest)) as UpdateUserRequest; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UpdateUserRequest create() => UpdateUserRequest._();
UpdateUserRequest createEmptyInstance() => create();
static $pb.PbList<UpdateUserRequest> createRepeated() => $pb.PbList<UpdateUserRequest>();
@$core.pragma('dart2js:noInline')
static UpdateUserRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateUserRequest>(create);
static UpdateUserRequest? _defaultInstance;
UpdateUserRequest_OneOfName whichOneOfName() => _UpdateUserRequest_OneOfNameByTag[$_whichOneof(0)]!;
void clearOneOfName() => clearField($_whichOneof(0));
UpdateUserRequest_OneOfEmail whichOneOfEmail() => _UpdateUserRequest_OneOfEmailByTag[$_whichOneof(1)]!;
void clearOneOfEmail() => clearField($_whichOneof(1));
UpdateUserRequest_OneOfPassword whichOneOfPassword() => _UpdateUserRequest_OneOfPasswordByTag[$_whichOneof(2)]!;
void clearOneOfPassword() => clearField($_whichOneof(2));
@$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 name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get email => $_getSZ(2);
@$pb.TagNumber(3)
set email($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasEmail() => $_has(2);
@$pb.TagNumber(3)
void clearEmail() => clearField(3);
@$pb.TagNumber(4)
$core.String get password => $_getSZ(3);
@$pb.TagNumber(4)
set password($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasPassword() => $_has(3);
@$pb.TagNumber(4)
void clearPassword() => clearField(4);
}
enum UpdateUserParams_OneOfName {
name,
notSet
}
enum UpdateUserParams_OneOfEmail {
email,
notSet
}
enum UpdateUserParams_OneOfPassword {
password,
notSet
}
class UpdateUserParams extends $pb.GeneratedMessage {
static const $core.Map<$core.int, UpdateUserParams_OneOfName> _UpdateUserParams_OneOfNameByTag = {
2 : UpdateUserParams_OneOfName.name,
0 : UpdateUserParams_OneOfName.notSet
};
static const $core.Map<$core.int, UpdateUserParams_OneOfEmail> _UpdateUserParams_OneOfEmailByTag = {
3 : UpdateUserParams_OneOfEmail.email,
0 : UpdateUserParams_OneOfEmail.notSet
};
static const $core.Map<$core.int, UpdateUserParams_OneOfPassword> _UpdateUserParams_OneOfPasswordByTag = {
4 : UpdateUserParams_OneOfPassword.password,
0 : UpdateUserParams_OneOfPassword.notSet
};
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateUserParams', createEmptyInstance: create)
..oo(0, [2])
..oo(1, [3])
..oo(2, [4])
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..hasRequiredFields = false
;
UpdateUserParams._() : super();
factory UpdateUserParams({
$core.String? id,
$core.String? name,
$core.String? email,
$core.String? password,
}) {
final _result = create();
if (id != null) {
_result.id = id;
}
if (name != null) {
_result.name = name;
}
if (email != null) {
_result.email = email;
}
if (password != null) {
_result.password = password;
}
return _result;
}
factory UpdateUserParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory UpdateUserParams.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')
UpdateUserParams clone() => UpdateUserParams()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
UpdateUserParams copyWith(void Function(UpdateUserParams) updates) => super.copyWith((message) => updates(message as UpdateUserParams)) as UpdateUserParams; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static UpdateUserParams create() => UpdateUserParams._();
UpdateUserParams createEmptyInstance() => create();
static $pb.PbList<UpdateUserParams> createRepeated() => $pb.PbList<UpdateUserParams>();
@$core.pragma('dart2js:noInline')
static UpdateUserParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateUserParams>(create);
static UpdateUserParams? _defaultInstance;
UpdateUserParams_OneOfName whichOneOfName() => _UpdateUserParams_OneOfNameByTag[$_whichOneof(0)]!;
void clearOneOfName() => clearField($_whichOneof(0));
UpdateUserParams_OneOfEmail whichOneOfEmail() => _UpdateUserParams_OneOfEmailByTag[$_whichOneof(1)]!;
void clearOneOfEmail() => clearField($_whichOneof(1));
UpdateUserParams_OneOfPassword whichOneOfPassword() => _UpdateUserParams_OneOfPasswordByTag[$_whichOneof(2)]!;
void clearOneOfPassword() => clearField($_whichOneof(2));
@$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 name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get email => $_getSZ(2);
@$pb.TagNumber(3)
set email($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasEmail() => $_has(2);
@$pb.TagNumber(3)
void clearEmail() => clearField(3);
@$pb.TagNumber(4)
$core.String get password => $_getSZ(3);
@$pb.TagNumber(4)
set password($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasPassword() => $_has(3);
@$pb.TagNumber(4)
void clearPassword() => clearField(4);
}

View File

@ -1,7 +0,0 @@
///
// Generated code. Do not modify.
// source: user_update.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

View File

@ -1,46 +0,0 @@
///
// Generated code. Do not modify.
// source: user_update.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 updateUserRequestDescriptor instead')
const UpdateUserRequest$json = const {
'1': 'UpdateUserRequest',
'2': const [
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'name'},
const {'1': 'email', '3': 3, '4': 1, '5': 9, '9': 1, '10': 'email'},
const {'1': 'password', '3': 4, '4': 1, '5': 9, '9': 2, '10': 'password'},
],
'8': const [
const {'1': 'one_of_name'},
const {'1': 'one_of_email'},
const {'1': 'one_of_password'},
],
};
/// Descriptor for `UpdateUserRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List updateUserRequestDescriptor = $convert.base64Decode('ChFVcGRhdGVVc2VyUmVxdWVzdBIOCgJpZBgBIAEoCVICaWQSFAoEbmFtZRgCIAEoCUgAUgRuYW1lEhYKBWVtYWlsGAMgASgJSAFSBWVtYWlsEhwKCHBhc3N3b3JkGAQgASgJSAJSCHBhc3N3b3JkQg0KC29uZV9vZl9uYW1lQg4KDG9uZV9vZl9lbWFpbEIRCg9vbmVfb2ZfcGFzc3dvcmQ=');
@$core.Deprecated('Use updateUserParamsDescriptor instead')
const UpdateUserParams$json = const {
'1': 'UpdateUserParams',
'2': const [
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'name'},
const {'1': 'email', '3': 3, '4': 1, '5': 9, '9': 1, '10': 'email'},
const {'1': 'password', '3': 4, '4': 1, '5': 9, '9': 2, '10': 'password'},
],
'8': const [
const {'1': 'one_of_name'},
const {'1': 'one_of_email'},
const {'1': 'one_of_password'},
],
};
/// Descriptor for `UpdateUserParams`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List updateUserParamsDescriptor = $convert.base64Decode('ChBVcGRhdGVVc2VyUGFyYW1zEg4KAmlkGAEgASgJUgJpZBIUCgRuYW1lGAIgASgJSABSBG5hbWUSFgoFZW1haWwYAyABKAlIAVIFZW1haWwSHAoIcGFzc3dvcmQYBCABKAlIAlIIcGFzc3dvcmRCDQoLb25lX29mX25hbWVCDgoMb25lX29mX2VtYWlsQhEKD29uZV9vZl9wYXNzd29yZA==');

View File

@ -1,9 +0,0 @@
///
// Generated code. Do not modify.
// source: user_update.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 'user_update.pb.dart';

View File

@ -13,6 +13,7 @@ actix = "0.12"
actix-codec = "0.3"
actix-web = "4.0.0-beta.8"
actix-http = "3.0.0-beta.8"
actix-rt = "2"
actix-web-actors = { version = "4.0.0-beta.6" }
actix-identity = "0.4.0-beta.2"
@ -29,12 +30,15 @@ derive_more = {version = "0.99"}
protobuf = {version = "2.20.0"}
uuid = { version = "0.8", features = ["serde", "v4"] }
config = { version = "0.10.1", default-features = false, features = ["yaml"] }
chrono = "0.4.19"
chrono = { version = "0.4", features = ["serde"] }
anyhow = "1.0.40"
thiserror = "1.0.24"
bcrypt = "0.10"
jsonwebtoken = "7.2"
sql-builder = "3.1.1"
lazy_static = "1.4"
tokio = { version = "1", features = ["full"] }
flowy-log = { path = "../rust-lib/flowy-log" }
flowy-user = { path = "../rust-lib/flowy-user" }
@ -66,8 +70,6 @@ path = "src/main.rs"
[dev-dependencies]
once_cell = "1.7.2"
actix-rt = "2"
tokio = { version = "1", features = ["macros"] }
linkify = "0.5.0"
flowy-user = { path = "../rust-lib/flowy-user" }
flowy-workspace = { path = "../rust-lib/flowy-workspace" }

View File

@ -14,7 +14,8 @@ use actix::Actor;
use actix_identity::{CookieIdentityPolicy, IdentityService};
use actix_web::{dev::Server, middleware, web, web::Data, App, HttpServer, Scope};
use sqlx::{postgres::PgPoolOptions, PgPool};
use std::net::TcpListener;
use std::{net::TcpListener, time::Duration};
use tokio::time::interval;
pub struct Application {
port: u16,
@ -46,6 +47,8 @@ pub fn run(listener: TcpListener, app_ctx: AppContext) -> Result<Server, std::io
let domain = domain();
let secret: String = secret();
actix_rt::spawn(period_check(pg_pool.clone()));
let server = HttpServer::new(move || {
App::new()
.wrap(middleware::Logger::default())
@ -61,6 +64,13 @@ pub fn run(listener: TcpListener, app_ctx: AppContext) -> Result<Server, std::io
Ok(server)
}
async fn period_check(_pool: Data<PgPool>) {
let mut i = interval(Duration::from_secs(60));
loop {
i.tick().await;
}
}
fn ws_scope() -> Scope { web::scope("/ws").service(ws_service::router::start_connection) }
fn user_scope() -> Scope {
@ -71,7 +81,7 @@ fn user_scope() -> Scope {
.service(web::resource("/auth")
.route(web::post().to(user::sign_in_handler))
.route(web::delete().to(user::sign_out_handler))
.route(web::get().to(user::user_profile))
.route(web::get().to(user::user_detail_handler))
)
.service(web::resource("/workspace")
.route(web::post().to(workspace::create_handler))

View File

@ -34,13 +34,15 @@ impl Claim {
exp: (Local::now() + Duration::hours(24)).timestamp(),
}
}
pub fn get_email(self) -> String { self.email }
}
// impl From<Claim> for User {
// fn from(claim: Claim) -> Self { Self { email: claim.email } }
// }
#[derive(From, Into)]
#[derive(From, Into, Clone)]
pub struct Token(String);
impl Token {
pub fn create_token(data: &UserTable) -> Result<Self, ServerError> {

View File

@ -5,6 +5,14 @@ use futures::StreamExt;
use protobuf::{Message, ProtobufResult};
pub async fn parse_from_payload<T: Message>(payload: web::Payload) -> Result<T, ServerError> {
let bytes = poll_payload(&mut payload.into_inner()).await?;
parse_from_bytes(&bytes)
}
#[allow(dead_code)]
pub async fn parse_from_dev_payload<T: Message>(
payload: &mut actix_web::dev::Payload,
) -> Result<T, ServerError> {
let bytes = poll_payload(payload).await?;
parse_from_bytes(&bytes)
}
@ -17,7 +25,9 @@ pub fn parse_from_bytes<T: Message>(bytes: &[u8]) -> Result<T, ServerError> {
}
}
pub async fn poll_payload(mut payload: web::Payload) -> Result<web::BytesMut, ServerError> {
pub async fn poll_payload(
payload: &mut actix_web::dev::Payload,
) -> Result<web::BytesMut, ServerError> {
let mut body = web::BytesMut::new();
while let Some(chunk) = payload.next().await {
let chunk = chunk.map_err(|err| ServerError::internal().context(err))?;

View File

@ -1,10 +1,11 @@
use super::AUTHORIZED_USERS;
use crate::{
entities::{token::Token, user::UserTable},
sqlx_ext::DBTransaction,
user_service::{hash_password, verify_password},
user_service::{hash_password, verify_password, LoggedUser},
workspace_service::user_default::create_default_workspace,
};
use actix_identity::Identity;
use anyhow::Context;
use chrono::Utc;
use flowy_net::{
@ -13,15 +14,18 @@ use flowy_net::{
};
use flowy_user::{
entities::parser::{UserEmail, UserName, UserPassword},
protobuf::{SignInParams, SignInResponse, SignUpParams, SignUpResponse},
protobuf::{
SignInParams,
SignInResponse,
SignOutParams,
SignUpParams,
SignUpResponse,
UserDetail,
},
};
use sqlx::{PgPool, Postgres};
pub async fn sign_in(
pool: &PgPool,
params: SignInParams,
id: Identity,
) -> Result<FlowyResponse, ServerError> {
pub async fn sign_in(pool: &PgPool, params: SignInParams) -> Result<SignInResponse, ServerError> {
let email =
UserEmail::parse(params.email).map_err(|e| ServerError::params_invalid().context(e))?;
let password = UserPassword::parse(params.password)
@ -45,15 +49,20 @@ pub async fn sign_in(
response_data.set_uid(user.id.to_string());
response_data.set_name(user.name);
response_data.set_email(user.email);
response_data.set_token(token.into());
response_data.set_token(token.clone().into());
id.remember(response_data.token.clone());
FlowyResponse::success().pb(response_data)
let _ = AUTHORIZED_USERS.store_auth(LoggedUser::from_token(token.into())?, true)?;
Ok(response_data)
},
_ => Err(ServerError::password_not_match()),
}
}
pub async fn sign_out(params: SignOutParams) -> Result<FlowyResponse, ServerError> {
let _ = AUTHORIZED_USERS.store_auth(LoggedUser::from_token(params.token.clone())?, false)?;
Ok(FlowyResponse::success())
}
pub async fn register_user(
pool: &PgPool,
params: SignUpParams,
@ -90,6 +99,33 @@ pub async fn register_user(
FlowyResponse::success().pb(response_data)
}
pub(crate) async fn get_user_details(
pool: &PgPool,
token: &str,
) -> Result<FlowyResponse, ServerError> {
let logged_user = LoggedUser::from_token(token.to_owned().into())?;
let mut transaction = pool
.begin()
.await
.context("Failed to acquire a Postgres connection to get user detail")?;
let user_table = read_user(&mut transaction, &logged_user.email).await?;
transaction
.commit()
.await
.context("Failed to commit SQL transaction to get user detail.")?;
// update the user active time
let _ = AUTHORIZED_USERS.store_auth(logged_user, true)?;
let mut user_detail = UserDetail::default();
user_detail.set_email(user_table.email);
user_detail.set_name(user_table.name);
user_detail.set_token(token.to_owned());
FlowyResponse::success().pb(user_detail)
}
async fn is_email_exist(
transaction: &mut DBTransaction<'_>,
email: &str,

View File

@ -0,0 +1,87 @@
use crate::entities::token::{Claim, Token};
use chrono::{DateTime, Utc};
use dashmap::DashMap;
use flowy_net::errors::ServerError;
use lazy_static::lazy_static;
lazy_static! {
pub static ref AUTHORIZED_USERS: AuthorizedUsers = AuthorizedUsers::new();
}
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
pub struct LoggedUser {
pub email: String,
}
impl std::convert::From<Claim> for LoggedUser {
fn from(c: Claim) -> Self {
Self {
email: c.get_email(),
}
}
}
impl LoggedUser {
pub fn from_token(token: String) -> Result<Self, ServerError> {
let user: LoggedUser = Token::decode_token(&token.into())?.into();
match AUTHORIZED_USERS.is_authorized(&user) {
true => Ok(user),
false => Err(ServerError::unauthorized()),
}
}
}
// use futures::{
// executor::block_on,
// future::{ready, Ready},
// };
// impl FromRequest for LoggedUser {
// type Config = ();
// type Error = ServerError;
// type Future = Ready<Result<Self, Self::Error>>;
//
// fn from_request(_req: &HttpRequest, payload: &mut Payload) ->
// Self::Future { let result: Result<SignOutParams, ServerError> =
// block_on(parse_from_dev_payload(payload)); match result {
// Ok(params) => ready(LoggedUser::from_token(params.token)),
// Err(e) => ready(Err(e)),
// }
// }
// }
#[derive(Clone, Debug, Copy)]
enum AuthStatus {
Authorized(DateTime<Utc>),
NotAuthorized,
}
pub struct AuthorizedUsers(DashMap<LoggedUser, AuthStatus>);
impl AuthorizedUsers {
pub fn new() -> Self { Self(DashMap::new()) }
pub fn is_authorized(&self, user: &LoggedUser) -> bool {
match self.0.get(user) {
None => false,
Some(status) => match *status {
AuthStatus::Authorized(last_time) => {
let current_time = Utc::now();
(current_time - last_time).num_days() < 5
},
AuthStatus::NotAuthorized => false,
},
}
}
pub fn store_auth(&self, user: LoggedUser, is_auth: bool) -> Result<(), ServerError> {
let current_time = Utc::now();
let status = if is_auth {
AuthStatus::Authorized(current_time)
} else {
AuthStatus::NotAuthorized
};
self.0.insert(user, status);
Ok(())
}
}

View File

@ -1,8 +1,10 @@
mod auth;
mod logged_user;
mod profile;
pub mod router;
mod utils;
pub use auth::*;
pub use logged_user::*;
pub use profile::*;
pub use utils::*;

View File

@ -5,11 +5,10 @@ use actix_web::{
HttpResponse,
};
use flowy_user::protobuf::{SignInParams, SignUpParams};
use crate::user_service::{register_user, sign_in};
use crate::user_service::{get_user_details, register_user, sign_in, sign_out};
use actix_identity::Identity;
use flowy_net::errors::ServerError;
use flowy_net::{errors::ServerError, response::FlowyResponse};
use flowy_user::protobuf::{QueryUserDetailParams, SignInParams, SignOutParams, SignUpParams};
use sqlx::PgPool;
pub async fn sign_in_handler(
@ -18,21 +17,27 @@ pub async fn sign_in_handler(
pool: Data<PgPool>,
) -> Result<HttpResponse, ServerError> {
let params: SignInParams = parse_from_payload(payload).await?;
let resp = sign_in(pool.get_ref(), params, id).await?;
Ok(resp.into())
let data = sign_in(pool.get_ref(), params).await?;
id.remember(data.token.clone());
let response = FlowyResponse::success().pb(data)?;
Ok(response.into())
}
pub async fn sign_out_handler(id: Identity) -> Result<HttpResponse, ServerError> {
pub async fn sign_out_handler(payload: Payload, id: Identity) -> Result<HttpResponse, ServerError> {
let params: SignOutParams = parse_from_payload(payload).await?;
id.forget();
Ok(HttpResponse::Ok().finish())
let response = sign_out(params).await?;
Ok(response.into())
}
pub async fn user_profile(
_request: HttpRequest,
_payload: Payload,
_pool: Data<PgPool>,
pub async fn user_detail_handler(
payload: Payload,
pool: Data<PgPool>,
) -> Result<HttpResponse, ServerError> {
unimplemented!()
let params: QueryUserDetailParams = parse_from_payload(payload).await?;
let response = get_user_details(pool.get_ref(), &params.token).await?;
Ok(response.into())
}
pub async fn register_user_handler(

View File

@ -1,5 +1,5 @@
use crate::helper::{spawn_app, TestApp};
use flowy_user::entities::{SignInParams, SignUpParams, SignUpResponse};
use flowy_user::entities::{SignInParams, SignOutParams, SignUpParams, SignUpResponse};
#[actix_rt::test]
async fn user_register() {
@ -42,6 +42,26 @@ async fn user_sign_in() {
log::info!("{:?}", response);
}
#[actix_rt::test]
async fn user_sign_out() {
let app = spawn_app().await;
let email = "annie@appflowy.io";
let password = "HelloWork123!";
let _ = register_user(&app, email, password).await;
let sign_in_resp = app
.sign_in(SignInParams {
email: email.to_string(),
password: password.to_string(),
})
.await;
let sign_out_params = SignOutParams {
token: sign_in_resp.token,
};
app.sign_out(sign_out_params).await;
}
async fn register_user(app: &TestApp, email: &str, password: &str) -> SignUpResponse {
let params = SignUpParams {
email: email.to_string(),

View File

@ -27,13 +27,18 @@ impl TestApp {
resp
}
pub async fn sign_out(&self, params: SignOutParams) {
let url = format!("{}/api/auth", self.address);
let _ = user_sign_out(params, &url).await.unwrap();
}
pub async fn create_workspace(&self, params: CreateWorkspaceParams) -> Workspace {
let url = format!("{}/api/workspace", self.address);
let workspace = create_workspace_request(params, &url).await.unwrap();
workspace
}
pub async fn read_workspace(&self, params: QueryWorkspaceParams) -> RepeatedWorkspace {
pub async fn read_workspaces(&self, params: QueryWorkspaceParams) -> RepeatedWorkspace {
let url = format!("{}/api/workspace", self.address);
let workspaces = read_workspaces_request(params, &url).await.unwrap();
workspaces
@ -83,12 +88,6 @@ impl TestApp {
view
}
pub async fn read_workspace_list(&self, user_id: &str) -> RepeatedWorkspace {
let url = format!("{}/api/workspace_list/{}", self.address, user_id);
let workspaces = read_workspace_list_request(&url).await.unwrap();
workspaces
}
pub async fn update_view(&self, params: UpdateViewParams) {
let url = format!("{}/api/view", self.address);
update_view_request(params, &url).await.unwrap();

View File

@ -23,7 +23,7 @@ async fn workspace_read() {
let app = spawn_app().await;
let (workspace_1, user_id) = create_test_workspace(&app).await;
let read_params = QueryWorkspaceParams::new(&user_id).workspace_id(&workspace_1.id);
log::info!("{:?}", app.read_workspace(read_params).await);
log::info!("{:?}", app.read_workspaces(read_params).await);
}
#[actix_rt::test]
@ -35,7 +35,7 @@ async fn workspace_read_with_belongs() {
let _ = create_test_app(&application, &workspace.id, &user_id).await;
let read_params = QueryWorkspaceParams::new(&user_id).workspace_id(&workspace.id);
let workspaces = application.read_workspace(read_params).await;
let workspaces = application.read_workspaces(read_params).await;
let workspace = workspaces.items.first().unwrap();
assert_eq!(workspace.apps.len(), 3);
}
@ -52,7 +52,7 @@ async fn workspace_update() {
app.update_workspace(update_params).await;
let read_params = QueryWorkspaceParams::new(&user_id).workspace_id(&workspace_1.id);
let workspace_2 = app.read_workspace(read_params).await;
let workspace_2 = app.read_workspaces(read_params).await;
log::info!("{:?}", workspace_2);
}
@ -66,7 +66,7 @@ async fn workspace_delete() {
let _ = app.delete_workspace(delete_params).await;
let read_params = QueryWorkspaceParams::new(&user_id).workspace_id(&workspace.id);
let repeated_workspace = app.read_workspace(read_params).await;
let repeated_workspace = app.read_workspaces(read_params).await;
assert_eq!(repeated_workspace.len(), 0);
}
@ -245,6 +245,6 @@ async fn workspace_list_read() {
}
let read_params = QueryWorkspaceParams::new(&response.uid);
let workspaces = application.read_workspace(read_params).await;
let workspaces = application.read_workspaces(read_params).await;
assert_eq!(workspaces.len(), 4);
}

View File

@ -3,7 +3,7 @@
CREATE TABLE user_table (
id TEXT NOT NULL PRIMARY KEY,
name TEXT NOT NULL DEFAULT '',
password TEXT NOT NULL DEFAULT '',
token TEXT NOT NULL DEFAULT '',
email TEXT NOT NULL DEFAULT ''
);

View File

@ -29,7 +29,7 @@ table! {
user_table (id) {
id -> Text,
name -> Text,
password -> Text,
token -> Text,
email -> Text,
workspace -> Text,
}

View File

@ -59,15 +59,17 @@ pub fn category_from_str(type_str: &str) -> TypeCategory {
| "DocError"
| "FFIRequest"
| "FFIResponse"
| "UserDetail"
| "UpdateUserRequest"
| "UpdateUserParams"
| "SignUpRequest"
| "SignUpParams"
| "SignUpResponse"
| "SignInRequest"
| "SignInParams"
| "SignInResponse"
| "SignUpRequest"
| "SignUpParams"
| "SignUpResponse"
| "SignOutParams"
| "QueryUserDetailParams"
| "UserDetail"
| "UpdateUserRequest"
| "UpdateUserParams"
| "UserError"
=> TypeCategory::Protobuf,
"ViewType"

View File

@ -9,7 +9,7 @@ use flowy_user::{
event::UserEvent::{GetStatus, SignOut, SignUp},
prelude::*,
};
use flowy_workspace::errors::ErrorCode;
use std::{
convert::TryFrom,
fmt::{Debug, Display},

View File

@ -1,10 +1,55 @@
use crate::{
entities::parser::*,
errors::{ErrorBuilder, UserError},
};
use crate::{entities::parser::*, errors::*};
use flowy_derive::ProtoBuf;
use std::convert::TryInto;
#[derive(ProtoBuf, Default)]
pub struct SignInRequest {
#[pb(index = 1)]
pub email: String,
#[pb(index = 2)]
pub password: String,
}
#[derive(Default, ProtoBuf)]
pub struct SignInParams {
#[pb(index = 1)]
pub email: String,
#[pb(index = 2)]
pub password: String,
}
#[derive(Debug, Default, ProtoBuf)]
pub struct SignInResponse {
#[pb(index = 1)]
pub uid: String,
#[pb(index = 2)]
pub name: String,
#[pb(index = 3)]
pub email: String,
#[pb(index = 4)]
pub token: String,
}
impl TryInto<SignInParams> for SignInRequest {
type Error = UserError;
fn try_into(self) -> Result<SignInParams, Self::Error> {
let email = UserEmail::parse(self.email).map_err(|e| ErrorBuilder::new(e).build())?;
let password =
UserPassword::parse(self.password).map_err(|e| ErrorBuilder::new(e).build())?;
Ok(SignInParams {
email: email.0,
password: password.0,
})
}
}
#[derive(ProtoBuf, Default)]
pub struct SignUpRequest {
#[pb(index = 1)]
@ -56,3 +101,9 @@ pub struct SignUpResponse {
#[pb(index = 3)]
pub email: String,
}
#[derive(Default, ProtoBuf)]
pub struct SignOutParams {
#[pb(index = 1)]
pub token: String,
}

View File

@ -1,9 +1,6 @@
pub use sign_in::*;
pub use sign_up::*;
pub use auth::*;
pub use user_detail::*;
pub use user_update::*;
pub mod parser;
mod sign_in;
pub mod sign_up;
pub mod auth;
mod user_detail;
mod user_update;

View File

@ -1,51 +0,0 @@
use crate::{entities::parser::*, errors::*};
use flowy_derive::ProtoBuf;
use std::convert::TryInto;
#[derive(ProtoBuf, Default)]
pub struct SignInRequest {
#[pb(index = 1)]
pub email: String,
#[pb(index = 2)]
pub password: String,
}
#[derive(Default, ProtoBuf)]
pub struct SignInParams {
#[pb(index = 1)]
pub email: String,
#[pb(index = 2)]
pub password: String,
}
#[derive(Debug, Default, ProtoBuf)]
pub struct SignInResponse {
#[pb(index = 1)]
pub uid: String,
#[pb(index = 2)]
pub name: String,
#[pb(index = 3)]
pub email: String,
#[pb(index = 4)]
pub token: String,
}
impl TryInto<SignInParams> for SignInRequest {
type Error = UserError;
fn try_into(self) -> Result<SignInParams, Self::Error> {
let email = UserEmail::parse(self.email).map_err(|e| ErrorBuilder::new(e).build())?;
let password =
UserPassword::parse(self.password).map_err(|e| ErrorBuilder::new(e).build())?;
Ok(SignInParams {
email: email.0,
password: password.0,
})
}
}

View File

@ -1,5 +1,11 @@
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
#[derive(Default, ProtoBuf)]
pub struct QueryUserDetailParams {
#[pb(index = 1)]
pub token: String,
}
#[derive(Debug, ProtoBuf_Enum)]
pub enum UserStatus {
Unknown = 0,
@ -23,17 +29,121 @@ pub struct UserDetail {
pub name: String,
#[pb(index = 4)]
pub status: UserStatus,
pub token: String,
}
use crate::sql_tables::UserTable;
use crate::{
entities::parser::{UserEmail, UserId, UserName, UserPassword},
errors::{ErrorBuilder, ErrorCode, UserError},
sql_tables::UserTable,
};
use std::convert::TryInto;
impl std::convert::From<UserTable> for UserDetail {
fn from(user: UserTable) -> Self {
UserDetail {
id: user.id,
email: user.email,
name: user.name,
status: UserStatus::Login,
token: user.token,
}
}
}
#[derive(ProtoBuf, Default)]
pub struct UpdateUserRequest {
#[pb(index = 1)]
pub id: String,
#[pb(index = 2, one_of)]
pub name: Option<String>,
#[pb(index = 3, one_of)]
pub email: Option<String>,
#[pb(index = 4, one_of)]
pub password: Option<String>,
}
impl UpdateUserRequest {
pub fn new(id: &str) -> Self {
Self {
id: id.to_owned(),
..Default::default()
}
}
pub fn name(mut self, name: &str) -> Self {
self.name = Some(name.to_owned());
self
}
pub fn email(mut self, email: &str) -> Self {
self.email = Some(email.to_owned());
self
}
pub fn password(mut self, password: &str) -> Self {
self.password = Some(password.to_owned());
self
}
}
#[derive(ProtoBuf, Default)]
pub struct UpdateUserParams {
#[pb(index = 1)]
pub id: String,
#[pb(index = 2, one_of)]
pub name: Option<String>,
#[pb(index = 3, one_of)]
pub email: Option<String>,
#[pb(index = 4, one_of)]
pub password: Option<String>,
}
impl TryInto<UpdateUserParams> for UpdateUserRequest {
type Error = UserError;
fn try_into(self) -> Result<UpdateUserParams, Self::Error> {
let id = UserId::parse(self.id)
.map_err(|e| ErrorBuilder::new(ErrorCode::UserIdInvalid).msg(e).build())?
.0;
let name = match self.name {
None => None,
Some(name) => Some(
UserName::parse(name)
.map_err(|e| ErrorBuilder::new(e).build())?
.0,
),
};
let email = match self.email {
None => None,
Some(email) => Some(
UserEmail::parse(email)
.map_err(|e| ErrorBuilder::new(e).build())?
.0,
),
};
let password = match self.password {
None => None,
Some(password) => Some(
UserPassword::parse(password)
.map_err(|e| ErrorBuilder::new(e).build())?
.0,
),
};
Ok(UpdateUserParams {
id,
name,
email,
password,
})
}
}

View File

@ -1,104 +0,0 @@
use crate::{
entities::parser::*,
errors::{ErrorBuilder, ErrorCode, UserError},
};
use flowy_derive::ProtoBuf;
use std::convert::TryInto;
#[derive(ProtoBuf, Default)]
pub struct UpdateUserRequest {
#[pb(index = 1)]
pub id: String,
#[pb(index = 2, one_of)]
pub name: Option<String>,
#[pb(index = 3, one_of)]
pub email: Option<String>,
#[pb(index = 4, one_of)]
pub password: Option<String>,
}
impl UpdateUserRequest {
pub fn new(id: &str) -> Self {
Self {
id: id.to_owned(),
..Default::default()
}
}
pub fn name(mut self, name: &str) -> Self {
self.name = Some(name.to_owned());
self
}
pub fn email(mut self, email: &str) -> Self {
self.email = Some(email.to_owned());
self
}
pub fn password(mut self, password: &str) -> Self {
self.password = Some(password.to_owned());
self
}
}
#[derive(ProtoBuf, Default)]
pub struct UpdateUserParams {
#[pb(index = 1)]
pub id: String,
#[pb(index = 2, one_of)]
pub name: Option<String>,
#[pb(index = 3, one_of)]
pub email: Option<String>,
#[pb(index = 4, one_of)]
pub password: Option<String>,
}
impl TryInto<UpdateUserParams> for UpdateUserRequest {
type Error = UserError;
fn try_into(self) -> Result<UpdateUserParams, Self::Error> {
let id = UserId::parse(self.id)
.map_err(|e| ErrorBuilder::new(ErrorCode::UserIdInvalid).msg(e).build())?
.0;
let name = match self.name {
None => None,
Some(name) => Some(
UserName::parse(name)
.map_err(|e| ErrorBuilder::new(e).build())?
.0,
),
};
let email = match self.email {
None => None,
Some(email) => Some(
UserEmail::parse(email)
.map_err(|e| ErrorBuilder::new(e).build())?
.0,
),
};
let password = match self.password {
None => None,
Some(password) => Some(
UserPassword::parse(password)
.map_err(|e| ErrorBuilder::new(e).build())?
.0,
),
};
Ok(UpdateUserParams {
id,
name,
email,
password,
})
}
}

View File

@ -10,7 +10,7 @@ pub async fn get_user_status(session: Unit<Arc<UserSession>>) -> DataResult<User
#[tracing::instrument(name = "sign_out", skip(session))]
pub async fn sign_out(session: Unit<Arc<UserSession>>) -> Result<(), UserError> {
let _ = session.sign_out()?;
let _ = session.sign_out().await?;
Ok(())
}

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,5 @@
// Auto-generated, do not edit
mod sign_up;
pub use sign_up::*;
mod sign_in;
pub use sign_in::*;
mod user_table;
pub use user_table::*;
@ -15,8 +9,8 @@ pub use errors::*;
mod user_detail;
pub use user_detail::*;
mod user_update;
pub use user_update::*;
mod event;
pub use event::*;
mod auth;
pub use auth::*;

View File

@ -1,760 +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 `sign_in.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 SignInRequest {
// message fields
pub email: ::std::string::String,
pub password: ::std::string::String,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a SignInRequest {
fn default() -> &'a SignInRequest {
<SignInRequest as ::protobuf::Message>::default_instance()
}
}
impl SignInRequest {
pub fn new() -> SignInRequest {
::std::default::Default::default()
}
// string email = 1;
pub fn get_email(&self) -> &str {
&self.email
}
pub fn clear_email(&mut self) {
self.email.clear();
}
// Param is passed by value, moved
pub fn set_email(&mut self, v: ::std::string::String) {
self.email = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_email(&mut self) -> &mut ::std::string::String {
&mut self.email
}
// Take field
pub fn take_email(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.email, ::std::string::String::new())
}
// string password = 2;
pub fn get_password(&self) -> &str {
&self.password
}
pub fn clear_password(&mut self) {
self.password.clear();
}
// Param is passed by value, moved
pub fn set_password(&mut self, v: ::std::string::String) {
self.password = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_password(&mut self) -> &mut ::std::string::String {
&mut self.password
}
// Take field
pub fn take_password(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.password, ::std::string::String::new())
}
}
impl ::protobuf::Message for SignInRequest {
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.email)?;
},
2 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.password)?;
},
_ => {
::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.email.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.email);
}
if !self.password.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.password);
}
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.email.is_empty() {
os.write_string(1, &self.email)?;
}
if !self.password.is_empty() {
os.write_string(2, &self.password)?;
}
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() -> SignInRequest {
SignInRequest::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>(
"email",
|m: &SignInRequest| { &m.email },
|m: &mut SignInRequest| { &mut m.email },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"password",
|m: &SignInRequest| { &m.password },
|m: &mut SignInRequest| { &mut m.password },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<SignInRequest>(
"SignInRequest",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static SignInRequest {
static instance: ::protobuf::rt::LazyV2<SignInRequest> = ::protobuf::rt::LazyV2::INIT;
instance.get(SignInRequest::new)
}
}
impl ::protobuf::Clear for SignInRequest {
fn clear(&mut self) {
self.email.clear();
self.password.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for SignInRequest {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SignInRequest {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct SignInParams {
// message fields
pub email: ::std::string::String,
pub password: ::std::string::String,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a SignInParams {
fn default() -> &'a SignInParams {
<SignInParams as ::protobuf::Message>::default_instance()
}
}
impl SignInParams {
pub fn new() -> SignInParams {
::std::default::Default::default()
}
// string email = 1;
pub fn get_email(&self) -> &str {
&self.email
}
pub fn clear_email(&mut self) {
self.email.clear();
}
// Param is passed by value, moved
pub fn set_email(&mut self, v: ::std::string::String) {
self.email = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_email(&mut self) -> &mut ::std::string::String {
&mut self.email
}
// Take field
pub fn take_email(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.email, ::std::string::String::new())
}
// string password = 2;
pub fn get_password(&self) -> &str {
&self.password
}
pub fn clear_password(&mut self) {
self.password.clear();
}
// Param is passed by value, moved
pub fn set_password(&mut self, v: ::std::string::String) {
self.password = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_password(&mut self) -> &mut ::std::string::String {
&mut self.password
}
// Take field
pub fn take_password(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.password, ::std::string::String::new())
}
}
impl ::protobuf::Message for SignInParams {
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.email)?;
},
2 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.password)?;
},
_ => {
::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.email.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.email);
}
if !self.password.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.password);
}
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.email.is_empty() {
os.write_string(1, &self.email)?;
}
if !self.password.is_empty() {
os.write_string(2, &self.password)?;
}
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() -> SignInParams {
SignInParams::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>(
"email",
|m: &SignInParams| { &m.email },
|m: &mut SignInParams| { &mut m.email },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"password",
|m: &SignInParams| { &m.password },
|m: &mut SignInParams| { &mut m.password },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<SignInParams>(
"SignInParams",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static SignInParams {
static instance: ::protobuf::rt::LazyV2<SignInParams> = ::protobuf::rt::LazyV2::INIT;
instance.get(SignInParams::new)
}
}
impl ::protobuf::Clear for SignInParams {
fn clear(&mut self) {
self.email.clear();
self.password.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for SignInParams {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SignInParams {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct SignInResponse {
// message fields
pub uid: ::std::string::String,
pub name: ::std::string::String,
pub email: ::std::string::String,
pub token: ::std::string::String,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a SignInResponse {
fn default() -> &'a SignInResponse {
<SignInResponse as ::protobuf::Message>::default_instance()
}
}
impl SignInResponse {
pub fn new() -> SignInResponse {
::std::default::Default::default()
}
// string uid = 1;
pub fn get_uid(&self) -> &str {
&self.uid
}
pub fn clear_uid(&mut self) {
self.uid.clear();
}
// Param is passed by value, moved
pub fn set_uid(&mut self, v: ::std::string::String) {
self.uid = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_uid(&mut self) -> &mut ::std::string::String {
&mut self.uid
}
// Take field
pub fn take_uid(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.uid, ::std::string::String::new())
}
// string name = 2;
pub fn get_name(&self) -> &str {
&self.name
}
pub fn clear_name(&mut self) {
self.name.clear();
}
// Param is passed by value, moved
pub fn set_name(&mut self, v: ::std::string::String) {
self.name = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_name(&mut self) -> &mut ::std::string::String {
&mut self.name
}
// Take field
pub fn take_name(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.name, ::std::string::String::new())
}
// string email = 3;
pub fn get_email(&self) -> &str {
&self.email
}
pub fn clear_email(&mut self) {
self.email.clear();
}
// Param is passed by value, moved
pub fn set_email(&mut self, v: ::std::string::String) {
self.email = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_email(&mut self) -> &mut ::std::string::String {
&mut self.email
}
// Take field
pub fn take_email(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.email, ::std::string::String::new())
}
// string token = 4;
pub fn get_token(&self) -> &str {
&self.token
}
pub fn clear_token(&mut self) {
self.token.clear();
}
// Param is passed by value, moved
pub fn set_token(&mut self, v: ::std::string::String) {
self.token = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_token(&mut self) -> &mut ::std::string::String {
&mut self.token
}
// Take field
pub fn take_token(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.token, ::std::string::String::new())
}
}
impl ::protobuf::Message for SignInResponse {
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.uid)?;
},
2 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
},
3 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.email)?;
},
4 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.token)?;
},
_ => {
::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.uid.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.uid);
}
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.name);
}
if !self.email.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.email);
}
if !self.token.is_empty() {
my_size += ::protobuf::rt::string_size(4, &self.token);
}
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.uid.is_empty() {
os.write_string(1, &self.uid)?;
}
if !self.name.is_empty() {
os.write_string(2, &self.name)?;
}
if !self.email.is_empty() {
os.write_string(3, &self.email)?;
}
if !self.token.is_empty() {
os.write_string(4, &self.token)?;
}
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() -> SignInResponse {
SignInResponse::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>(
"uid",
|m: &SignInResponse| { &m.uid },
|m: &mut SignInResponse| { &mut m.uid },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"name",
|m: &SignInResponse| { &m.name },
|m: &mut SignInResponse| { &mut m.name },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"email",
|m: &SignInResponse| { &m.email },
|m: &mut SignInResponse| { &mut m.email },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"token",
|m: &SignInResponse| { &m.token },
|m: &mut SignInResponse| { &mut m.token },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<SignInResponse>(
"SignInResponse",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static SignInResponse {
static instance: ::protobuf::rt::LazyV2<SignInResponse> = ::protobuf::rt::LazyV2::INIT;
instance.get(SignInResponse::new)
}
}
impl ::protobuf::Clear for SignInResponse {
fn clear(&mut self) {
self.uid.clear();
self.name.clear();
self.email.clear();
self.token.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for SignInResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SignInResponse {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\rsign_in.proto\"A\n\rSignInRequest\x12\x14\n\x05email\x18\x01\x20\x01\
(\tR\x05email\x12\x1a\n\x08password\x18\x02\x20\x01(\tR\x08password\"@\n\
\x0cSignInParams\x12\x14\n\x05email\x18\x01\x20\x01(\tR\x05email\x12\x1a\
\n\x08password\x18\x02\x20\x01(\tR\x08password\"b\n\x0eSignInResponse\
\x12\x10\n\x03uid\x18\x01\x20\x01(\tR\x03uid\x12\x12\n\x04name\x18\x02\
\x20\x01(\tR\x04name\x12\x14\n\x05email\x18\x03\x20\x01(\tR\x05email\x12\
\x14\n\x05token\x18\x04\x20\x01(\tR\x05tokenJ\x92\x04\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\
\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x15\n\x0b\n\x04\x04\0\x02\0\
\x12\x03\x03\x04\x15\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\x10\n\x0c\n\x05\x04\0\x02\0\x03\
\x12\x03\x03\x13\x14\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x18\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\x13\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x16\x17\n\
\n\n\x02\x04\x01\x12\x04\x06\0\t\x01\n\n\n\x03\x04\x01\x01\x12\x03\x06\
\x08\x14\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x07\x04\x15\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\x10\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x07\x13\x14\n\x0b\n\
\x04\x04\x01\x02\x01\x12\x03\x08\x04\x18\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\x13\n\
\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x08\x16\x17\n\n\n\x02\x04\x02\x12\
\x04\n\0\x0f\x01\n\n\n\x03\x04\x02\x01\x12\x03\n\x08\x16\n\x0b\n\x04\x04\
\x02\x02\0\x12\x03\x0b\x04\x13\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\x0e\n\x0c\n\x05\x04\
\x02\x02\0\x03\x12\x03\x0b\x11\x12\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\x13\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\r\x04\x15\n\
\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03\r\x04\n\n\x0c\n\x05\x04\x02\x02\
\x02\x01\x12\x03\r\x0b\x10\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\r\x13\
\x14\n\x0b\n\x04\x04\x02\x02\x03\x12\x03\x0e\x04\x15\n\x0c\n\x05\x04\x02\
\x02\x03\x05\x12\x03\x0e\x04\n\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03\
\x0e\x0b\x10\n\x0c\n\x05\x04\x02\x02\x03\x03\x12\x03\x0e\x13\x14b\x06pro\
to3\
";
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()
})
}

View File

@ -1,805 +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 `sign_up.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 SignUpRequest {
// message fields
pub email: ::std::string::String,
pub name: ::std::string::String,
pub password: ::std::string::String,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a SignUpRequest {
fn default() -> &'a SignUpRequest {
<SignUpRequest as ::protobuf::Message>::default_instance()
}
}
impl SignUpRequest {
pub fn new() -> SignUpRequest {
::std::default::Default::default()
}
// string email = 1;
pub fn get_email(&self) -> &str {
&self.email
}
pub fn clear_email(&mut self) {
self.email.clear();
}
// Param is passed by value, moved
pub fn set_email(&mut self, v: ::std::string::String) {
self.email = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_email(&mut self) -> &mut ::std::string::String {
&mut self.email
}
// Take field
pub fn take_email(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.email, ::std::string::String::new())
}
// string name = 2;
pub fn get_name(&self) -> &str {
&self.name
}
pub fn clear_name(&mut self) {
self.name.clear();
}
// Param is passed by value, moved
pub fn set_name(&mut self, v: ::std::string::String) {
self.name = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_name(&mut self) -> &mut ::std::string::String {
&mut self.name
}
// Take field
pub fn take_name(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.name, ::std::string::String::new())
}
// string password = 3;
pub fn get_password(&self) -> &str {
&self.password
}
pub fn clear_password(&mut self) {
self.password.clear();
}
// Param is passed by value, moved
pub fn set_password(&mut self, v: ::std::string::String) {
self.password = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_password(&mut self) -> &mut ::std::string::String {
&mut self.password
}
// Take field
pub fn take_password(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.password, ::std::string::String::new())
}
}
impl ::protobuf::Message for SignUpRequest {
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.email)?;
},
2 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
},
3 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.password)?;
},
_ => {
::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.email.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.email);
}
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.name);
}
if !self.password.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.password);
}
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.email.is_empty() {
os.write_string(1, &self.email)?;
}
if !self.name.is_empty() {
os.write_string(2, &self.name)?;
}
if !self.password.is_empty() {
os.write_string(3, &self.password)?;
}
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() -> SignUpRequest {
SignUpRequest::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>(
"email",
|m: &SignUpRequest| { &m.email },
|m: &mut SignUpRequest| { &mut m.email },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"name",
|m: &SignUpRequest| { &m.name },
|m: &mut SignUpRequest| { &mut m.name },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"password",
|m: &SignUpRequest| { &m.password },
|m: &mut SignUpRequest| { &mut m.password },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<SignUpRequest>(
"SignUpRequest",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static SignUpRequest {
static instance: ::protobuf::rt::LazyV2<SignUpRequest> = ::protobuf::rt::LazyV2::INIT;
instance.get(SignUpRequest::new)
}
}
impl ::protobuf::Clear for SignUpRequest {
fn clear(&mut self) {
self.email.clear();
self.name.clear();
self.password.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for SignUpRequest {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SignUpRequest {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct SignUpParams {
// message fields
pub email: ::std::string::String,
pub name: ::std::string::String,
pub password: ::std::string::String,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a SignUpParams {
fn default() -> &'a SignUpParams {
<SignUpParams as ::protobuf::Message>::default_instance()
}
}
impl SignUpParams {
pub fn new() -> SignUpParams {
::std::default::Default::default()
}
// string email = 1;
pub fn get_email(&self) -> &str {
&self.email
}
pub fn clear_email(&mut self) {
self.email.clear();
}
// Param is passed by value, moved
pub fn set_email(&mut self, v: ::std::string::String) {
self.email = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_email(&mut self) -> &mut ::std::string::String {
&mut self.email
}
// Take field
pub fn take_email(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.email, ::std::string::String::new())
}
// string name = 2;
pub fn get_name(&self) -> &str {
&self.name
}
pub fn clear_name(&mut self) {
self.name.clear();
}
// Param is passed by value, moved
pub fn set_name(&mut self, v: ::std::string::String) {
self.name = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_name(&mut self) -> &mut ::std::string::String {
&mut self.name
}
// Take field
pub fn take_name(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.name, ::std::string::String::new())
}
// string password = 3;
pub fn get_password(&self) -> &str {
&self.password
}
pub fn clear_password(&mut self) {
self.password.clear();
}
// Param is passed by value, moved
pub fn set_password(&mut self, v: ::std::string::String) {
self.password = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_password(&mut self) -> &mut ::std::string::String {
&mut self.password
}
// Take field
pub fn take_password(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.password, ::std::string::String::new())
}
}
impl ::protobuf::Message for SignUpParams {
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.email)?;
},
2 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
},
3 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.password)?;
},
_ => {
::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.email.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.email);
}
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.name);
}
if !self.password.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.password);
}
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.email.is_empty() {
os.write_string(1, &self.email)?;
}
if !self.name.is_empty() {
os.write_string(2, &self.name)?;
}
if !self.password.is_empty() {
os.write_string(3, &self.password)?;
}
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() -> SignUpParams {
SignUpParams::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>(
"email",
|m: &SignUpParams| { &m.email },
|m: &mut SignUpParams| { &mut m.email },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"name",
|m: &SignUpParams| { &m.name },
|m: &mut SignUpParams| { &mut m.name },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"password",
|m: &SignUpParams| { &m.password },
|m: &mut SignUpParams| { &mut m.password },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<SignUpParams>(
"SignUpParams",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static SignUpParams {
static instance: ::protobuf::rt::LazyV2<SignUpParams> = ::protobuf::rt::LazyV2::INIT;
instance.get(SignUpParams::new)
}
}
impl ::protobuf::Clear for SignUpParams {
fn clear(&mut self) {
self.email.clear();
self.name.clear();
self.password.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for SignUpParams {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SignUpParams {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct SignUpResponse {
// message fields
pub uid: ::std::string::String,
pub name: ::std::string::String,
pub email: ::std::string::String,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a SignUpResponse {
fn default() -> &'a SignUpResponse {
<SignUpResponse as ::protobuf::Message>::default_instance()
}
}
impl SignUpResponse {
pub fn new() -> SignUpResponse {
::std::default::Default::default()
}
// string uid = 1;
pub fn get_uid(&self) -> &str {
&self.uid
}
pub fn clear_uid(&mut self) {
self.uid.clear();
}
// Param is passed by value, moved
pub fn set_uid(&mut self, v: ::std::string::String) {
self.uid = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_uid(&mut self) -> &mut ::std::string::String {
&mut self.uid
}
// Take field
pub fn take_uid(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.uid, ::std::string::String::new())
}
// string name = 2;
pub fn get_name(&self) -> &str {
&self.name
}
pub fn clear_name(&mut self) {
self.name.clear();
}
// Param is passed by value, moved
pub fn set_name(&mut self, v: ::std::string::String) {
self.name = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_name(&mut self) -> &mut ::std::string::String {
&mut self.name
}
// Take field
pub fn take_name(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.name, ::std::string::String::new())
}
// string email = 3;
pub fn get_email(&self) -> &str {
&self.email
}
pub fn clear_email(&mut self) {
self.email.clear();
}
// Param is passed by value, moved
pub fn set_email(&mut self, v: ::std::string::String) {
self.email = v;
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_email(&mut self) -> &mut ::std::string::String {
&mut self.email
}
// Take field
pub fn take_email(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.email, ::std::string::String::new())
}
}
impl ::protobuf::Message for SignUpResponse {
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.uid)?;
},
2 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
},
3 => {
::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.email)?;
},
_ => {
::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.uid.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.uid);
}
if !self.name.is_empty() {
my_size += ::protobuf::rt::string_size(2, &self.name);
}
if !self.email.is_empty() {
my_size += ::protobuf::rt::string_size(3, &self.email);
}
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.uid.is_empty() {
os.write_string(1, &self.uid)?;
}
if !self.name.is_empty() {
os.write_string(2, &self.name)?;
}
if !self.email.is_empty() {
os.write_string(3, &self.email)?;
}
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() -> SignUpResponse {
SignUpResponse::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>(
"uid",
|m: &SignUpResponse| { &m.uid },
|m: &mut SignUpResponse| { &mut m.uid },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"name",
|m: &SignUpResponse| { &m.name },
|m: &mut SignUpResponse| { &mut m.name },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
"email",
|m: &SignUpResponse| { &m.email },
|m: &mut SignUpResponse| { &mut m.email },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<SignUpResponse>(
"SignUpResponse",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static SignUpResponse {
static instance: ::protobuf::rt::LazyV2<SignUpResponse> = ::protobuf::rt::LazyV2::INIT;
instance.get(SignUpResponse::new)
}
}
impl ::protobuf::Clear for SignUpResponse {
fn clear(&mut self) {
self.uid.clear();
self.name.clear();
self.email.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for SignUpResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for SignUpResponse {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\rsign_up.proto\"U\n\rSignUpRequest\x12\x14\n\x05email\x18\x01\x20\x01\
(\tR\x05email\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x1a\n\
\x08password\x18\x03\x20\x01(\tR\x08password\"T\n\x0cSignUpParams\x12\
\x14\n\x05email\x18\x01\x20\x01(\tR\x05email\x12\x12\n\x04name\x18\x02\
\x20\x01(\tR\x04name\x12\x1a\n\x08password\x18\x03\x20\x01(\tR\x08passwo\
rd\"L\n\x0eSignUpResponse\x12\x10\n\x03uid\x18\x01\x20\x01(\tR\x03uid\
\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x14\n\x05email\x18\
\x03\x20\x01(\tR\x05emailJ\xc9\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\x06\x01\n\n\n\x03\x04\
\0\x01\x12\x03\x02\x08\x15\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x15\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\x10\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x13\x14\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\x18\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\x13\n\x0c\n\x05\x04\0\x02\
\x02\x03\x12\x03\x05\x16\x17\n\n\n\x02\x04\x01\x12\x04\x07\0\x0b\x01\n\n\
\n\x03\x04\x01\x01\x12\x03\x07\x08\x14\n\x0b\n\x04\x04\x01\x02\0\x12\x03\
\x08\x04\x15\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x08\x04\n\n\x0c\n\x05\
\x04\x01\x02\0\x01\x12\x03\x08\x0b\x10\n\x0c\n\x05\x04\x01\x02\0\x03\x12\
\x03\x08\x13\x14\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\t\x04\x14\n\x0c\n\
\x05\x04\x01\x02\x01\x05\x12\x03\t\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\
\x12\x03\t\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\t\x12\x13\n\
\x0b\n\x04\x04\x01\x02\x02\x12\x03\n\x04\x18\n\x0c\n\x05\x04\x01\x02\x02\
\x05\x12\x03\n\x04\n\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\n\x0b\x13\n\
\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\n\x16\x17\n\n\n\x02\x04\x02\x12\
\x04\x0c\0\x10\x01\n\n\n\x03\x04\x02\x01\x12\x03\x0c\x08\x16\n\x0b\n\x04\
\x04\x02\x02\0\x12\x03\r\x04\x13\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\x0e\n\x0c\n\x05\x04\
\x02\x02\0\x03\x12\x03\r\x11\x12\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x0e\
\x04\x14\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x0e\x04\n\n\x0c\n\x05\
\x04\x02\x02\x01\x01\x12\x03\x0e\x0b\x0f\n\x0c\n\x05\x04\x02\x02\x01\x03\
\x12\x03\x0e\x12\x13\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\x0f\x04\x15\n\
\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03\x0f\x04\n\n\x0c\n\x05\x04\x02\x02\
\x02\x01\x12\x03\x0f\x0b\x10\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\x0f\
\x13\x14b\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()
})
}

File diff suppressed because it is too large Load Diff

View File

@ -1,886 +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 `user_update.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 UpdateUserRequest {
// message fields
pub id: ::std::string::String,
// message oneof groups
pub one_of_name: ::std::option::Option<UpdateUserRequest_oneof_one_of_name>,
pub one_of_email: ::std::option::Option<UpdateUserRequest_oneof_one_of_email>,
pub one_of_password: ::std::option::Option<UpdateUserRequest_oneof_one_of_password>,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a UpdateUserRequest {
fn default() -> &'a UpdateUserRequest {
<UpdateUserRequest as ::protobuf::Message>::default_instance()
}
}
#[derive(Clone,PartialEq,Debug)]
pub enum UpdateUserRequest_oneof_one_of_name {
name(::std::string::String),
}
#[derive(Clone,PartialEq,Debug)]
pub enum UpdateUserRequest_oneof_one_of_email {
email(::std::string::String),
}
#[derive(Clone,PartialEq,Debug)]
pub enum UpdateUserRequest_oneof_one_of_password {
password(::std::string::String),
}
impl UpdateUserRequest {
pub fn new() -> UpdateUserRequest {
::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 name = 2;
pub fn get_name(&self) -> &str {
match self.one_of_name {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(ref v)) => v,
_ => "",
}
}
pub fn clear_name(&mut self) {
self.one_of_name = ::std::option::Option::None;
}
pub fn has_name(&self) -> bool {
match self.one_of_name {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(..)) => true,
_ => false,
}
}
// Param is passed by value, moved
pub fn set_name(&mut self, v: ::std::string::String) {
self.one_of_name = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(v))
}
// Mutable pointer to the field.
pub fn mut_name(&mut self) -> &mut ::std::string::String {
if let ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(_)) = self.one_of_name {
} else {
self.one_of_name = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(::std::string::String::new()));
}
match self.one_of_name {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(ref mut v)) => v,
_ => panic!(),
}
}
// Take field
pub fn take_name(&mut self) -> ::std::string::String {
if self.has_name() {
match self.one_of_name.take() {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(v)) => v,
_ => panic!(),
}
} else {
::std::string::String::new()
}
}
// string email = 3;
pub fn get_email(&self) -> &str {
match self.one_of_email {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(ref v)) => v,
_ => "",
}
}
pub fn clear_email(&mut self) {
self.one_of_email = ::std::option::Option::None;
}
pub fn has_email(&self) -> bool {
match self.one_of_email {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(..)) => true,
_ => false,
}
}
// Param is passed by value, moved
pub fn set_email(&mut self, v: ::std::string::String) {
self.one_of_email = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(v))
}
// Mutable pointer to the field.
pub fn mut_email(&mut self) -> &mut ::std::string::String {
if let ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(_)) = self.one_of_email {
} else {
self.one_of_email = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(::std::string::String::new()));
}
match self.one_of_email {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(ref mut v)) => v,
_ => panic!(),
}
}
// Take field
pub fn take_email(&mut self) -> ::std::string::String {
if self.has_email() {
match self.one_of_email.take() {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(v)) => v,
_ => panic!(),
}
} else {
::std::string::String::new()
}
}
// string password = 4;
pub fn get_password(&self) -> &str {
match self.one_of_password {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(ref v)) => v,
_ => "",
}
}
pub fn clear_password(&mut self) {
self.one_of_password = ::std::option::Option::None;
}
pub fn has_password(&self) -> bool {
match self.one_of_password {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(..)) => true,
_ => false,
}
}
// Param is passed by value, moved
pub fn set_password(&mut self, v: ::std::string::String) {
self.one_of_password = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(v))
}
// Mutable pointer to the field.
pub fn mut_password(&mut self) -> &mut ::std::string::String {
if let ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(_)) = self.one_of_password {
} else {
self.one_of_password = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(::std::string::String::new()));
}
match self.one_of_password {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(ref mut v)) => v,
_ => panic!(),
}
}
// Take field
pub fn take_password(&mut self) -> ::std::string::String {
if self.has_password() {
match self.one_of_password.take() {
::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(v)) => v,
_ => panic!(),
}
} else {
::std::string::String::new()
}
}
}
impl ::protobuf::Message for UpdateUserRequest {
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_name = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(is.read_string()?));
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.one_of_email = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(is.read_string()?));
},
4 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.one_of_password = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(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_name {
match v {
&UpdateUserRequest_oneof_one_of_name::name(ref v) => {
my_size += ::protobuf::rt::string_size(2, &v);
},
};
}
if let ::std::option::Option::Some(ref v) = self.one_of_email {
match v {
&UpdateUserRequest_oneof_one_of_email::email(ref v) => {
my_size += ::protobuf::rt::string_size(3, &v);
},
};
}
if let ::std::option::Option::Some(ref v) = self.one_of_password {
match v {
&UpdateUserRequest_oneof_one_of_password::password(ref v) => {
my_size += ::protobuf::rt::string_size(4, &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_name {
match v {
&UpdateUserRequest_oneof_one_of_name::name(ref v) => {
os.write_string(2, v)?;
},
};
}
if let ::std::option::Option::Some(ref v) = self.one_of_email {
match v {
&UpdateUserRequest_oneof_one_of_email::email(ref v) => {
os.write_string(3, v)?;
},
};
}
if let ::std::option::Option::Some(ref v) = self.one_of_password {
match v {
&UpdateUserRequest_oneof_one_of_password::password(ref v) => {
os.write_string(4, 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() -> UpdateUserRequest {
UpdateUserRequest::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: &UpdateUserRequest| { &m.id },
|m: &mut UpdateUserRequest| { &mut m.id },
));
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
"name",
UpdateUserRequest::has_name,
UpdateUserRequest::get_name,
));
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
"email",
UpdateUserRequest::has_email,
UpdateUserRequest::get_email,
));
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
"password",
UpdateUserRequest::has_password,
UpdateUserRequest::get_password,
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateUserRequest>(
"UpdateUserRequest",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static UpdateUserRequest {
static instance: ::protobuf::rt::LazyV2<UpdateUserRequest> = ::protobuf::rt::LazyV2::INIT;
instance.get(UpdateUserRequest::new)
}
}
impl ::protobuf::Clear for UpdateUserRequest {
fn clear(&mut self) {
self.id.clear();
self.one_of_name = ::std::option::Option::None;
self.one_of_email = ::std::option::Option::None;
self.one_of_password = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for UpdateUserRequest {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for UpdateUserRequest {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct UpdateUserParams {
// message fields
pub id: ::std::string::String,
// message oneof groups
pub one_of_name: ::std::option::Option<UpdateUserParams_oneof_one_of_name>,
pub one_of_email: ::std::option::Option<UpdateUserParams_oneof_one_of_email>,
pub one_of_password: ::std::option::Option<UpdateUserParams_oneof_one_of_password>,
// special fields
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a UpdateUserParams {
fn default() -> &'a UpdateUserParams {
<UpdateUserParams as ::protobuf::Message>::default_instance()
}
}
#[derive(Clone,PartialEq,Debug)]
pub enum UpdateUserParams_oneof_one_of_name {
name(::std::string::String),
}
#[derive(Clone,PartialEq,Debug)]
pub enum UpdateUserParams_oneof_one_of_email {
email(::std::string::String),
}
#[derive(Clone,PartialEq,Debug)]
pub enum UpdateUserParams_oneof_one_of_password {
password(::std::string::String),
}
impl UpdateUserParams {
pub fn new() -> UpdateUserParams {
::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 name = 2;
pub fn get_name(&self) -> &str {
match self.one_of_name {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_name::name(ref v)) => v,
_ => "",
}
}
pub fn clear_name(&mut self) {
self.one_of_name = ::std::option::Option::None;
}
pub fn has_name(&self) -> bool {
match self.one_of_name {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_name::name(..)) => true,
_ => false,
}
}
// Param is passed by value, moved
pub fn set_name(&mut self, v: ::std::string::String) {
self.one_of_name = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_name::name(v))
}
// Mutable pointer to the field.
pub fn mut_name(&mut self) -> &mut ::std::string::String {
if let ::std::option::Option::Some(UpdateUserParams_oneof_one_of_name::name(_)) = self.one_of_name {
} else {
self.one_of_name = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_name::name(::std::string::String::new()));
}
match self.one_of_name {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_name::name(ref mut v)) => v,
_ => panic!(),
}
}
// Take field
pub fn take_name(&mut self) -> ::std::string::String {
if self.has_name() {
match self.one_of_name.take() {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_name::name(v)) => v,
_ => panic!(),
}
} else {
::std::string::String::new()
}
}
// string email = 3;
pub fn get_email(&self) -> &str {
match self.one_of_email {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_email::email(ref v)) => v,
_ => "",
}
}
pub fn clear_email(&mut self) {
self.one_of_email = ::std::option::Option::None;
}
pub fn has_email(&self) -> bool {
match self.one_of_email {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_email::email(..)) => true,
_ => false,
}
}
// Param is passed by value, moved
pub fn set_email(&mut self, v: ::std::string::String) {
self.one_of_email = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_email::email(v))
}
// Mutable pointer to the field.
pub fn mut_email(&mut self) -> &mut ::std::string::String {
if let ::std::option::Option::Some(UpdateUserParams_oneof_one_of_email::email(_)) = self.one_of_email {
} else {
self.one_of_email = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_email::email(::std::string::String::new()));
}
match self.one_of_email {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_email::email(ref mut v)) => v,
_ => panic!(),
}
}
// Take field
pub fn take_email(&mut self) -> ::std::string::String {
if self.has_email() {
match self.one_of_email.take() {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_email::email(v)) => v,
_ => panic!(),
}
} else {
::std::string::String::new()
}
}
// string password = 4;
pub fn get_password(&self) -> &str {
match self.one_of_password {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_password::password(ref v)) => v,
_ => "",
}
}
pub fn clear_password(&mut self) {
self.one_of_password = ::std::option::Option::None;
}
pub fn has_password(&self) -> bool {
match self.one_of_password {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_password::password(..)) => true,
_ => false,
}
}
// Param is passed by value, moved
pub fn set_password(&mut self, v: ::std::string::String) {
self.one_of_password = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_password::password(v))
}
// Mutable pointer to the field.
pub fn mut_password(&mut self) -> &mut ::std::string::String {
if let ::std::option::Option::Some(UpdateUserParams_oneof_one_of_password::password(_)) = self.one_of_password {
} else {
self.one_of_password = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_password::password(::std::string::String::new()));
}
match self.one_of_password {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_password::password(ref mut v)) => v,
_ => panic!(),
}
}
// Take field
pub fn take_password(&mut self) -> ::std::string::String {
if self.has_password() {
match self.one_of_password.take() {
::std::option::Option::Some(UpdateUserParams_oneof_one_of_password::password(v)) => v,
_ => panic!(),
}
} else {
::std::string::String::new()
}
}
}
impl ::protobuf::Message for UpdateUserParams {
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_name = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_name::name(is.read_string()?));
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.one_of_email = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_email::email(is.read_string()?));
},
4 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.one_of_password = ::std::option::Option::Some(UpdateUserParams_oneof_one_of_password::password(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_name {
match v {
&UpdateUserParams_oneof_one_of_name::name(ref v) => {
my_size += ::protobuf::rt::string_size(2, &v);
},
};
}
if let ::std::option::Option::Some(ref v) = self.one_of_email {
match v {
&UpdateUserParams_oneof_one_of_email::email(ref v) => {
my_size += ::protobuf::rt::string_size(3, &v);
},
};
}
if let ::std::option::Option::Some(ref v) = self.one_of_password {
match v {
&UpdateUserParams_oneof_one_of_password::password(ref v) => {
my_size += ::protobuf::rt::string_size(4, &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_name {
match v {
&UpdateUserParams_oneof_one_of_name::name(ref v) => {
os.write_string(2, v)?;
},
};
}
if let ::std::option::Option::Some(ref v) = self.one_of_email {
match v {
&UpdateUserParams_oneof_one_of_email::email(ref v) => {
os.write_string(3, v)?;
},
};
}
if let ::std::option::Option::Some(ref v) = self.one_of_password {
match v {
&UpdateUserParams_oneof_one_of_password::password(ref v) => {
os.write_string(4, 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() -> UpdateUserParams {
UpdateUserParams::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: &UpdateUserParams| { &m.id },
|m: &mut UpdateUserParams| { &mut m.id },
));
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
"name",
UpdateUserParams::has_name,
UpdateUserParams::get_name,
));
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
"email",
UpdateUserParams::has_email,
UpdateUserParams::get_email,
));
fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
"password",
UpdateUserParams::has_password,
UpdateUserParams::get_password,
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateUserParams>(
"UpdateUserParams",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static UpdateUserParams {
static instance: ::protobuf::rt::LazyV2<UpdateUserParams> = ::protobuf::rt::LazyV2::INIT;
instance.get(UpdateUserParams::new)
}
}
impl ::protobuf::Clear for UpdateUserParams {
fn clear(&mut self) {
self.id.clear();
self.one_of_name = ::std::option::Option::None;
self.one_of_email = ::std::option::Option::None;
self.one_of_password = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for UpdateUserParams {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for UpdateUserParams {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x11user_update.proto\"\xa1\x01\n\x11UpdateUserRequest\x12\x0e\n\x02id\
\x18\x01\x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04n\
ame\x12\x16\n\x05email\x18\x03\x20\x01(\tH\x01R\x05email\x12\x1c\n\x08pa\
ssword\x18\x04\x20\x01(\tH\x02R\x08passwordB\r\n\x0bone_of_nameB\x0e\n\
\x0cone_of_emailB\x11\n\x0fone_of_password\"\xa0\x01\n\x10UpdateUserPara\
ms\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\
\x20\x01(\tH\0R\x04name\x12\x16\n\x05email\x18\x03\x20\x01(\tH\x01R\x05e\
mail\x12\x1c\n\x08password\x18\x04\x20\x01(\tH\x02R\x08passwordB\r\n\x0b\
one_of_nameB\x0e\n\x0cone_of_emailB\x11\n\x0fone_of_passwordJ\x9c\x05\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\x07\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\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\x0b\n\x04\x04\0\x08\x01\x12\x03\x05\x04,\n\x0c\
\n\x05\x04\0\x08\x01\x01\x12\x03\x05\n\x16\n\x0b\n\x04\x04\0\x02\x02\x12\
\x03\x05\x19*\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x05\x19\x1f\n\x0c\n\
\x05\x04\0\x02\x02\x01\x12\x03\x05\x20%\n\x0c\n\x05\x04\0\x02\x02\x03\
\x12\x03\x05()\n\x0b\n\x04\x04\0\x08\x02\x12\x03\x06\x042\n\x0c\n\x05\
\x04\0\x08\x02\x01\x12\x03\x06\n\x19\n\x0b\n\x04\x04\0\x02\x03\x12\x03\
\x06\x1c0\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x06\x1c\"\n\x0c\n\x05\
\x04\0\x02\x03\x01\x12\x03\x06#+\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\
\x06./\n\n\n\x02\x04\x01\x12\x04\x08\0\r\x01\n\n\n\x03\x04\x01\x01\x12\
\x03\x08\x08\x18\n\x0b\n\x04\x04\x01\x02\0\x12\x03\t\x04\x12\n\x0c\n\x05\
\x04\x01\x02\0\x05\x12\x03\t\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\
\t\x0b\r\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\t\x10\x11\n\x0b\n\x04\x04\
\x01\x08\0\x12\x03\n\x04*\n\x0c\n\x05\x04\x01\x08\0\x01\x12\x03\n\n\x15\
\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\n\x18(\n\x0c\n\x05\x04\x01\x02\x01\
\x05\x12\x03\n\x18\x1e\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\n\x1f#\n\
\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\n&'\n\x0b\n\x04\x04\x01\x08\x01\
\x12\x03\x0b\x04,\n\x0c\n\x05\x04\x01\x08\x01\x01\x12\x03\x0b\n\x16\n\
\x0b\n\x04\x04\x01\x02\x02\x12\x03\x0b\x19*\n\x0c\n\x05\x04\x01\x02\x02\
\x05\x12\x03\x0b\x19\x1f\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\x0b\x20\
%\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\x0b()\n\x0b\n\x04\x04\x01\x08\
\x02\x12\x03\x0c\x042\n\x0c\n\x05\x04\x01\x08\x02\x01\x12\x03\x0c\n\x19\
\n\x0b\n\x04\x04\x01\x02\x03\x12\x03\x0c\x1c0\n\x0c\n\x05\x04\x01\x02\
\x03\x05\x12\x03\x0c\x1c\"\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x0c#+\
\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03\x0c./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()
})
}

View File

@ -0,0 +1,34 @@
syntax = "proto3";
message SignInRequest {
string email = 1;
string password = 2;
}
message SignInParams {
string email = 1;
string password = 2;
}
message SignInResponse {
string uid = 1;
string name = 2;
string email = 3;
string token = 4;
}
message SignUpRequest {
string email = 1;
string name = 2;
string password = 3;
}
message SignUpParams {
string email = 1;
string name = 2;
string password = 3;
}
message SignUpResponse {
string uid = 1;
string name = 2;
string email = 3;
}
message SignOutParams {
string token = 1;
}

View File

@ -1,16 +0,0 @@
syntax = "proto3";
message SignInRequest {
string email = 1;
string password = 2;
}
message SignInParams {
string email = 1;
string password = 2;
}
message SignInResponse {
string uid = 1;
string name = 2;
string email = 3;
string token = 4;
}

View File

@ -1,17 +0,0 @@
syntax = "proto3";
message SignUpRequest {
string email = 1;
string name = 2;
string password = 3;
}
message SignUpParams {
string email = 1;
string name = 2;
string password = 3;
}
message SignUpResponse {
string uid = 1;
string name = 2;
string email = 3;
}

View File

@ -1,10 +1,25 @@
syntax = "proto3";
message QueryUserDetailParams {
string token = 1;
}
message UserDetail {
string id = 1;
string email = 2;
string name = 3;
UserStatus status = 4;
string token = 4;
}
message UpdateUserRequest {
string id = 1;
oneof one_of_name { string name = 2; };
oneof one_of_email { string email = 3; };
oneof one_of_password { string password = 4; };
}
message UpdateUserParams {
string id = 1;
oneof one_of_name { string name = 2; };
oneof one_of_email { string email = 3; };
oneof one_of_password { string password = 4; };
}
enum UserStatus {
Unknown = 0;

View File

@ -1,14 +0,0 @@
syntax = "proto3";
message UpdateUserRequest {
string id = 1;
oneof one_of_name { string name = 2; };
oneof one_of_email { string email = 3; };
oneof one_of_password { string password = 4; };
}
message UpdateUserParams {
string id = 1;
oneof one_of_name { string name = 2; };
oneof one_of_email { string email = 3; };
oneof one_of_password { string password = 4; };
}

View File

@ -3,12 +3,13 @@ use crate::{
errors::{ErrorBuilder, ErrorCode, UserError},
};
use crate::entities::SignOutParams;
use flowy_net::{config::*, future::ResultFuture, request::HttpRequestBuilder};
pub trait UserServerAPI {
fn sign_up(&self, params: SignUpParams) -> ResultFuture<SignUpResponse, UserError>;
fn sign_in(&self, params: SignInParams) -> ResultFuture<SignInResponse, UserError>;
fn sign_out(&self, user_id: &str) -> ResultFuture<(), UserError>;
fn sign_out(&self, token: &str) -> ResultFuture<(), UserError>;
fn get_user_info(&self, user_id: &str) -> ResultFuture<UserDetail, UserError>;
}
@ -26,7 +27,7 @@ impl UserServerAPI for UserServer {
ResultFuture::new(async move { user_sign_in(params, SIGN_IN_URL.as_ref()).await })
}
fn sign_out(&self, _user_id: &str) -> ResultFuture<(), UserError> {
fn sign_out(&self, _token: &str) -> ResultFuture<(), UserError> {
ResultFuture::new(async { Err(ErrorBuilder::new(ErrorCode::Unknown).build()) })
}
@ -54,3 +55,11 @@ pub async fn user_sign_in(params: SignInParams, url: &str) -> Result<SignInRespo
.await?;
Ok(response)
}
pub async fn user_sign_out(params: SignOutParams, url: &str) -> Result<(), UserError> {
let _ = HttpRequestBuilder::delete(&url.to_owned())
.protobuf(params)?
.send()
.await?;
Ok(())
}

View File

@ -39,7 +39,7 @@ impl UserServerAPI for UserServerMock {
})
}
fn sign_out(&self, _user_id: &str) -> ResultFuture<(), UserError> {
fn sign_out(&self, _token: &str) -> ResultFuture<(), UserError> {
ResultFuture::new(async { Ok(()) })
}

View File

@ -77,12 +77,19 @@ impl UserSession {
Ok(user_table)
}
pub fn sign_out(&self) -> Result<(), UserError> {
let user_id = self.user_id()?;
pub async fn sign_out(&self) -> Result<(), UserError> {
let user_detail = self.user_detail()?;
match self.server.sign_out(&user_detail.token).await {
Ok(_) => {},
Err(e) => log::error!("Sign out failed: {:?}", e),
}
let conn = self.get_db_connection()?;
let _ = diesel::delete(dsl::user_table.filter(dsl::id.eq(&user_id))).execute(&*conn)?;
let _ = self.server.sign_out(&user_id);
let _ = self.database.close_user_db(&user_id)?;
let _ =
diesel::delete(dsl::user_table.filter(dsl::id.eq(&user_detail.id))).execute(&*conn)?;
let _ = self.server.sign_out(&user_detail.id);
let _ = self.database.close_user_db(&user_detail.id)?;
let _ = self.set_user_id(None)?;
Ok(())
@ -156,6 +163,11 @@ impl UserSession {
Some(user_id) => Ok(user_id),
}
}
pub fn user_token(&self) -> Result<String, UserError> {
let user_detail = self.user_detail()?;
Ok(user_detail.token)
}
}
pub fn current_user_id() -> Result<String, UserError> {

View File

@ -6,18 +6,18 @@ use flowy_database::schema::user_table;
pub struct UserTable {
pub(crate) id: String,
pub(crate) name: String,
pub(crate) password: String,
pub(crate) token: String,
pub(crate) email: String,
pub(crate) workspace: String, // deprecated
}
impl UserTable {
pub fn new(id: String, name: String, email: String, password: String) -> Self {
pub fn new(id: String, name: String, email: String, token: String) -> Self {
Self {
id,
name,
email,
password,
token,
workspace: "".to_owned(),
}
}
@ -36,7 +36,7 @@ impl std::convert::From<SignUpResponse> for UserTable {
impl std::convert::From<SignInResponse> for UserTable {
fn from(resp: SignInResponse) -> Self {
UserTable::new(resp.uid, resp.name, resp.email, "".to_owned())
UserTable::new(resp.uid, resp.name, resp.email, resp.token)
}
}
@ -47,7 +47,6 @@ pub struct UserTableChangeset {
pub workspace: Option<String>, // deprecated
pub name: Option<String>,
pub email: Option<String>,
pub password: Option<String>,
}
impl UserTableChangeset {
@ -57,7 +56,6 @@ impl UserTableChangeset {
workspace: None,
name: params.name,
email: params.email,
password: params.password,
}
}
}

View File

@ -1,11 +1,6 @@
use crate::helper::*;
use flowy_workspace::{
entities::workspace::{
CreateWorkspaceRequest,
QueryWorkspaceRequest,
RepeatedWorkspace,
Workspace,
},
entities::workspace::{CreateWorkspaceRequest, QueryWorkspaceRequest, RepeatedWorkspace},
event::WorkspaceEvent::*,
prelude::*,
};

View File

@ -41,6 +41,7 @@ impl DartEventCodeGen {
pub struct DartEventCrate {
crate_path: String,
#[allow(dead_code)]
crate_name: String,
event_files: Vec<String>,
}