From e9e4874f277dbaeae2c8f4060f40592844846d79 Mon Sep 17 00:00:00 2001 From: yanweidong Date: Mon, 8 Sep 2025 16:56:48 +0800 Subject: [PATCH] update --- dart/initial/data.pb.dart | 233 +++++++++++++++++++----------- dart/initial/data.pbgrpc.dart | 36 ++--- dart/initial/data.pbjson.dart | 81 ++++++----- docs/initial/data.md | 19 ++- docs/initial/initial.swagger.json | 103 +++++++------ golnag/initial/data.pb.go | 208 +++++++++++++++----------- golnag/initial/data_grpc.pb.go | 34 ++--- typescript/initial/index.ts | 17 ++- 8 files changed, 434 insertions(+), 297 deletions(-) diff --git a/dart/initial/data.pb.dart b/dart/initial/data.pb.dart index 7b188bb..914572c 100644 --- a/dart/initial/data.pb.dart +++ b/dart/initial/data.pb.dart @@ -109,10 +109,15 @@ class CountryReply extends $pb.GeneratedMessage { class CountryItem extends $pb.GeneratedMessage { factory CountryItem({ $core.int? id, - $core.String? code, - $core.String? code3, + $core.String? iso2, + $core.String? iso3, $core.String? numCode, $core.String? phoneCode, + $core.String? currency, + $core.String? currencySymbol, + $core.String? region, + $core.String? timezones, + $core.String? translations, $core.String? name, $core.String? localName, $core.bool? enabled, @@ -120,10 +125,15 @@ class CountryItem extends $pb.GeneratedMessage { }) { final result = create(); if (id != null) result.id = id; - if (code != null) result.code = code; - if (code3 != null) result.code3 = code3; + if (iso2 != null) result.iso2 = iso2; + if (iso3 != null) result.iso3 = iso3; if (numCode != null) result.numCode = numCode; if (phoneCode != null) result.phoneCode = phoneCode; + if (currency != null) result.currency = currency; + if (currencySymbol != null) result.currencySymbol = currencySymbol; + if (region != null) result.region = region; + if (timezones != null) result.timezones = timezones; + if (translations != null) result.translations = translations; if (name != null) result.name = name; if (localName != null) result.localName = localName; if (enabled != null) result.enabled = enabled; @@ -145,14 +155,19 @@ class CountryItem extends $pb.GeneratedMessage { package: const $pb.PackageName(_omitMessageNames ? '' : 'initial'), createEmptyInstance: create) ..a<$core.int>(1, _omitFieldNames ? '' : 'id', $pb.PbFieldType.OU3) - ..aOS(2, _omitFieldNames ? '' : 'code') - ..aOS(3, _omitFieldNames ? '' : 'code3', protoName: 'code_3') + ..aOS(2, _omitFieldNames ? '' : 'Iso2', protoName: 'Iso2') + ..aOS(3, _omitFieldNames ? '' : 'Iso3', protoName: 'Iso3') ..aOS(4, _omitFieldNames ? '' : 'numCode') ..aOS(5, _omitFieldNames ? '' : 'phoneCode') - ..aOS(6, _omitFieldNames ? '' : 'name') - ..aOS(7, _omitFieldNames ? '' : 'localName') - ..aOB(8, _omitFieldNames ? '' : 'enabled') - ..a<$core.int>(9, _omitFieldNames ? '' : 'sortOrder', $pb.PbFieldType.O3) + ..aOS(6, _omitFieldNames ? '' : 'currency') + ..aOS(7, _omitFieldNames ? '' : 'currencySymbol') + ..aOS(8, _omitFieldNames ? '' : 'region') + ..aOS(9, _omitFieldNames ? '' : 'timezones') + ..aOS(10, _omitFieldNames ? '' : 'translations') + ..aOS(11, _omitFieldNames ? '' : 'name') + ..aOS(12, _omitFieldNames ? '' : 'localName') + ..aOB(13, _omitFieldNames ? '' : 'enabled') + ..a<$core.int>(14, _omitFieldNames ? '' : 'sortOrder', $pb.PbFieldType.O3) ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -185,22 +200,22 @@ class CountryItem extends $pb.GeneratedMessage { void clearId() => $_clearField(1); @$pb.TagNumber(2) - $core.String get code => $_getSZ(1); + $core.String get iso2 => $_getSZ(1); @$pb.TagNumber(2) - set code($core.String value) => $_setString(1, value); + set iso2($core.String value) => $_setString(1, value); @$pb.TagNumber(2) - $core.bool hasCode() => $_has(1); + $core.bool hasIso2() => $_has(1); @$pb.TagNumber(2) - void clearCode() => $_clearField(2); + void clearIso2() => $_clearField(2); @$pb.TagNumber(3) - $core.String get code3 => $_getSZ(2); + $core.String get iso3 => $_getSZ(2); @$pb.TagNumber(3) - set code3($core.String value) => $_setString(2, value); + set iso3($core.String value) => $_setString(2, value); @$pb.TagNumber(3) - $core.bool hasCode3() => $_has(2); + $core.bool hasIso3() => $_has(2); @$pb.TagNumber(3) - void clearCode3() => $_clearField(3); + void clearIso3() => $_clearField(3); @$pb.TagNumber(4) $core.String get numCode => $_getSZ(3); @@ -221,44 +236,89 @@ class CountryItem extends $pb.GeneratedMessage { void clearPhoneCode() => $_clearField(5); @$pb.TagNumber(6) - $core.String get name => $_getSZ(5); + $core.String get currency => $_getSZ(5); @$pb.TagNumber(6) - set name($core.String value) => $_setString(5, value); + set currency($core.String value) => $_setString(5, value); @$pb.TagNumber(6) - $core.bool hasName() => $_has(5); + $core.bool hasCurrency() => $_has(5); @$pb.TagNumber(6) - void clearName() => $_clearField(6); + void clearCurrency() => $_clearField(6); @$pb.TagNumber(7) - $core.String get localName => $_getSZ(6); + $core.String get currencySymbol => $_getSZ(6); @$pb.TagNumber(7) - set localName($core.String value) => $_setString(6, value); + set currencySymbol($core.String value) => $_setString(6, value); @$pb.TagNumber(7) - $core.bool hasLocalName() => $_has(6); + $core.bool hasCurrencySymbol() => $_has(6); @$pb.TagNumber(7) - void clearLocalName() => $_clearField(7); + void clearCurrencySymbol() => $_clearField(7); @$pb.TagNumber(8) - $core.bool get enabled => $_getBF(7); + $core.String get region => $_getSZ(7); @$pb.TagNumber(8) - set enabled($core.bool value) => $_setBool(7, value); + set region($core.String value) => $_setString(7, value); @$pb.TagNumber(8) - $core.bool hasEnabled() => $_has(7); + $core.bool hasRegion() => $_has(7); @$pb.TagNumber(8) - void clearEnabled() => $_clearField(8); + void clearRegion() => $_clearField(8); @$pb.TagNumber(9) - $core.int get sortOrder => $_getIZ(8); + $core.String get timezones => $_getSZ(8); @$pb.TagNumber(9) - set sortOrder($core.int value) => $_setSignedInt32(8, value); + set timezones($core.String value) => $_setString(8, value); @$pb.TagNumber(9) - $core.bool hasSortOrder() => $_has(8); + $core.bool hasTimezones() => $_has(8); @$pb.TagNumber(9) - void clearSortOrder() => $_clearField(9); + void clearTimezones() => $_clearField(9); + + @$pb.TagNumber(10) + $core.String get translations => $_getSZ(9); + @$pb.TagNumber(10) + set translations($core.String value) => $_setString(9, value); + @$pb.TagNumber(10) + $core.bool hasTranslations() => $_has(9); + @$pb.TagNumber(10) + void clearTranslations() => $_clearField(10); + + @$pb.TagNumber(11) + $core.String get name => $_getSZ(10); + @$pb.TagNumber(11) + set name($core.String value) => $_setString(10, value); + @$pb.TagNumber(11) + $core.bool hasName() => $_has(10); + @$pb.TagNumber(11) + void clearName() => $_clearField(11); + + @$pb.TagNumber(12) + $core.String get localName => $_getSZ(11); + @$pb.TagNumber(12) + set localName($core.String value) => $_setString(11, value); + @$pb.TagNumber(12) + $core.bool hasLocalName() => $_has(11); + @$pb.TagNumber(12) + void clearLocalName() => $_clearField(12); + + @$pb.TagNumber(13) + $core.bool get enabled => $_getBF(12); + @$pb.TagNumber(13) + set enabled($core.bool value) => $_setBool(12, value); + @$pb.TagNumber(13) + $core.bool hasEnabled() => $_has(12); + @$pb.TagNumber(13) + void clearEnabled() => $_clearField(13); + + @$pb.TagNumber(14) + $core.int get sortOrder => $_getIZ(13); + @$pb.TagNumber(14) + set sortOrder($core.int value) => $_setSignedInt32(13, value); + @$pb.TagNumber(14) + $core.bool hasSortOrder() => $_has(13); + @$pb.TagNumber(14) + void clearSortOrder() => $_clearField(14); } -class RegionRequest extends $pb.GeneratedMessage { - factory RegionRequest({ +class AreasRequest extends $pb.GeneratedMessage { + factory AreasRequest({ $core.int? countryId, $core.String? countryCode, $core.bool? showTown, @@ -270,17 +330,17 @@ class RegionRequest extends $pb.GeneratedMessage { return result; } - RegionRequest._(); + AreasRequest._(); - factory RegionRequest.fromBuffer($core.List<$core.int> data, + factory AreasRequest.fromBuffer($core.List<$core.int> data, [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(data, registry); - factory RegionRequest.fromJson($core.String json, + factory AreasRequest.fromJson($core.String json, [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(json, registry); static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'RegionRequest', + _omitMessageNames ? '' : 'AreasRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'initial'), createEmptyInstance: create) ..a<$core.int>(1, _omitFieldNames ? '' : 'countryId', $pb.PbFieldType.O3) @@ -289,25 +349,25 @@ class RegionRequest extends $pb.GeneratedMessage { ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - RegionRequest clone() => RegionRequest()..mergeFromMessage(this); + AreasRequest clone() => AreasRequest()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - RegionRequest copyWith(void Function(RegionRequest) updates) => - super.copyWith((message) => updates(message as RegionRequest)) - as RegionRequest; + AreasRequest copyWith(void Function(AreasRequest) updates) => + super.copyWith((message) => updates(message as AreasRequest)) + as AreasRequest; @$core.override $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static RegionRequest create() => RegionRequest._(); + static AreasRequest create() => AreasRequest._(); @$core.override - RegionRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => - $pb.PbList(); + AreasRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static RegionRequest getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static RegionRequest? _defaultInstance; + static AreasRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static AreasRequest? _defaultInstance; /// 国家ID,默认:中国 1 @$pb.TagNumber(1) @@ -340,58 +400,57 @@ class RegionRequest extends $pb.GeneratedMessage { void clearShowTown() => $_clearField(3); } -class RegionReply extends $pb.GeneratedMessage { - factory RegionReply({ - $core.Iterable? regions, +class AreasReply extends $pb.GeneratedMessage { + factory AreasReply({ + $core.Iterable? areas, }) { final result = create(); - if (regions != null) result.regions.addAll(regions); + if (areas != null) result.areas.addAll(areas); return result; } - RegionReply._(); + AreasReply._(); - factory RegionReply.fromBuffer($core.List<$core.int> data, + factory AreasReply.fromBuffer($core.List<$core.int> data, [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(data, registry); - factory RegionReply.fromJson($core.String json, + factory AreasReply.fromJson($core.String json, [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(json, registry); static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'RegionReply', + _omitMessageNames ? '' : 'AreasReply', package: const $pb.PackageName(_omitMessageNames ? '' : 'initial'), createEmptyInstance: create) - ..pc(1, _omitFieldNames ? '' : 'regions', $pb.PbFieldType.PM, - subBuilder: RegionItem.create) + ..pc(1, _omitFieldNames ? '' : 'areas', $pb.PbFieldType.PM, + subBuilder: AreasItem.create) ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - RegionReply clone() => RegionReply()..mergeFromMessage(this); + AreasReply clone() => AreasReply()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - RegionReply copyWith(void Function(RegionReply) updates) => - super.copyWith((message) => updates(message as RegionReply)) - as RegionReply; + AreasReply copyWith(void Function(AreasReply) updates) => + super.copyWith((message) => updates(message as AreasReply)) as AreasReply; @$core.override $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static RegionReply create() => RegionReply._(); + static AreasReply create() => AreasReply._(); @$core.override - RegionReply createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + AreasReply createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static RegionReply getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static RegionReply? _defaultInstance; + static AreasReply getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static AreasReply? _defaultInstance; @$pb.TagNumber(1) - $pb.PbList get regions => $_getList(0); + $pb.PbList get areas => $_getList(0); } -class RegionItem extends $pb.GeneratedMessage { - factory RegionItem({ +class AreasItem extends $pb.GeneratedMessage { + factory AreasItem({ $core.String? id, $core.String? pid, $core.int? deep, @@ -413,17 +472,17 @@ class RegionItem extends $pb.GeneratedMessage { return result; } - RegionItem._(); + AreasItem._(); - factory RegionItem.fromBuffer($core.List<$core.int> data, + factory AreasItem.fromBuffer($core.List<$core.int> data, [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(data, registry); - factory RegionItem.fromJson($core.String json, + factory AreasItem.fromJson($core.String json, [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(json, registry); static final $pb.BuilderInfo _i = $pb.BuilderInfo( - _omitMessageNames ? '' : 'RegionItem', + _omitMessageNames ? '' : 'AreasItem', package: const $pb.PackageName(_omitMessageNames ? '' : 'initial'), createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'id') @@ -437,23 +496,23 @@ class RegionItem extends $pb.GeneratedMessage { ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - RegionItem clone() => RegionItem()..mergeFromMessage(this); + AreasItem clone() => AreasItem()..mergeFromMessage(this); @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') - RegionItem copyWith(void Function(RegionItem) updates) => - super.copyWith((message) => updates(message as RegionItem)) as RegionItem; + AreasItem copyWith(void Function(AreasItem) updates) => + super.copyWith((message) => updates(message as AreasItem)) as AreasItem; @$core.override $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') - static RegionItem create() => RegionItem._(); + static AreasItem create() => AreasItem._(); @$core.override - RegionItem createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + AreasItem createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static RegionItem getDefault() => _defaultInstance ??= - $pb.GeneratedMessage.$_defaultFor(create); - static RegionItem? _defaultInstance; + static AreasItem getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AreasItem? _defaultInstance; @$pb.TagNumber(1) $core.String get id => $_getSZ(0); diff --git a/dart/initial/data.pbgrpc.dart b/dart/initial/data.pbgrpc.dart index 9b2fc2d..cee8148 100644 --- a/dart/initial/data.pbgrpc.dart +++ b/dart/initial/data.pbgrpc.dart @@ -41,14 +41,14 @@ class DataClient extends $grpc.Client { } /// 系统区域数据,默认级别:市 - $grpc.ResponseFuture<$0.RegionReply> region( - $0.RegionRequest request, { + $grpc.ResponseFuture<$0.AreasReply> areas( + $0.AreasRequest request, { $grpc.CallOptions? options, }) { - return $createUnaryCall(_$region, request, options: options); + return $createUnaryCall(_$areas, request, options: options); } - /// 系统标签数据 + /// 系统数据 $grpc.ResponseFuture<$0.DatasReply> datas( $0.Empty request, { $grpc.CallOptions? options, @@ -62,10 +62,10 @@ class DataClient extends $grpc.Client { '/initial.Data/Country', ($0.Empty value) => value.writeToBuffer(), $0.CountryReply.fromBuffer); - static final _$region = $grpc.ClientMethod<$0.RegionRequest, $0.RegionReply>( - '/initial.Data/Region', - ($0.RegionRequest value) => value.writeToBuffer(), - $0.RegionReply.fromBuffer); + static final _$areas = $grpc.ClientMethod<$0.AreasRequest, $0.AreasReply>( + '/initial.Data/Areas', + ($0.AreasRequest value) => value.writeToBuffer(), + $0.AreasReply.fromBuffer); static final _$datas = $grpc.ClientMethod<$0.Empty, $0.DatasReply>( '/initial.Data/Datas', ($0.Empty value) => value.writeToBuffer(), @@ -84,13 +84,13 @@ abstract class DataServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $0.Empty.fromBuffer(value), ($0.CountryReply value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.RegionRequest, $0.RegionReply>( - 'Region', - region_Pre, + $addMethod($grpc.ServiceMethod<$0.AreasRequest, $0.AreasReply>( + 'Areas', + areas_Pre, false, false, - ($core.List<$core.int> value) => $0.RegionRequest.fromBuffer(value), - ($0.RegionReply value) => value.writeToBuffer())); + ($core.List<$core.int> value) => $0.AreasRequest.fromBuffer(value), + ($0.AreasReply value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.Empty, $0.DatasReply>( 'Datas', datas_Pre, @@ -108,13 +108,13 @@ abstract class DataServiceBase extends $grpc.Service { $async.Future<$0.CountryReply> country( $grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.RegionReply> region_Pre( - $grpc.ServiceCall $call, $async.Future<$0.RegionRequest> $request) async { - return region($call, await $request); + $async.Future<$0.AreasReply> areas_Pre( + $grpc.ServiceCall $call, $async.Future<$0.AreasRequest> $request) async { + return areas($call, await $request); } - $async.Future<$0.RegionReply> region( - $grpc.ServiceCall call, $0.RegionRequest request); + $async.Future<$0.AreasReply> areas( + $grpc.ServiceCall call, $0.AreasRequest request); $async.Future<$0.DatasReply> datas_Pre( $grpc.ServiceCall $call, $async.Future<$0.Empty> $request) async { diff --git a/dart/initial/data.pbjson.dart b/dart/initial/data.pbjson.dart index 4a7ec95..17d245d 100644 --- a/dart/initial/data.pbjson.dart +++ b/dart/initial/data.pbjson.dart @@ -48,28 +48,36 @@ const CountryItem$json = { '1': 'CountryItem', '2': [ {'1': 'id', '3': 1, '4': 1, '5': 13, '10': 'id'}, - {'1': 'code', '3': 2, '4': 1, '5': 9, '10': 'code'}, - {'1': 'code_3', '3': 3, '4': 1, '5': 9, '10': 'code3'}, + {'1': 'Iso2', '3': 2, '4': 1, '5': 9, '10': 'Iso2'}, + {'1': 'Iso3', '3': 3, '4': 1, '5': 9, '10': 'Iso3'}, {'1': 'num_code', '3': 4, '4': 1, '5': 9, '10': 'numCode'}, {'1': 'phone_code', '3': 5, '4': 1, '5': 9, '10': 'phoneCode'}, - {'1': 'name', '3': 6, '4': 1, '5': 9, '10': 'name'}, - {'1': 'local_name', '3': 7, '4': 1, '5': 9, '10': 'localName'}, - {'1': 'enabled', '3': 8, '4': 1, '5': 8, '10': 'enabled'}, - {'1': 'sort_order', '3': 9, '4': 1, '5': 5, '10': 'sortOrder'}, + {'1': 'currency', '3': 6, '4': 1, '5': 9, '10': 'currency'}, + {'1': 'currency_symbol', '3': 7, '4': 1, '5': 9, '10': 'currencySymbol'}, + {'1': 'region', '3': 8, '4': 1, '5': 9, '10': 'region'}, + {'1': 'timezones', '3': 9, '4': 1, '5': 9, '10': 'timezones'}, + {'1': 'translations', '3': 10, '4': 1, '5': 9, '10': 'translations'}, + {'1': 'name', '3': 11, '4': 1, '5': 9, '10': 'name'}, + {'1': 'local_name', '3': 12, '4': 1, '5': 9, '10': 'localName'}, + {'1': 'enabled', '3': 13, '4': 1, '5': 8, '10': 'enabled'}, + {'1': 'sort_order', '3': 14, '4': 1, '5': 5, '10': 'sortOrder'}, ], }; /// Descriptor for `CountryItem`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List countryItemDescriptor = $convert.base64Decode( - 'CgtDb3VudHJ5SXRlbRIOCgJpZBgBIAEoDVICaWQSEgoEY29kZRgCIAEoCVIEY29kZRIVCgZjb2' - 'RlXzMYAyABKAlSBWNvZGUzEhkKCG51bV9jb2RlGAQgASgJUgdudW1Db2RlEh0KCnBob25lX2Nv' - 'ZGUYBSABKAlSCXBob25lQ29kZRISCgRuYW1lGAYgASgJUgRuYW1lEh0KCmxvY2FsX25hbWUYBy' - 'ABKAlSCWxvY2FsTmFtZRIYCgdlbmFibGVkGAggASgIUgdlbmFibGVkEh0KCnNvcnRfb3JkZXIY' - 'CSABKAVSCXNvcnRPcmRlcg=='); + 'CgtDb3VudHJ5SXRlbRIOCgJpZBgBIAEoDVICaWQSEgoESXNvMhgCIAEoCVIESXNvMhISCgRJc2' + '8zGAMgASgJUgRJc28zEhkKCG51bV9jb2RlGAQgASgJUgdudW1Db2RlEh0KCnBob25lX2NvZGUY' + 'BSABKAlSCXBob25lQ29kZRIaCghjdXJyZW5jeRgGIAEoCVIIY3VycmVuY3kSJwoPY3VycmVuY3' + 'lfc3ltYm9sGAcgASgJUg5jdXJyZW5jeVN5bWJvbBIWCgZyZWdpb24YCCABKAlSBnJlZ2lvbhIc' + 'Cgl0aW1lem9uZXMYCSABKAlSCXRpbWV6b25lcxIiCgx0cmFuc2xhdGlvbnMYCiABKAlSDHRyYW' + '5zbGF0aW9ucxISCgRuYW1lGAsgASgJUgRuYW1lEh0KCmxvY2FsX25hbWUYDCABKAlSCWxvY2Fs' + 'TmFtZRIYCgdlbmFibGVkGA0gASgIUgdlbmFibGVkEh0KCnNvcnRfb3JkZXIYDiABKAVSCXNvcn' + 'RPcmRlcg=='); -@$core.Deprecated('Use regionRequestDescriptor instead') -const RegionRequest$json = { - '1': 'RegionRequest', +@$core.Deprecated('Use areasRequestDescriptor instead') +const AreasRequest$json = { + '1': 'AreasRequest', '2': [ {'1': 'country_id', '3': 1, '4': 1, '5': 5, '10': 'countryId'}, {'1': 'country_code', '3': 2, '4': 1, '5': 9, '10': 'countryCode'}, @@ -77,34 +85,33 @@ const RegionRequest$json = { ], }; -/// Descriptor for `RegionRequest`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List regionRequestDescriptor = $convert.base64Decode( - 'Cg1SZWdpb25SZXF1ZXN0Eh0KCmNvdW50cnlfaWQYASABKAVSCWNvdW50cnlJZBIhCgxjb3VudH' - 'J5X2NvZGUYAiABKAlSC2NvdW50cnlDb2RlEhsKCXNob3dfdG93bhgDIAEoCFIIc2hvd1Rvd24='); +/// Descriptor for `AreasRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List areasRequestDescriptor = $convert.base64Decode( + 'CgxBcmVhc1JlcXVlc3QSHQoKY291bnRyeV9pZBgBIAEoBVIJY291bnRyeUlkEiEKDGNvdW50cn' + 'lfY29kZRgCIAEoCVILY291bnRyeUNvZGUSGwoJc2hvd190b3duGAMgASgIUghzaG93VG93bg=='); -@$core.Deprecated('Use regionReplyDescriptor instead') -const RegionReply$json = { - '1': 'RegionReply', +@$core.Deprecated('Use areasReplyDescriptor instead') +const AreasReply$json = { + '1': 'AreasReply', '2': [ { - '1': 'regions', + '1': 'areas', '3': 1, '4': 3, '5': 11, - '6': '.initial.RegionItem', - '10': 'regions' + '6': '.initial.AreasItem', + '10': 'areas' }, ], }; -/// Descriptor for `RegionReply`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List regionReplyDescriptor = $convert.base64Decode( - 'CgtSZWdpb25SZXBseRItCgdyZWdpb25zGAEgAygLMhMuaW5pdGlhbC5SZWdpb25JdGVtUgdyZW' - 'dpb25z'); +/// Descriptor for `AreasReply`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List areasReplyDescriptor = $convert.base64Decode( + 'CgpBcmVhc1JlcGx5EigKBWFyZWFzGAEgAygLMhIuaW5pdGlhbC5BcmVhc0l0ZW1SBWFyZWFz'); -@$core.Deprecated('Use regionItemDescriptor instead') -const RegionItem$json = { - '1': 'RegionItem', +@$core.Deprecated('Use areasItemDescriptor instead') +const AreasItem$json = { + '1': 'AreasItem', '2': [ {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, {'1': 'pid', '3': 2, '4': 1, '5': 9, '10': 'pid'}, @@ -117,12 +124,12 @@ const RegionItem$json = { ], }; -/// Descriptor for `RegionItem`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List regionItemDescriptor = $convert.base64Decode( - 'CgpSZWdpb25JdGVtEg4KAmlkGAEgASgJUgJpZBIQCgNwaWQYAiABKAlSA3BpZBISCgRkZWVwGA' - 'MgASgFUgRkZWVwEhIKBG5hbWUYBCABKAlSBG5hbWUSIwoNcGlueWluX3ByZWZpeBgFIAEoCVIM' - 'cGlueWluUHJlZml4EhYKBnBpbnlpbhgGIAEoCVIGcGlueWluEhUKBmV4dF9pZBgHIAEoCVIFZX' - 'h0SWQSGQoIZXh0X25hbWUYCCABKAlSB2V4dE5hbWU='); +/// Descriptor for `AreasItem`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List areasItemDescriptor = $convert.base64Decode( + 'CglBcmVhc0l0ZW0SDgoCaWQYASABKAlSAmlkEhAKA3BpZBgCIAEoCVIDcGlkEhIKBGRlZXAYAy' + 'ABKAVSBGRlZXASEgoEbmFtZRgEIAEoCVIEbmFtZRIjCg1waW55aW5fcHJlZml4GAUgASgJUgxw' + 'aW55aW5QcmVmaXgSFgoGcGlueWluGAYgASgJUgZwaW55aW4SFQoGZXh0X2lkGAcgASgJUgVleH' + 'RJZBIZCghleHRfbmFtZRgIIAEoCVIHZXh0TmFtZQ=='); @$core.Deprecated('Use datasReplyDescriptor instead') const DatasReply$json = { diff --git a/docs/initial/data.md b/docs/initial/data.md index 2a5cc67..435984a 100644 --- a/docs/initial/data.md +++ b/docs/initial/data.md @@ -3,7 +3,7 @@ initial-数据 - [/initial.Data/Country](#initialdatacountry) -- [/initial.Data/Region](#initialdataregion) +- [/initial.Data/Areas](#initialdataareas) - [/initial.Data/Datas](#initialdatadatas) ## /initial.Data/Country @@ -20,10 +20,15 @@ { countries: [{ id: 0, // type - code: "", // type - code_3: "", // type + Iso2: "", // type + Iso3: "", // type num_code: "", // type phone_code: "", // type + currency: "", // type + currency_symbol: "", // type + region: "", // type + timezones: "", // type + translations: "", // type name: "", // type local_name: "", // type enabled: false, // type @@ -31,7 +36,7 @@ }], // list } ``` -## /initial.Data/Region +## /initial.Data/Areas 系统区域数据,默认级别:市 @@ -51,7 +56,7 @@ ### Reply ```javascript { - regions: [{ + areas: [{ id: "", // type pid: "", // type deep: 0, // type @@ -60,12 +65,12 @@ pinyin: "", // type ext_id: "", // type ext_name: "", // type - }], // list + }], // list } ``` ## /initial.Data/Datas - 系统标签数据 + 系统数据 ### Request diff --git a/docs/initial/initial.swagger.json b/docs/initial/initial.swagger.json index 4d73989..dec3bbf 100644 --- a/docs/initial/initial.swagger.json +++ b/docs/initial/initial.swagger.json @@ -20,6 +20,48 @@ ], "paths": {}, "definitions": { + "initialAreasItem": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "pid": { + "type": "string" + }, + "deep": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "pinyinPrefix": { + "type": "string" + }, + "pinyin": { + "type": "string" + }, + "extId": { + "type": "string" + }, + "extName": { + "type": "string" + } + } + }, + "initialAreasReply": { + "type": "object", + "properties": { + "areas": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/initialAreasItem" + } + } + } + }, "initialCheckForUpdatesReply": { "type": "object", "properties": { @@ -87,10 +129,10 @@ "type": "integer", "format": "int64" }, - "code": { + "Iso2": { "type": "string" }, - "code3": { + "Iso3": { "type": "string" }, "numCode": { @@ -99,6 +141,21 @@ "phoneCode": { "type": "string" }, + "currency": { + "type": "string" + }, + "currencySymbol": { + "type": "string" + }, + "region": { + "type": "string" + }, + "timezones": { + "type": "string" + }, + "translations": { + "type": "string" + }, "name": { "type": "string" }, @@ -162,48 +219,6 @@ } } }, - "initialRegionItem": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "pid": { - "type": "string" - }, - "deep": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - }, - "pinyinPrefix": { - "type": "string" - }, - "pinyin": { - "type": "string" - }, - "extId": { - "type": "string" - }, - "extName": { - "type": "string" - } - } - }, - "initialRegionReply": { - "type": "object", - "properties": { - "regions": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/initialRegionItem" - } - } - } - }, "initialStatusReply": { "type": "object", "properties": { diff --git a/golnag/initial/data.pb.go b/golnag/initial/data.pb.go index 21dd596..c34359d 100644 --- a/golnag/initial/data.pb.go +++ b/golnag/initial/data.pb.go @@ -102,18 +102,23 @@ func (x *CountryReply) GetCountries() []*CountryItem { } type CountryItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` - Code_3 string `protobuf:"bytes,3,opt,name=code_3,json=code3,proto3" json:"code_3,omitempty"` - NumCode string `protobuf:"bytes,4,opt,name=num_code,json=numCode,proto3" json:"num_code,omitempty"` - PhoneCode string `protobuf:"bytes,5,opt,name=phone_code,json=phoneCode,proto3" json:"phone_code,omitempty"` - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` - LocalName string `protobuf:"bytes,7,opt,name=local_name,json=localName,proto3" json:"local_name,omitempty"` - Enabled bool `protobuf:"varint,8,opt,name=enabled,proto3" json:"enabled,omitempty"` - SortOrder int32 `protobuf:"varint,9,opt,name=sort_order,json=sortOrder,proto3" json:"sort_order,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Iso2 string `protobuf:"bytes,2,opt,name=Iso2,proto3" json:"Iso2,omitempty"` + Iso3 string `protobuf:"bytes,3,opt,name=Iso3,proto3" json:"Iso3,omitempty"` + NumCode string `protobuf:"bytes,4,opt,name=num_code,json=numCode,proto3" json:"num_code,omitempty"` + PhoneCode string `protobuf:"bytes,5,opt,name=phone_code,json=phoneCode,proto3" json:"phone_code,omitempty"` + Currency string `protobuf:"bytes,6,opt,name=currency,proto3" json:"currency,omitempty"` + CurrencySymbol string `protobuf:"bytes,7,opt,name=currency_symbol,json=currencySymbol,proto3" json:"currency_symbol,omitempty"` + Region string `protobuf:"bytes,8,opt,name=region,proto3" json:"region,omitempty"` + Timezones string `protobuf:"bytes,9,opt,name=timezones,proto3" json:"timezones,omitempty"` + Translations string `protobuf:"bytes,10,opt,name=translations,proto3" json:"translations,omitempty"` + Name string `protobuf:"bytes,11,opt,name=name,proto3" json:"name,omitempty"` + LocalName string `protobuf:"bytes,12,opt,name=local_name,json=localName,proto3" json:"local_name,omitempty"` + Enabled bool `protobuf:"varint,13,opt,name=enabled,proto3" json:"enabled,omitempty"` + SortOrder int32 `protobuf:"varint,14,opt,name=sort_order,json=sortOrder,proto3" json:"sort_order,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CountryItem) Reset() { @@ -153,16 +158,16 @@ func (x *CountryItem) GetId() uint32 { return 0 } -func (x *CountryItem) GetCode() string { +func (x *CountryItem) GetIso2() string { if x != nil { - return x.Code + return x.Iso2 } return "" } -func (x *CountryItem) GetCode_3() string { +func (x *CountryItem) GetIso3() string { if x != nil { - return x.Code_3 + return x.Iso3 } return "" } @@ -181,6 +186,41 @@ func (x *CountryItem) GetPhoneCode() string { return "" } +func (x *CountryItem) GetCurrency() string { + if x != nil { + return x.Currency + } + return "" +} + +func (x *CountryItem) GetCurrencySymbol() string { + if x != nil { + return x.CurrencySymbol + } + return "" +} + +func (x *CountryItem) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *CountryItem) GetTimezones() string { + if x != nil { + return x.Timezones + } + return "" +} + +func (x *CountryItem) GetTranslations() string { + if x != nil { + return x.Translations + } + return "" +} + func (x *CountryItem) GetName() string { if x != nil { return x.Name @@ -209,7 +249,7 @@ func (x *CountryItem) GetSortOrder() int32 { return 0 } -type RegionRequest struct { +type AreasRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // 国家ID,默认:中国 1 CountryId int32 `protobuf:"varint,1,opt,name=country_id,json=countryId,proto3" json:"country_id,omitempty"` @@ -221,20 +261,20 @@ type RegionRequest struct { sizeCache protoimpl.SizeCache } -func (x *RegionRequest) Reset() { - *x = RegionRequest{} +func (x *AreasRequest) Reset() { + *x = AreasRequest{} mi := &file_data_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RegionRequest) String() string { +func (x *AreasRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RegionRequest) ProtoMessage() {} +func (*AreasRequest) ProtoMessage() {} -func (x *RegionRequest) ProtoReflect() protoreflect.Message { +func (x *AreasRequest) ProtoReflect() protoreflect.Message { mi := &file_data_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -246,53 +286,53 @@ func (x *RegionRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RegionRequest.ProtoReflect.Descriptor instead. -func (*RegionRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use AreasRequest.ProtoReflect.Descriptor instead. +func (*AreasRequest) Descriptor() ([]byte, []int) { return file_data_proto_rawDescGZIP(), []int{3} } -func (x *RegionRequest) GetCountryId() int32 { +func (x *AreasRequest) GetCountryId() int32 { if x != nil { return x.CountryId } return 0 } -func (x *RegionRequest) GetCountryCode() string { +func (x *AreasRequest) GetCountryCode() string { if x != nil { return x.CountryCode } return "" } -func (x *RegionRequest) GetShowTown() bool { +func (x *AreasRequest) GetShowTown() bool { if x != nil { return x.ShowTown } return false } -type RegionReply struct { +type AreasReply struct { state protoimpl.MessageState `protogen:"open.v1"` - Regions []*RegionItem `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"` + Areas []*AreasItem `protobuf:"bytes,1,rep,name=areas,proto3" json:"areas,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *RegionReply) Reset() { - *x = RegionReply{} +func (x *AreasReply) Reset() { + *x = AreasReply{} mi := &file_data_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RegionReply) String() string { +func (x *AreasReply) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RegionReply) ProtoMessage() {} +func (*AreasReply) ProtoMessage() {} -func (x *RegionReply) ProtoReflect() protoreflect.Message { +func (x *AreasReply) ProtoReflect() protoreflect.Message { mi := &file_data_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -304,19 +344,19 @@ func (x *RegionReply) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RegionReply.ProtoReflect.Descriptor instead. -func (*RegionReply) Descriptor() ([]byte, []int) { +// Deprecated: Use AreasReply.ProtoReflect.Descriptor instead. +func (*AreasReply) Descriptor() ([]byte, []int) { return file_data_proto_rawDescGZIP(), []int{4} } -func (x *RegionReply) GetRegions() []*RegionItem { +func (x *AreasReply) GetAreas() []*AreasItem { if x != nil { - return x.Regions + return x.Areas } return nil } -type RegionItem struct { +type AreasItem struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Pid string `protobuf:"bytes,2,opt,name=pid,proto3" json:"pid,omitempty"` @@ -330,20 +370,20 @@ type RegionItem struct { sizeCache protoimpl.SizeCache } -func (x *RegionItem) Reset() { - *x = RegionItem{} +func (x *AreasItem) Reset() { + *x = AreasItem{} mi := &file_data_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RegionItem) String() string { +func (x *AreasItem) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RegionItem) ProtoMessage() {} +func (*AreasItem) ProtoMessage() {} -func (x *RegionItem) ProtoReflect() protoreflect.Message { +func (x *AreasItem) ProtoReflect() protoreflect.Message { mi := &file_data_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -355,61 +395,61 @@ func (x *RegionItem) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RegionItem.ProtoReflect.Descriptor instead. -func (*RegionItem) Descriptor() ([]byte, []int) { +// Deprecated: Use AreasItem.ProtoReflect.Descriptor instead. +func (*AreasItem) Descriptor() ([]byte, []int) { return file_data_proto_rawDescGZIP(), []int{5} } -func (x *RegionItem) GetId() string { +func (x *AreasItem) GetId() string { if x != nil { return x.Id } return "" } -func (x *RegionItem) GetPid() string { +func (x *AreasItem) GetPid() string { if x != nil { return x.Pid } return "" } -func (x *RegionItem) GetDeep() int32 { +func (x *AreasItem) GetDeep() int32 { if x != nil { return x.Deep } return 0 } -func (x *RegionItem) GetName() string { +func (x *AreasItem) GetName() string { if x != nil { return x.Name } return "" } -func (x *RegionItem) GetPinyinPrefix() string { +func (x *AreasItem) GetPinyinPrefix() string { if x != nil { return x.PinyinPrefix } return "" } -func (x *RegionItem) GetPinyin() string { +func (x *AreasItem) GetPinyin() string { if x != nil { return x.Pinyin } return "" } -func (x *RegionItem) GetExtId() string { +func (x *AreasItem) GetExtId() string { if x != nil { return x.ExtId } return "" } -func (x *RegionItem) GetExtName() string { +func (x *AreasItem) GetExtName() string { if x != nil { return x.ExtName } @@ -552,29 +592,35 @@ const file_data_proto_rawDesc = "" + "data.proto\x12\ainitial\"\a\n" + "\x05Empty\"B\n" + "\fCountryReply\x122\n" + - "\tcountries\x18\x01 \x03(\v2\x14.initial.CountryItemR\tcountries\"\xee\x01\n" + + "\tcountries\x18\x01 \x03(\v2\x14.initial.CountryItemR\tcountries\"\x8a\x03\n" + "\vCountryItem\x12\x0e\n" + "\x02id\x18\x01 \x01(\rR\x02id\x12\x12\n" + - "\x04code\x18\x02 \x01(\tR\x04code\x12\x15\n" + - "\x06code_3\x18\x03 \x01(\tR\x05code3\x12\x19\n" + + "\x04Iso2\x18\x02 \x01(\tR\x04Iso2\x12\x12\n" + + "\x04Iso3\x18\x03 \x01(\tR\x04Iso3\x12\x19\n" + "\bnum_code\x18\x04 \x01(\tR\anumCode\x12\x1d\n" + "\n" + - "phone_code\x18\x05 \x01(\tR\tphoneCode\x12\x12\n" + - "\x04name\x18\x06 \x01(\tR\x04name\x12\x1d\n" + + "phone_code\x18\x05 \x01(\tR\tphoneCode\x12\x1a\n" + + "\bcurrency\x18\x06 \x01(\tR\bcurrency\x12'\n" + + "\x0fcurrency_symbol\x18\a \x01(\tR\x0ecurrencySymbol\x12\x16\n" + + "\x06region\x18\b \x01(\tR\x06region\x12\x1c\n" + + "\ttimezones\x18\t \x01(\tR\ttimezones\x12\"\n" + + "\ftranslations\x18\n" + + " \x01(\tR\ftranslations\x12\x12\n" + + "\x04name\x18\v \x01(\tR\x04name\x12\x1d\n" + "\n" + - "local_name\x18\a \x01(\tR\tlocalName\x12\x18\n" + - "\aenabled\x18\b \x01(\bR\aenabled\x12\x1d\n" + + "local_name\x18\f \x01(\tR\tlocalName\x12\x18\n" + + "\aenabled\x18\r \x01(\bR\aenabled\x12\x1d\n" + "\n" + - "sort_order\x18\t \x01(\x05R\tsortOrder\"n\n" + - "\rRegionRequest\x12\x1d\n" + + "sort_order\x18\x0e \x01(\x05R\tsortOrder\"m\n" + + "\fAreasRequest\x12\x1d\n" + "\n" + "country_id\x18\x01 \x01(\x05R\tcountryId\x12!\n" + "\fcountry_code\x18\x02 \x01(\tR\vcountryCode\x12\x1b\n" + - "\tshow_town\x18\x03 \x01(\bR\bshowTown\"<\n" + - "\vRegionReply\x12-\n" + - "\aregions\x18\x01 \x03(\v2\x13.initial.RegionItemR\aregions\"\xc5\x01\n" + + "\tshow_town\x18\x03 \x01(\bR\bshowTown\"6\n" + "\n" + - "RegionItem\x12\x0e\n" + + "AreasReply\x12(\n" + + "\x05areas\x18\x01 \x03(\v2\x12.initial.AreasItemR\x05areas\"\xc4\x01\n" + + "\tAreasItem\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x10\n" + "\x03pid\x18\x02 \x01(\tR\x03pid\x12\x12\n" + "\x04deep\x18\x03 \x01(\x05R\x04deep\x12\x12\n" + @@ -592,10 +638,10 @@ const file_data_proto_rawDesc = "" + "\x03key\x18\x03 \x01(\tR\x03key\x12\x14\n" + "\x05title\x18\x04 \x01(\tR\x05title\x12\x16\n" + "\x06remark\x18\x05 \x01(\tR\x06remark\x12\x12\n" + - "\x04icon\x18\x06 \x01(\tR\x04icon2\xa4\x01\n" + + "\x04icon\x18\x06 \x01(\tR\x04icon2\xa1\x01\n" + "\x04Data\x122\n" + - "\aCountry\x12\x0e.initial.Empty\x1a\x15.initial.CountryReply\"\x00\x128\n" + - "\x06Region\x12\x16.initial.RegionRequest\x1a\x14.initial.RegionReply\"\x00\x12.\n" + + "\aCountry\x12\x0e.initial.Empty\x1a\x15.initial.CountryReply\"\x00\x125\n" + + "\x05Areas\x12\x15.initial.AreasRequest\x1a\x13.initial.AreasReply\"\x00\x12.\n" + "\x05Datas\x12\x0e.initial.Empty\x1a\x13.initial.DatasReply\"\x00B\vZ\t.;initialb\x06proto3" var ( @@ -612,24 +658,24 @@ func file_data_proto_rawDescGZIP() []byte { var file_data_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_data_proto_goTypes = []any{ - (*Empty)(nil), // 0: initial.Empty - (*CountryReply)(nil), // 1: initial.CountryReply - (*CountryItem)(nil), // 2: initial.CountryItem - (*RegionRequest)(nil), // 3: initial.RegionRequest - (*RegionReply)(nil), // 4: initial.RegionReply - (*RegionItem)(nil), // 5: initial.RegionItem - (*DatasReply)(nil), // 6: initial.DatasReply - (*DatasItem)(nil), // 7: initial.DatasItem + (*Empty)(nil), // 0: initial.Empty + (*CountryReply)(nil), // 1: initial.CountryReply + (*CountryItem)(nil), // 2: initial.CountryItem + (*AreasRequest)(nil), // 3: initial.AreasRequest + (*AreasReply)(nil), // 4: initial.AreasReply + (*AreasItem)(nil), // 5: initial.AreasItem + (*DatasReply)(nil), // 6: initial.DatasReply + (*DatasItem)(nil), // 7: initial.DatasItem } var file_data_proto_depIdxs = []int32{ 2, // 0: initial.CountryReply.countries:type_name -> initial.CountryItem - 5, // 1: initial.RegionReply.regions:type_name -> initial.RegionItem + 5, // 1: initial.AreasReply.areas:type_name -> initial.AreasItem 7, // 2: initial.DatasReply.datas:type_name -> initial.DatasItem 0, // 3: initial.Data.Country:input_type -> initial.Empty - 3, // 4: initial.Data.Region:input_type -> initial.RegionRequest + 3, // 4: initial.Data.Areas:input_type -> initial.AreasRequest 0, // 5: initial.Data.Datas:input_type -> initial.Empty 1, // 6: initial.Data.Country:output_type -> initial.CountryReply - 4, // 7: initial.Data.Region:output_type -> initial.RegionReply + 4, // 7: initial.Data.Areas:output_type -> initial.AreasReply 6, // 8: initial.Data.Datas:output_type -> initial.DatasReply 6, // [6:9] is the sub-list for method output_type 3, // [3:6] is the sub-list for method input_type diff --git a/golnag/initial/data_grpc.pb.go b/golnag/initial/data_grpc.pb.go index 74c4e3e..252191d 100644 --- a/golnag/initial/data_grpc.pb.go +++ b/golnag/initial/data_grpc.pb.go @@ -20,7 +20,7 @@ const _ = grpc.SupportPackageIsVersion9 const ( Data_Country_FullMethodName = "/initial.Data/Country" - Data_Region_FullMethodName = "/initial.Data/Region" + Data_Areas_FullMethodName = "/initial.Data/Areas" Data_Datas_FullMethodName = "/initial.Data/Datas" ) @@ -32,8 +32,8 @@ const ( type DataClient interface { Country(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CountryReply, error) // 系统区域数据,默认级别:市 - Region(ctx context.Context, in *RegionRequest, opts ...grpc.CallOption) (*RegionReply, error) - // 系统标签数据 + Areas(ctx context.Context, in *AreasRequest, opts ...grpc.CallOption) (*AreasReply, error) + // 系统数据 Datas(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DatasReply, error) } @@ -55,10 +55,10 @@ func (c *dataClient) Country(ctx context.Context, in *Empty, opts ...grpc.CallOp return out, nil } -func (c *dataClient) Region(ctx context.Context, in *RegionRequest, opts ...grpc.CallOption) (*RegionReply, error) { +func (c *dataClient) Areas(ctx context.Context, in *AreasRequest, opts ...grpc.CallOption) (*AreasReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RegionReply) - err := c.cc.Invoke(ctx, Data_Region_FullMethodName, in, out, cOpts...) + out := new(AreasReply) + err := c.cc.Invoke(ctx, Data_Areas_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -83,8 +83,8 @@ func (c *dataClient) Datas(ctx context.Context, in *Empty, opts ...grpc.CallOpti type DataServer interface { Country(context.Context, *Empty) (*CountryReply, error) // 系统区域数据,默认级别:市 - Region(context.Context, *RegionRequest) (*RegionReply, error) - // 系统标签数据 + Areas(context.Context, *AreasRequest) (*AreasReply, error) + // 系统数据 Datas(context.Context, *Empty) (*DatasReply, error) mustEmbedUnimplementedDataServer() } @@ -99,8 +99,8 @@ type UnimplementedDataServer struct{} func (UnimplementedDataServer) Country(context.Context, *Empty) (*CountryReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Country not implemented") } -func (UnimplementedDataServer) Region(context.Context, *RegionRequest) (*RegionReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Region not implemented") +func (UnimplementedDataServer) Areas(context.Context, *AreasRequest) (*AreasReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Areas not implemented") } func (UnimplementedDataServer) Datas(context.Context, *Empty) (*DatasReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Datas not implemented") @@ -144,20 +144,20 @@ func _Data_Country_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Data_Region_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegionRequest) +func _Data_Areas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AreasRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(DataServer).Region(ctx, in) + return srv.(DataServer).Areas(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Data_Region_FullMethodName, + FullMethod: Data_Areas_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataServer).Region(ctx, req.(*RegionRequest)) + return srv.(DataServer).Areas(ctx, req.(*AreasRequest)) } return interceptor(ctx, in, info, handler) } @@ -192,8 +192,8 @@ var Data_ServiceDesc = grpc.ServiceDesc{ Handler: _Data_Country_Handler, }, { - MethodName: "Region", - Handler: _Data_Region_Handler, + MethodName: "Areas", + Handler: _Data_Areas_Handler, }, { MethodName: "Datas", diff --git a/typescript/initial/index.ts b/typescript/initial/index.ts index 078d7b9..32890a0 100644 --- a/typescript/initial/index.ts +++ b/typescript/initial/index.ts @@ -91,17 +91,22 @@ export type CountryReply = { export type CountryItem = { id?: number; - code?: string; - code3?: string; + Iso2?: string; + Iso3?: string; numCode?: string; phoneCode?: string; + currency?: string; + currencySymbol?: string; + region?: string; + timezones?: string; + translations?: string; name?: string; localName?: string; enabled?: boolean; sortOrder?: number; }; -export type RegionRequest = { +export type AreasRequest = { /** 国家ID,默认:中国 1 */ countryId?: number; /** 国家代码,默认:中国 CN */ @@ -110,11 +115,11 @@ export type RegionRequest = { showTown?: boolean; }; -export type RegionReply = { - regions?: RegionItem[]; +export type AreasReply = { + areas?: AreasItem[]; }; -export type RegionItem = { +export type AreasItem = { id?: string; pid?: string; deep?: number;