auto updated.
This commit is contained in:
parent
50ae2fe358
commit
a1e9bc40b0
|
@ -0,0 +1,169 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated from mail.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
|
||||
|
||||
/// sms module
|
||||
class SendMailRequest extends $pb.GeneratedMessage {
|
||||
factory SendMailRequest({
|
||||
$core.String? provider,
|
||||
$core.String? templateKey,
|
||||
$core.String? to,
|
||||
$core.Iterable<$core.MapEntry<$core.String, $core.String>>? paramters,
|
||||
}) {
|
||||
final result = create();
|
||||
if (provider != null) result.provider = provider;
|
||||
if (templateKey != null) result.templateKey = templateKey;
|
||||
if (to != null) result.to = to;
|
||||
if (paramters != null) result.paramters.addEntries(paramters);
|
||||
return result;
|
||||
}
|
||||
|
||||
SendMailRequest._();
|
||||
|
||||
factory SendMailRequest.fromBuffer($core.List<$core.int> data,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(data, registry);
|
||||
factory SendMailRequest.fromJson($core.String json,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(json, registry);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'SendMailRequest',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'sender'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'provider')
|
||||
..aOS(2, _omitFieldNames ? '' : 'templateKey')
|
||||
..aOS(4, _omitFieldNames ? '' : 'to')
|
||||
..m<$core.String, $core.String>(5, _omitFieldNames ? '' : 'paramters',
|
||||
entryClassName: 'SendMailRequest.ParamtersEntry',
|
||||
keyFieldType: $pb.PbFieldType.OS,
|
||||
valueFieldType: $pb.PbFieldType.OS,
|
||||
packageName: const $pb.PackageName('sender'))
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SendMailRequest clone() => SendMailRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SendMailRequest copyWith(void Function(SendMailRequest) updates) =>
|
||||
super.copyWith((message) => updates(message as SendMailRequest))
|
||||
as SendMailRequest;
|
||||
|
||||
@$core.override
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SendMailRequest create() => SendMailRequest._();
|
||||
@$core.override
|
||||
SendMailRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<SendMailRequest> createRepeated() =>
|
||||
$pb.PbList<SendMailRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SendMailRequest getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<SendMailRequest>(create);
|
||||
static SendMailRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get provider => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set provider($core.String value) => $_setString(0, value);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasProvider() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearProvider() => $_clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get templateKey => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set templateKey($core.String value) => $_setString(1, value);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasTemplateKey() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearTemplateKey() => $_clearField(2);
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.String get to => $_getSZ(2);
|
||||
@$pb.TagNumber(4)
|
||||
set to($core.String value) => $_setString(2, value);
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasTo() => $_has(2);
|
||||
@$pb.TagNumber(4)
|
||||
void clearTo() => $_clearField(4);
|
||||
|
||||
@$pb.TagNumber(5)
|
||||
$pb.PbMap<$core.String, $core.String> get paramters => $_getMap(3);
|
||||
}
|
||||
|
||||
class SendMailReply extends $pb.GeneratedMessage {
|
||||
factory SendMailReply({
|
||||
$core.String? data,
|
||||
}) {
|
||||
final result = create();
|
||||
if (data != null) result.data = data;
|
||||
return result;
|
||||
}
|
||||
|
||||
SendMailReply._();
|
||||
|
||||
factory SendMailReply.fromBuffer($core.List<$core.int> data,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(data, registry);
|
||||
factory SendMailReply.fromJson($core.String json,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(json, registry);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'SendMailReply',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'sender'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'data')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SendMailReply clone() => SendMailReply()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SendMailReply copyWith(void Function(SendMailReply) updates) =>
|
||||
super.copyWith((message) => updates(message as SendMailReply))
|
||||
as SendMailReply;
|
||||
|
||||
@$core.override
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SendMailReply create() => SendMailReply._();
|
||||
@$core.override
|
||||
SendMailReply createEmptyInstance() => create();
|
||||
static $pb.PbList<SendMailReply> createRepeated() =>
|
||||
$pb.PbList<SendMailReply>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SendMailReply getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<SendMailReply>(create);
|
||||
static SendMailReply? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get data => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set data($core.String value) => $_setString(0, value);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasData() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearData() => $_clearField(1);
|
||||
}
|
||||
|
||||
const $core.bool _omitFieldNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const $core.bool _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
|
@ -0,0 +1,11 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated from mail.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names
|
|
@ -0,0 +1,73 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated from mail.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names
|
||||
|
||||
import 'dart:async' as $async;
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:grpc/service_api.dart' as $grpc;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'mail.pb.dart' as $0;
|
||||
|
||||
export 'mail.pb.dart';
|
||||
|
||||
/// Mail method
|
||||
@$pb.GrpcServiceName('sender.Mail')
|
||||
class MailClient extends $grpc.Client {
|
||||
/// The hostname for this service.
|
||||
static const $core.String defaultHost = '';
|
||||
|
||||
/// OAuth scopes needed for the client.
|
||||
static const $core.List<$core.String> oauthScopes = [
|
||||
'',
|
||||
];
|
||||
|
||||
MailClient(super.channel, {super.options, super.interceptors});
|
||||
|
||||
$grpc.ResponseFuture<$0.SendMailReply> send(
|
||||
$0.SendMailRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
}) {
|
||||
return $createUnaryCall(_$send, request, options: options);
|
||||
}
|
||||
|
||||
// method descriptors
|
||||
|
||||
static final _$send =
|
||||
$grpc.ClientMethod<$0.SendMailRequest, $0.SendMailReply>(
|
||||
'/sender.Mail/Send',
|
||||
($0.SendMailRequest value) => value.writeToBuffer(),
|
||||
$0.SendMailReply.fromBuffer);
|
||||
}
|
||||
|
||||
@$pb.GrpcServiceName('sender.Mail')
|
||||
abstract class MailServiceBase extends $grpc.Service {
|
||||
$core.String get $name => 'sender.Mail';
|
||||
|
||||
MailServiceBase() {
|
||||
$addMethod($grpc.ServiceMethod<$0.SendMailRequest, $0.SendMailReply>(
|
||||
'Send',
|
||||
send_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.SendMailRequest.fromBuffer(value),
|
||||
($0.SendMailReply value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
$async.Future<$0.SendMailReply> send_Pre($grpc.ServiceCall $call,
|
||||
$async.Future<$0.SendMailRequest> $request) async {
|
||||
return send($call, await $request);
|
||||
}
|
||||
|
||||
$async.Future<$0.SendMailReply> send(
|
||||
$grpc.ServiceCall call, $0.SendMailRequest request);
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated from mail.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use sendMailRequestDescriptor instead')
|
||||
const SendMailRequest$json = {
|
||||
'1': 'SendMailRequest',
|
||||
'2': [
|
||||
{'1': 'provider', '3': 1, '4': 1, '5': 9, '10': 'provider'},
|
||||
{'1': 'template_key', '3': 2, '4': 1, '5': 9, '10': 'templateKey'},
|
||||
{'1': 'to', '3': 4, '4': 1, '5': 9, '10': 'to'},
|
||||
{
|
||||
'1': 'paramters',
|
||||
'3': 5,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.sender.SendMailRequest.ParamtersEntry',
|
||||
'10': 'paramters'
|
||||
},
|
||||
],
|
||||
'3': [SendMailRequest_ParamtersEntry$json],
|
||||
};
|
||||
|
||||
@$core.Deprecated('Use sendMailRequestDescriptor instead')
|
||||
const SendMailRequest_ParamtersEntry$json = {
|
||||
'1': 'ParamtersEntry',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
],
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
/// Descriptor for `SendMailRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List sendMailRequestDescriptor = $convert.base64Decode(
|
||||
'Cg9TZW5kTWFpbFJlcXVlc3QSGgoIcHJvdmlkZXIYASABKAlSCHByb3ZpZGVyEiEKDHRlbXBsYX'
|
||||
'RlX2tleRgCIAEoCVILdGVtcGxhdGVLZXkSDgoCdG8YBCABKAlSAnRvEkQKCXBhcmFtdGVycxgF'
|
||||
'IAMoCzImLnNlbmRlci5TZW5kTWFpbFJlcXVlc3QuUGFyYW10ZXJzRW50cnlSCXBhcmFtdGVycx'
|
||||
'o8Cg5QYXJhbXRlcnNFbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCgV2YWx1ZRgCIAEoCVIFdmFs'
|
||||
'dWU6AjgB');
|
||||
|
||||
@$core.Deprecated('Use sendMailReplyDescriptor instead')
|
||||
const SendMailReply$json = {
|
||||
'1': 'SendMailReply',
|
||||
'2': [
|
||||
{'1': 'data', '3': 1, '4': 1, '5': 9, '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `SendMailReply`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List sendMailReplyDescriptor =
|
||||
$convert.base64Decode('Cg1TZW5kTWFpbFJlcGx5EhIKBGRhdGEYASABKAlSBGRhdGE=');
|
|
@ -0,0 +1,247 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated from sms.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
|
||||
|
||||
/// sms module
|
||||
class SmsSendRequest extends $pb.GeneratedMessage {
|
||||
factory SmsSendRequest({
|
||||
$core.String? provider,
|
||||
$core.String? signName,
|
||||
$core.String? templateCode,
|
||||
$core.String? phone,
|
||||
$core.Iterable<$core.MapEntry<$core.String, $core.String>>? paramters,
|
||||
}) {
|
||||
final result = create();
|
||||
if (provider != null) result.provider = provider;
|
||||
if (signName != null) result.signName = signName;
|
||||
if (templateCode != null) result.templateCode = templateCode;
|
||||
if (phone != null) result.phone = phone;
|
||||
if (paramters != null) result.paramters.addEntries(paramters);
|
||||
return result;
|
||||
}
|
||||
|
||||
SmsSendRequest._();
|
||||
|
||||
factory SmsSendRequest.fromBuffer($core.List<$core.int> data,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(data, registry);
|
||||
factory SmsSendRequest.fromJson($core.String json,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(json, registry);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'SmsSendRequest',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'sender'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'provider')
|
||||
..aOS(2, _omitFieldNames ? '' : 'signName')
|
||||
..aOS(3, _omitFieldNames ? '' : 'templateCode')
|
||||
..aOS(4, _omitFieldNames ? '' : 'phone')
|
||||
..m<$core.String, $core.String>(5, _omitFieldNames ? '' : 'paramters',
|
||||
entryClassName: 'SmsSendRequest.ParamtersEntry',
|
||||
keyFieldType: $pb.PbFieldType.OS,
|
||||
valueFieldType: $pb.PbFieldType.OS,
|
||||
packageName: const $pb.PackageName('sender'))
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SmsSendRequest clone() => SmsSendRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SmsSendRequest copyWith(void Function(SmsSendRequest) updates) =>
|
||||
super.copyWith((message) => updates(message as SmsSendRequest))
|
||||
as SmsSendRequest;
|
||||
|
||||
@$core.override
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SmsSendRequest create() => SmsSendRequest._();
|
||||
@$core.override
|
||||
SmsSendRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<SmsSendRequest> createRepeated() =>
|
||||
$pb.PbList<SmsSendRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SmsSendRequest getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<SmsSendRequest>(create);
|
||||
static SmsSendRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get provider => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set provider($core.String value) => $_setString(0, value);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasProvider() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearProvider() => $_clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get signName => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set signName($core.String value) => $_setString(1, value);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasSignName() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearSignName() => $_clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get templateCode => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set templateCode($core.String value) => $_setString(2, value);
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasTemplateCode() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearTemplateCode() => $_clearField(3);
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.String get phone => $_getSZ(3);
|
||||
@$pb.TagNumber(4)
|
||||
set phone($core.String value) => $_setString(3, value);
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasPhone() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearPhone() => $_clearField(4);
|
||||
|
||||
@$pb.TagNumber(5)
|
||||
$pb.PbMap<$core.String, $core.String> get paramters => $_getMap(4);
|
||||
}
|
||||
|
||||
class SmsReply extends $pb.GeneratedMessage {
|
||||
factory SmsReply({
|
||||
$core.String? reply,
|
||||
}) {
|
||||
final result = create();
|
||||
if (reply != null) result.reply = reply;
|
||||
return result;
|
||||
}
|
||||
|
||||
SmsReply._();
|
||||
|
||||
factory SmsReply.fromBuffer($core.List<$core.int> data,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(data, registry);
|
||||
factory SmsReply.fromJson($core.String json,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(json, registry);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'SmsReply',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'sender'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'reply')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SmsReply clone() => SmsReply()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SmsReply copyWith(void Function(SmsReply) updates) =>
|
||||
super.copyWith((message) => updates(message as SmsReply)) as SmsReply;
|
||||
|
||||
@$core.override
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SmsReply create() => SmsReply._();
|
||||
@$core.override
|
||||
SmsReply createEmptyInstance() => create();
|
||||
static $pb.PbList<SmsReply> createRepeated() => $pb.PbList<SmsReply>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SmsReply getDefault() =>
|
||||
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SmsReply>(create);
|
||||
static SmsReply? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get reply => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set reply($core.String value) => $_setString(0, value);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasReply() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearReply() => $_clearField(1);
|
||||
}
|
||||
|
||||
class SmsVerifyRequest extends $pb.GeneratedMessage {
|
||||
factory SmsVerifyRequest({
|
||||
$core.String? phone,
|
||||
$core.String? code,
|
||||
}) {
|
||||
final result = create();
|
||||
if (phone != null) result.phone = phone;
|
||||
if (code != null) result.code = code;
|
||||
return result;
|
||||
}
|
||||
|
||||
SmsVerifyRequest._();
|
||||
|
||||
factory SmsVerifyRequest.fromBuffer($core.List<$core.int> data,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(data, registry);
|
||||
factory SmsVerifyRequest.fromJson($core.String json,
|
||||
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(json, registry);
|
||||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
_omitMessageNames ? '' : 'SmsVerifyRequest',
|
||||
package: const $pb.PackageName(_omitMessageNames ? '' : 'sender'),
|
||||
createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'phone')
|
||||
..aOS(2, _omitFieldNames ? '' : 'code')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SmsVerifyRequest clone() => SmsVerifyRequest()..mergeFromMessage(this);
|
||||
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||
SmsVerifyRequest copyWith(void Function(SmsVerifyRequest) updates) =>
|
||||
super.copyWith((message) => updates(message as SmsVerifyRequest))
|
||||
as SmsVerifyRequest;
|
||||
|
||||
@$core.override
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SmsVerifyRequest create() => SmsVerifyRequest._();
|
||||
@$core.override
|
||||
SmsVerifyRequest createEmptyInstance() => create();
|
||||
static $pb.PbList<SmsVerifyRequest> createRepeated() =>
|
||||
$pb.PbList<SmsVerifyRequest>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static SmsVerifyRequest getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<SmsVerifyRequest>(create);
|
||||
static SmsVerifyRequest? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.String get phone => $_getSZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set phone($core.String value) => $_setString(0, value);
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasPhone() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearPhone() => $_clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get code => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set code($core.String value) => $_setString(1, value);
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasCode() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearCode() => $_clearField(2);
|
||||
}
|
||||
|
||||
const $core.bool _omitFieldNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||
const $core.bool _omitMessageNames =
|
||||
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
|
@ -0,0 +1,11 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated from sms.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names
|
|
@ -0,0 +1,98 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated from sms.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names
|
||||
|
||||
import 'dart:async' as $async;
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:grpc/service_api.dart' as $grpc;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
import 'sms.pb.dart' as $0;
|
||||
|
||||
export 'sms.pb.dart';
|
||||
|
||||
/// sms method
|
||||
@$pb.GrpcServiceName('sender.Sms')
|
||||
class SmsClient extends $grpc.Client {
|
||||
/// The hostname for this service.
|
||||
static const $core.String defaultHost = '';
|
||||
|
||||
/// OAuth scopes needed for the client.
|
||||
static const $core.List<$core.String> oauthScopes = [
|
||||
'',
|
||||
];
|
||||
|
||||
SmsClient(super.channel, {super.options, super.interceptors});
|
||||
|
||||
$grpc.ResponseFuture<$0.SmsReply> send(
|
||||
$0.SmsSendRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
}) {
|
||||
return $createUnaryCall(_$send, request, options: options);
|
||||
}
|
||||
|
||||
$grpc.ResponseFuture<$0.SmsReply> verify(
|
||||
$0.SmsVerifyRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
}) {
|
||||
return $createUnaryCall(_$verify, request, options: options);
|
||||
}
|
||||
|
||||
// method descriptors
|
||||
|
||||
static final _$send = $grpc.ClientMethod<$0.SmsSendRequest, $0.SmsReply>(
|
||||
'/sender.Sms/Send',
|
||||
($0.SmsSendRequest value) => value.writeToBuffer(),
|
||||
$0.SmsReply.fromBuffer);
|
||||
static final _$verify = $grpc.ClientMethod<$0.SmsVerifyRequest, $0.SmsReply>(
|
||||
'/sender.Sms/Verify',
|
||||
($0.SmsVerifyRequest value) => value.writeToBuffer(),
|
||||
$0.SmsReply.fromBuffer);
|
||||
}
|
||||
|
||||
@$pb.GrpcServiceName('sender.Sms')
|
||||
abstract class SmsServiceBase extends $grpc.Service {
|
||||
$core.String get $name => 'sender.Sms';
|
||||
|
||||
SmsServiceBase() {
|
||||
$addMethod($grpc.ServiceMethod<$0.SmsSendRequest, $0.SmsReply>(
|
||||
'Send',
|
||||
send_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.SmsSendRequest.fromBuffer(value),
|
||||
($0.SmsReply value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.SmsVerifyRequest, $0.SmsReply>(
|
||||
'Verify',
|
||||
verify_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.SmsVerifyRequest.fromBuffer(value),
|
||||
($0.SmsReply value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
$async.Future<$0.SmsReply> send_Pre($grpc.ServiceCall $call,
|
||||
$async.Future<$0.SmsSendRequest> $request) async {
|
||||
return send($call, await $request);
|
||||
}
|
||||
|
||||
$async.Future<$0.SmsReply> send(
|
||||
$grpc.ServiceCall call, $0.SmsSendRequest request);
|
||||
|
||||
$async.Future<$0.SmsReply> verify_Pre($grpc.ServiceCall $call,
|
||||
$async.Future<$0.SmsVerifyRequest> $request) async {
|
||||
return verify($call, await $request);
|
||||
}
|
||||
|
||||
$async.Future<$0.SmsReply> verify(
|
||||
$grpc.ServiceCall call, $0.SmsVerifyRequest request);
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
// This is a generated file - do not edit.
|
||||
//
|
||||
// Generated from sms.proto.
|
||||
|
||||
// @dart = 3.3
|
||||
|
||||
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||
// ignore_for_file: non_constant_identifier_names, unused_import
|
||||
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
|
||||
@$core.Deprecated('Use smsSendRequestDescriptor instead')
|
||||
const SmsSendRequest$json = {
|
||||
'1': 'SmsSendRequest',
|
||||
'2': [
|
||||
{'1': 'provider', '3': 1, '4': 1, '5': 9, '10': 'provider'},
|
||||
{'1': 'sign_name', '3': 2, '4': 1, '5': 9, '10': 'signName'},
|
||||
{'1': 'template_code', '3': 3, '4': 1, '5': 9, '10': 'templateCode'},
|
||||
{'1': 'phone', '3': 4, '4': 1, '5': 9, '10': 'phone'},
|
||||
{
|
||||
'1': 'paramters',
|
||||
'3': 5,
|
||||
'4': 3,
|
||||
'5': 11,
|
||||
'6': '.sender.SmsSendRequest.ParamtersEntry',
|
||||
'10': 'paramters'
|
||||
},
|
||||
],
|
||||
'3': [SmsSendRequest_ParamtersEntry$json],
|
||||
};
|
||||
|
||||
@$core.Deprecated('Use smsSendRequestDescriptor instead')
|
||||
const SmsSendRequest_ParamtersEntry$json = {
|
||||
'1': 'ParamtersEntry',
|
||||
'2': [
|
||||
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||
],
|
||||
'7': {'7': true},
|
||||
};
|
||||
|
||||
/// Descriptor for `SmsSendRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List smsSendRequestDescriptor = $convert.base64Decode(
|
||||
'Cg5TbXNTZW5kUmVxdWVzdBIaCghwcm92aWRlchgBIAEoCVIIcHJvdmlkZXISGwoJc2lnbl9uYW'
|
||||
'1lGAIgASgJUghzaWduTmFtZRIjCg10ZW1wbGF0ZV9jb2RlGAMgASgJUgx0ZW1wbGF0ZUNvZGUS'
|
||||
'FAoFcGhvbmUYBCABKAlSBXBob25lEkMKCXBhcmFtdGVycxgFIAMoCzIlLnNlbmRlci5TbXNTZW'
|
||||
'5kUmVxdWVzdC5QYXJhbXRlcnNFbnRyeVIJcGFyYW10ZXJzGjwKDlBhcmFtdGVyc0VudHJ5EhAK'
|
||||
'A2tleRgBIAEoCVIDa2V5EhQKBXZhbHVlGAIgASgJUgV2YWx1ZToCOAE=');
|
||||
|
||||
@$core.Deprecated('Use smsReplyDescriptor instead')
|
||||
const SmsReply$json = {
|
||||
'1': 'SmsReply',
|
||||
'2': [
|
||||
{'1': 'reply', '3': 1, '4': 1, '5': 9, '10': 'reply'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `SmsReply`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List smsReplyDescriptor =
|
||||
$convert.base64Decode('CghTbXNSZXBseRIUCgVyZXBseRgBIAEoCVIFcmVwbHk=');
|
||||
|
||||
@$core.Deprecated('Use smsVerifyRequestDescriptor instead')
|
||||
const SmsVerifyRequest$json = {
|
||||
'1': 'SmsVerifyRequest',
|
||||
'2': [
|
||||
{'1': 'phone', '3': 1, '4': 1, '5': 9, '10': 'phone'},
|
||||
{'1': 'code', '3': 2, '4': 1, '5': 9, '10': 'code'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `SmsVerifyRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List smsVerifyRequestDescriptor = $convert.base64Decode(
|
||||
'ChBTbXNWZXJpZnlSZXF1ZXN0EhQKBXBob25lGAEgASgJUgVwaG9uZRISCgRjb2RlGAIgASgJUg'
|
||||
'Rjb2Rl');
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "mail.proto",
|
||||
"version": "version not set"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "Mail"
|
||||
},
|
||||
{
|
||||
"name": "Sms"
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {},
|
||||
"definitions": {
|
||||
"protobufAny": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {}
|
||||
},
|
||||
"rpcStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/protobufAny"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"senderSendMailReply": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"senderSmsReply": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"reply": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
# Mail
|
||||
|
||||
Mail method
|
||||
|
||||
- [/sender.Mail/Send](#sendermailsend)
|
||||
|
||||
## /sender.Mail/Send
|
||||
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
provider: "", // type<string>
|
||||
template_key: "", // type<string>
|
||||
to: "", // type<string>
|
||||
paramters: {
|
||||
"": ""
|
||||
}, // map<string,string>, 验证码相关
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
data: "", // type<string>
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
# Sms
|
||||
|
||||
sms method
|
||||
|
||||
- [/sender.Sms/Send](#sendersmssend)
|
||||
- [/sender.Sms/Verify](#sendersmsverify)
|
||||
|
||||
## /sender.Sms/Send
|
||||
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
provider: "", // type<string>
|
||||
sign_name: "", // type<string>, 必传项
|
||||
template_code: "", // type<string>, 必传项
|
||||
phone: "", // type<string>, 必传项
|
||||
paramters: {
|
||||
"": ""
|
||||
}, // map<string,string>, 验证码相关
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
reply: "", // type<string>
|
||||
}
|
||||
```
|
||||
## /sender.Sms/Verify
|
||||
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
phone: "", // type<string>
|
||||
code: "", // type<string>
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
reply: "", // type<string>
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.8
|
||||
// protoc (unknown)
|
||||
// source: mail.proto
|
||||
|
||||
package sender
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// sms module
|
||||
type SendMailRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
|
||||
TemplateKey string `protobuf:"bytes,2,opt,name=template_key,json=templateKey,proto3" json:"template_key,omitempty"`
|
||||
To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"`
|
||||
Paramters map[string]string `protobuf:"bytes,5,rep,name=paramters,proto3" json:"paramters,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // 验证码相关
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SendMailRequest) Reset() {
|
||||
*x = SendMailRequest{}
|
||||
mi := &file_mail_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SendMailRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SendMailRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SendMailRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mail_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SendMailRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SendMailRequest) Descriptor() ([]byte, []int) {
|
||||
return file_mail_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SendMailRequest) GetProvider() string {
|
||||
if x != nil {
|
||||
return x.Provider
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SendMailRequest) GetTemplateKey() string {
|
||||
if x != nil {
|
||||
return x.TemplateKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SendMailRequest) GetTo() string {
|
||||
if x != nil {
|
||||
return x.To
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SendMailRequest) GetParamters() map[string]string {
|
||||
if x != nil {
|
||||
return x.Paramters
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SendMailReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SendMailReply) Reset() {
|
||||
*x = SendMailReply{}
|
||||
mi := &file_mail_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SendMailReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SendMailReply) ProtoMessage() {}
|
||||
|
||||
func (x *SendMailReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mail_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SendMailReply.ProtoReflect.Descriptor instead.
|
||||
func (*SendMailReply) Descriptor() ([]byte, []int) {
|
||||
return file_mail_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SendMailReply) GetData() string {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_mail_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_mail_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
"mail.proto\x12\x06sender\"\xe4\x01\n" +
|
||||
"\x0fSendMailRequest\x12\x1a\n" +
|
||||
"\bprovider\x18\x01 \x01(\tR\bprovider\x12!\n" +
|
||||
"\ftemplate_key\x18\x02 \x01(\tR\vtemplateKey\x12\x0e\n" +
|
||||
"\x02to\x18\x04 \x01(\tR\x02to\x12D\n" +
|
||||
"\tparamters\x18\x05 \x03(\v2&.sender.SendMailRequest.ParamtersEntryR\tparamters\x1a<\n" +
|
||||
"\x0eParamtersEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"#\n" +
|
||||
"\rSendMailReply\x12\x12\n" +
|
||||
"\x04data\x18\x01 \x01(\tR\x04data2>\n" +
|
||||
"\x04Mail\x126\n" +
|
||||
"\x04Send\x12\x17.sender.SendMailRequest\x1a\x15.sender.SendMailReplyB\n" +
|
||||
"Z\b./senderb\x06proto3"
|
||||
|
||||
var (
|
||||
file_mail_proto_rawDescOnce sync.Once
|
||||
file_mail_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_mail_proto_rawDescGZIP() []byte {
|
||||
file_mail_proto_rawDescOnce.Do(func() {
|
||||
file_mail_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mail_proto_rawDesc), len(file_mail_proto_rawDesc)))
|
||||
})
|
||||
return file_mail_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mail_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_mail_proto_goTypes = []any{
|
||||
(*SendMailRequest)(nil), // 0: sender.SendMailRequest
|
||||
(*SendMailReply)(nil), // 1: sender.SendMailReply
|
||||
nil, // 2: sender.SendMailRequest.ParamtersEntry
|
||||
}
|
||||
var file_mail_proto_depIdxs = []int32{
|
||||
2, // 0: sender.SendMailRequest.paramters:type_name -> sender.SendMailRequest.ParamtersEntry
|
||||
0, // 1: sender.Mail.Send:input_type -> sender.SendMailRequest
|
||||
1, // 2: sender.Mail.Send:output_type -> sender.SendMailReply
|
||||
2, // [2:3] is the sub-list for method output_type
|
||||
1, // [1:2] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_mail_proto_init() }
|
||||
func file_mail_proto_init() {
|
||||
if File_mail_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mail_proto_rawDesc), len(file_mail_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_mail_proto_goTypes,
|
||||
DependencyIndexes: file_mail_proto_depIdxs,
|
||||
MessageInfos: file_mail_proto_msgTypes,
|
||||
}.Build()
|
||||
File_mail_proto = out.File
|
||||
file_mail_proto_goTypes = nil
|
||||
file_mail_proto_depIdxs = nil
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc (unknown)
|
||||
// source: mail.proto
|
||||
|
||||
package sender
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Mail_Send_FullMethodName = "/sender.Mail/Send"
|
||||
)
|
||||
|
||||
// MailClient is the client API for Mail service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// Mail method
|
||||
type MailClient interface {
|
||||
Send(ctx context.Context, in *SendMailRequest, opts ...grpc.CallOption) (*SendMailReply, error)
|
||||
}
|
||||
|
||||
type mailClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMailClient(cc grpc.ClientConnInterface) MailClient {
|
||||
return &mailClient{cc}
|
||||
}
|
||||
|
||||
func (c *mailClient) Send(ctx context.Context, in *SendMailRequest, opts ...grpc.CallOption) (*SendMailReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SendMailReply)
|
||||
err := c.cc.Invoke(ctx, Mail_Send_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MailServer is the server API for Mail service.
|
||||
// All implementations must embed UnimplementedMailServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Mail method
|
||||
type MailServer interface {
|
||||
Send(context.Context, *SendMailRequest) (*SendMailReply, error)
|
||||
mustEmbedUnimplementedMailServer()
|
||||
}
|
||||
|
||||
// UnimplementedMailServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedMailServer struct{}
|
||||
|
||||
func (UnimplementedMailServer) Send(context.Context, *SendMailRequest) (*SendMailReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Send not implemented")
|
||||
}
|
||||
func (UnimplementedMailServer) mustEmbedUnimplementedMailServer() {}
|
||||
func (UnimplementedMailServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeMailServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MailServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMailServer interface {
|
||||
mustEmbedUnimplementedMailServer()
|
||||
}
|
||||
|
||||
func RegisterMailServer(s grpc.ServiceRegistrar, srv MailServer) {
|
||||
// If the following call pancis, it indicates UnimplementedMailServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Mail_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Mail_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendMailRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MailServer).Send(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Mail_Send_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MailServer).Send(ctx, req.(*SendMailRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Mail_ServiceDesc is the grpc.ServiceDesc for Mail service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Mail_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "sender.Mail",
|
||||
HandlerType: (*MailServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Send",
|
||||
Handler: _Mail_Send_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "mail.proto",
|
||||
}
|
|
@ -0,0 +1,275 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.8
|
||||
// protoc (unknown)
|
||||
// source: sms.proto
|
||||
|
||||
package sender
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// sms module
|
||||
type SmsSendRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
|
||||
SignName string `protobuf:"bytes,2,opt,name=sign_name,json=signName,proto3" json:"sign_name,omitempty"` // 必传项
|
||||
TemplateCode string `protobuf:"bytes,3,opt,name=template_code,json=templateCode,proto3" json:"template_code,omitempty"` // 必传项
|
||||
Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` // 必传项
|
||||
Paramters map[string]string `protobuf:"bytes,5,rep,name=paramters,proto3" json:"paramters,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // 验证码相关
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SmsSendRequest) Reset() {
|
||||
*x = SmsSendRequest{}
|
||||
mi := &file_sms_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SmsSendRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SmsSendRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SmsSendRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_sms_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SmsSendRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SmsSendRequest) Descriptor() ([]byte, []int) {
|
||||
return file_sms_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SmsSendRequest) GetProvider() string {
|
||||
if x != nil {
|
||||
return x.Provider
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SmsSendRequest) GetSignName() string {
|
||||
if x != nil {
|
||||
return x.SignName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SmsSendRequest) GetTemplateCode() string {
|
||||
if x != nil {
|
||||
return x.TemplateCode
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SmsSendRequest) GetPhone() string {
|
||||
if x != nil {
|
||||
return x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SmsSendRequest) GetParamters() map[string]string {
|
||||
if x != nil {
|
||||
return x.Paramters
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SmsReply struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Reply string `protobuf:"bytes,1,opt,name=reply,proto3" json:"reply,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SmsReply) Reset() {
|
||||
*x = SmsReply{}
|
||||
mi := &file_sms_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SmsReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SmsReply) ProtoMessage() {}
|
||||
|
||||
func (x *SmsReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_sms_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SmsReply.ProtoReflect.Descriptor instead.
|
||||
func (*SmsReply) Descriptor() ([]byte, []int) {
|
||||
return file_sms_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SmsReply) GetReply() string {
|
||||
if x != nil {
|
||||
return x.Reply
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SmsVerifyRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Phone string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"`
|
||||
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SmsVerifyRequest) Reset() {
|
||||
*x = SmsVerifyRequest{}
|
||||
mi := &file_sms_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SmsVerifyRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SmsVerifyRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SmsVerifyRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_sms_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SmsVerifyRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SmsVerifyRequest) Descriptor() ([]byte, []int) {
|
||||
return file_sms_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SmsVerifyRequest) GetPhone() string {
|
||||
if x != nil {
|
||||
return x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SmsVerifyRequest) GetCode() string {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_sms_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_sms_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\tsms.proto\x12\x06sender\"\x87\x02\n" +
|
||||
"\x0eSmsSendRequest\x12\x1a\n" +
|
||||
"\bprovider\x18\x01 \x01(\tR\bprovider\x12\x1b\n" +
|
||||
"\tsign_name\x18\x02 \x01(\tR\bsignName\x12#\n" +
|
||||
"\rtemplate_code\x18\x03 \x01(\tR\ftemplateCode\x12\x14\n" +
|
||||
"\x05phone\x18\x04 \x01(\tR\x05phone\x12C\n" +
|
||||
"\tparamters\x18\x05 \x03(\v2%.sender.SmsSendRequest.ParamtersEntryR\tparamters\x1a<\n" +
|
||||
"\x0eParamtersEntry\x12\x10\n" +
|
||||
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
||||
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\" \n" +
|
||||
"\bSmsReply\x12\x14\n" +
|
||||
"\x05reply\x18\x01 \x01(\tR\x05reply\"<\n" +
|
||||
"\x10SmsVerifyRequest\x12\x14\n" +
|
||||
"\x05phone\x18\x01 \x01(\tR\x05phone\x12\x12\n" +
|
||||
"\x04code\x18\x02 \x01(\tR\x04code2m\n" +
|
||||
"\x03Sms\x120\n" +
|
||||
"\x04Send\x12\x16.sender.SmsSendRequest\x1a\x10.sender.SmsReply\x124\n" +
|
||||
"\x06Verify\x12\x18.sender.SmsVerifyRequest\x1a\x10.sender.SmsReplyB\n" +
|
||||
"Z\b./senderb\x06proto3"
|
||||
|
||||
var (
|
||||
file_sms_proto_rawDescOnce sync.Once
|
||||
file_sms_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_sms_proto_rawDescGZIP() []byte {
|
||||
file_sms_proto_rawDescOnce.Do(func() {
|
||||
file_sms_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sms_proto_rawDesc), len(file_sms_proto_rawDesc)))
|
||||
})
|
||||
return file_sms_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_sms_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_sms_proto_goTypes = []any{
|
||||
(*SmsSendRequest)(nil), // 0: sender.SmsSendRequest
|
||||
(*SmsReply)(nil), // 1: sender.SmsReply
|
||||
(*SmsVerifyRequest)(nil), // 2: sender.SmsVerifyRequest
|
||||
nil, // 3: sender.SmsSendRequest.ParamtersEntry
|
||||
}
|
||||
var file_sms_proto_depIdxs = []int32{
|
||||
3, // 0: sender.SmsSendRequest.paramters:type_name -> sender.SmsSendRequest.ParamtersEntry
|
||||
0, // 1: sender.Sms.Send:input_type -> sender.SmsSendRequest
|
||||
2, // 2: sender.Sms.Verify:input_type -> sender.SmsVerifyRequest
|
||||
1, // 3: sender.Sms.Send:output_type -> sender.SmsReply
|
||||
1, // 4: sender.Sms.Verify:output_type -> sender.SmsReply
|
||||
3, // [3:5] is the sub-list for method output_type
|
||||
1, // [1:3] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_sms_proto_init() }
|
||||
func file_sms_proto_init() {
|
||||
if File_sms_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_sms_proto_rawDesc), len(file_sms_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_sms_proto_goTypes,
|
||||
DependencyIndexes: file_sms_proto_depIdxs,
|
||||
MessageInfos: file_sms_proto_msgTypes,
|
||||
}.Build()
|
||||
File_sms_proto = out.File
|
||||
file_sms_proto_goTypes = nil
|
||||
file_sms_proto_depIdxs = nil
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc (unknown)
|
||||
// source: sms.proto
|
||||
|
||||
package sender
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Sms_Send_FullMethodName = "/sender.Sms/Send"
|
||||
Sms_Verify_FullMethodName = "/sender.Sms/Verify"
|
||||
)
|
||||
|
||||
// SmsClient is the client API for Sms service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// sms method
|
||||
type SmsClient interface {
|
||||
Send(ctx context.Context, in *SmsSendRequest, opts ...grpc.CallOption) (*SmsReply, error)
|
||||
Verify(ctx context.Context, in *SmsVerifyRequest, opts ...grpc.CallOption) (*SmsReply, error)
|
||||
}
|
||||
|
||||
type smsClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSmsClient(cc grpc.ClientConnInterface) SmsClient {
|
||||
return &smsClient{cc}
|
||||
}
|
||||
|
||||
func (c *smsClient) Send(ctx context.Context, in *SmsSendRequest, opts ...grpc.CallOption) (*SmsReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SmsReply)
|
||||
err := c.cc.Invoke(ctx, Sms_Send_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *smsClient) Verify(ctx context.Context, in *SmsVerifyRequest, opts ...grpc.CallOption) (*SmsReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SmsReply)
|
||||
err := c.cc.Invoke(ctx, Sms_Verify_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SmsServer is the server API for Sms service.
|
||||
// All implementations must embed UnimplementedSmsServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// sms method
|
||||
type SmsServer interface {
|
||||
Send(context.Context, *SmsSendRequest) (*SmsReply, error)
|
||||
Verify(context.Context, *SmsVerifyRequest) (*SmsReply, error)
|
||||
mustEmbedUnimplementedSmsServer()
|
||||
}
|
||||
|
||||
// UnimplementedSmsServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSmsServer struct{}
|
||||
|
||||
func (UnimplementedSmsServer) Send(context.Context, *SmsSendRequest) (*SmsReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Send not implemented")
|
||||
}
|
||||
func (UnimplementedSmsServer) Verify(context.Context, *SmsVerifyRequest) (*SmsReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented")
|
||||
}
|
||||
func (UnimplementedSmsServer) mustEmbedUnimplementedSmsServer() {}
|
||||
func (UnimplementedSmsServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSmsServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SmsServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSmsServer interface {
|
||||
mustEmbedUnimplementedSmsServer()
|
||||
}
|
||||
|
||||
func RegisterSmsServer(s grpc.ServiceRegistrar, srv SmsServer) {
|
||||
// If the following call pancis, it indicates UnimplementedSmsServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Sms_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Sms_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SmsSendRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SmsServer).Send(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Sms_Send_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SmsServer).Send(ctx, req.(*SmsSendRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Sms_Verify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SmsVerifyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SmsServer).Verify(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Sms_Verify_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SmsServer).Verify(ctx, req.(*SmsVerifyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Sms_ServiceDesc is the grpc.ServiceDesc for Sms service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Sms_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "sender.Sms",
|
||||
HandlerType: (*SmsServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Send",
|
||||
Handler: _Sms_Send_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Verify",
|
||||
Handler: _Sms_Verify_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "sms.proto",
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
// Code generated by protoc-gen-typescript-http. DO NOT EDIT.
|
||||
/* eslint-disable camelcase */
|
||||
// @ts-nocheck
|
||||
|
||||
/** sms module */
|
||||
export type SendMailRequest = {
|
||||
provider?: string;
|
||||
templateKey?: string;
|
||||
to?: string;
|
||||
/** 验证码相关 */
|
||||
paramters?: { [key: string]: string };
|
||||
};
|
||||
|
||||
export type SendMailReply = {
|
||||
data?: string;
|
||||
};
|
||||
|
||||
/** Mail method */
|
||||
export interface Mail {
|
||||
}
|
||||
|
||||
type RequestType = {
|
||||
path: string;
|
||||
method: string;
|
||||
body: string | null;
|
||||
};
|
||||
|
||||
type RequestHandler = (request: RequestType, meta: { service: string, method: string }) => Promise<unknown>;
|
||||
|
||||
export function createMailClient(
|
||||
handler: RequestHandler
|
||||
): Mail {
|
||||
return {
|
||||
};
|
||||
}
|
||||
/** sms module */
|
||||
export type SmsSendRequest = {
|
||||
provider?: string;
|
||||
/** 必传项 */
|
||||
signName?: string;
|
||||
/** 必传项 */
|
||||
templateCode?: string;
|
||||
/** 必传项 */
|
||||
phone?: string;
|
||||
/** 验证码相关 */
|
||||
paramters?: { [key: string]: string };
|
||||
};
|
||||
|
||||
export type SmsReply = {
|
||||
reply?: string;
|
||||
};
|
||||
|
||||
export type SmsVerifyRequest = {
|
||||
phone?: string;
|
||||
code?: string;
|
||||
};
|
||||
|
||||
/** sms method */
|
||||
export interface Sms {
|
||||
}
|
||||
|
||||
export function createSmsClient(
|
||||
handler: RequestHandler
|
||||
): Sms {
|
||||
return {
|
||||
};
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(typescript-http-eof)
|
Loading…
Reference in New Issue