@@ -14,7 +14,7 @@ | |||||
<PackageProjectUrl>https://github.com/SmallChi/JT808DotNetty</PackageProjectUrl> | <PackageProjectUrl>https://github.com/SmallChi/JT808DotNetty</PackageProjectUrl> | ||||
<PackageLicenseUrl>https://github.com/SmallChi/JT808DotNetty/blob/master/LICENSE</PackageLicenseUrl> | <PackageLicenseUrl>https://github.com/SmallChi/JT808DotNetty/blob/master/LICENSE</PackageLicenseUrl> | ||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | <GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||||
<Version>1.1.0</Version> | |||||
<Version>1.1.1</Version> | |||||
</PropertyGroup> | </PropertyGroup> | ||||
</Project> | </Project> |
@@ -1,8 +0,0 @@ | |||||
syntax = "proto3"; | |||||
package JT808.GrpcDashbord.ServiceGrpcBase; | |||||
// 空请求 | |||||
message EmptyRequest{ | |||||
} |
@@ -1,15 +0,0 @@ | |||||
using Grpc.Core; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.DotNetty.Dashbord.GrpcProtocol.Extensions | |||||
{ | |||||
public static class ErrorExtensions | |||||
{ | |||||
public static void Unauthenticated(string msg= "Invalid Token") | |||||
{ | |||||
throw new Grpc.Core.RpcException(new Status(StatusCode.Unauthenticated, msg)); | |||||
} | |||||
} | |||||
} |
@@ -1,30 +0,0 @@ | |||||
using Grpc.Core; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.DotNetty.Dashbord.GrpcProtocol.Extensions | |||||
{ | |||||
public static class ServerCallContextExtensions | |||||
{ | |||||
public static void SetResultStatus(this ServerCallContext serverCallContext, StatusCode statusCode, string detail) | |||||
{ | |||||
serverCallContext.Status = new Status(statusCode, detail); | |||||
} | |||||
public static void Ok(this ServerCallContext serverCallContext,string detail="") | |||||
{ | |||||
serverCallContext.Status = new Status(StatusCode.OK, detail); | |||||
} | |||||
public static void Auth(this ServerCallContext serverCallContext, string detail = "") | |||||
{ | |||||
serverCallContext.Status = new Status(StatusCode.Unauthenticated, detail); | |||||
} | |||||
public static void InternalError(this ServerCallContext serverCallContext, string detail = "") | |||||
{ | |||||
serverCallContext.Status = new Status(StatusCode.Internal, detail); | |||||
} | |||||
} | |||||
} |
@@ -1,21 +0,0 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<TargetFramework>netstandard2.0</TargetFramework> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<PackageReference Include="Google.Protobuf" Version="3.6.1" /> | |||||
<PackageReference Include="Grpc" Version="1.17.1" /> | |||||
<PackageReference Include="Grpc.Tools" Version="1.17.1"> | |||||
<PrivateAssets>all</PrivateAssets> | |||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | |||||
</PackageReference> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Folder Include="csharp\" /> | |||||
<Folder Include="js\" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -1,15 +0,0 @@ | |||||
syntax = "proto3"; | |||||
package JT808.GrpcDashbord.AtomicCounterGrpcService; | |||||
import "EmptyRequest.proto"; | |||||
service AtomicCounterService{ | |||||
rpc GetTcpAtomicCounter(JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest) returns (AtomicCounterReply){} | |||||
rpc GetUdpAtomicCounter(JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest) returns (AtomicCounterReply){} | |||||
} | |||||
message AtomicCounterReply{ | |||||
int32 MsgSuccessCount = 1; | |||||
int32 MsgFailCount = 2; | |||||
} |
@@ -1,32 +0,0 @@ | |||||
syntax = "proto3"; | |||||
package JT808.GrpcDashbord.SessionGrpcService; | |||||
import "ResultReply.proto"; | |||||
import "EmptyRequest.proto"; | |||||
service SessionService{ | |||||
rpc GetTcpSessionAll(JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest) returns (TcpSessionReply){} | |||||
rpc GetUdpSessionAll(JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest) returns (UdpSessionReply){} | |||||
} | |||||
message TcpSessionReply{ | |||||
repeated SessionInfo SessionInfos=1; | |||||
JT808.GrpcDashbord.ServiceGrpcBase.ResultReply ResultReply=2; | |||||
} | |||||
message UdpSessionReply{ | |||||
repeated SessionInfo SessionInfos = 1; | |||||
JT808.GrpcDashbord.ServiceGrpcBase.ResultReply ResultReply=2; | |||||
} | |||||
message SessionInfo{ | |||||
// 最后上线时间 | |||||
int64 LastActiveTime=1; | |||||
// 上线时间 | |||||
int64 StartTime=2; | |||||
// 终端手机号 | |||||
string TerminalPhoneNo=3; | |||||
// 远程ip地址 | |||||
string RemoteAddressIP=4; | |||||
} |
@@ -1,18 +0,0 @@ | |||||
syntax = "proto3"; | |||||
package JT808.GrpcDashbord.AtomicCounterGrpcService; | |||||
import "ResultReply.proto"; | |||||
service UnificationSendService{ | |||||
// 文本信息下发 | |||||
rpc SendText(SendTextRequest) returns (JT808.GrpcDashbord.ServiceGrpcBase.ResultReply){} | |||||
} | |||||
//下发文本信息参数 | |||||
message SendTextRequest{ | |||||
//终端手机号 | |||||
string TerminalPhoneNo = 1; | |||||
//内容 | |||||
string Content = 2; | |||||
} |
@@ -1,9 +0,0 @@ | |||||
syntax = "proto3"; | |||||
package JT808.GrpcDashbord.ServiceGrpcBase; | |||||
// 统一分页返回参数 | |||||
message PageOptionsRequest{ | |||||
int32 PageIndex=1; | |||||
int32 Total =2; | |||||
} |
@@ -1,12 +0,0 @@ | |||||
syntax = "proto3"; | |||||
package JT808.GrpcDashbord.ServiceGrpcBase; | |||||
// 统一分页参数 | |||||
message PageRequest{ | |||||
int32 PageIndex=1; | |||||
int32 PageSize=2; | |||||
int32 Total =3; | |||||
int32 Skip=4; | |||||
map<string, string> Sort = 5; | |||||
} |
@@ -1,17 +0,0 @@ | |||||
syntax = "proto3"; | |||||
package JT808.GrpcDashbord.ServiceGrpcBase; | |||||
// 统一回复 | |||||
message ResultReply{ | |||||
// 状态码 | |||||
enum StatusCode{ | |||||
Success = 0; | |||||
NoContent = 1; | |||||
Failure = 2; | |||||
Unauthorized=3; | |||||
InnerError = 4; | |||||
} | |||||
StatusCode Code=1; | |||||
string Msg=2; | |||||
} |
@@ -1,147 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: EmptyRequest.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 1591, 0612, 3021 | |||||
#region Designer generated code | |||||
using pb = global::Google.Protobuf; | |||||
using pbc = global::Google.Protobuf.Collections; | |||||
using pbr = global::Google.Protobuf.Reflection; | |||||
using scg = global::System.Collections.Generic; | |||||
namespace JT808.GrpcDashbord.ServiceGrpcBase { | |||||
/// <summary>Holder for reflection information generated from EmptyRequest.proto</summary> | |||||
public static partial class EmptyRequestReflection { | |||||
#region Descriptor | |||||
/// <summary>File descriptor for EmptyRequest.proto</summary> | |||||
public static pbr::FileDescriptor Descriptor { | |||||
get { return descriptor; } | |||||
} | |||||
private static pbr::FileDescriptor descriptor; | |||||
static EmptyRequestReflection() { | |||||
byte[] descriptorData = global::System.Convert.FromBase64String( | |||||
string.Concat( | |||||
"ChJFbXB0eVJlcXVlc3QucHJvdG8SIkpUODA4LkdycGNEYXNoYm9yZC5TZXJ2", | |||||
"aWNlR3JwY0Jhc2UiDgoMRW1wdHlSZXF1ZXN0YgZwcm90bzM=")); | |||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | |||||
new pbr::FileDescriptor[] { }, | |||||
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest), global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.Parser, null, null, null, null) | |||||
})); | |||||
} | |||||
#endregion | |||||
} | |||||
#region Messages | |||||
/// <summary> | |||||
/// 空请求 | |||||
/// </summary> | |||||
public sealed partial class EmptyRequest : pb::IMessage<EmptyRequest> { | |||||
private static readonly pb::MessageParser<EmptyRequest> _parser = new pb::MessageParser<EmptyRequest>(() => new EmptyRequest()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<EmptyRequest> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequestReflection.Descriptor.MessageTypes[0]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public EmptyRequest() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public EmptyRequest(EmptyRequest other) : this() { | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public EmptyRequest Clone() { | |||||
return new EmptyRequest(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as EmptyRequest); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(EmptyRequest other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(EmptyRequest other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion Designer generated code |
@@ -1,209 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: JT808AtomicCounterService.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 1591, 0612, 3021 | |||||
#region Designer generated code | |||||
using pb = global::Google.Protobuf; | |||||
using pbc = global::Google.Protobuf.Collections; | |||||
using pbr = global::Google.Protobuf.Reflection; | |||||
using scg = global::System.Collections.Generic; | |||||
namespace JT808.GrpcDashbord.AtomicCounterGrpcService { | |||||
/// <summary>Holder for reflection information generated from JT808AtomicCounterService.proto</summary> | |||||
public static partial class JT808AtomicCounterServiceReflection { | |||||
#region Descriptor | |||||
/// <summary>File descriptor for JT808AtomicCounterService.proto</summary> | |||||
public static pbr::FileDescriptor Descriptor { | |||||
get { return descriptor; } | |||||
} | |||||
private static pbr::FileDescriptor descriptor; | |||||
static JT808AtomicCounterServiceReflection() { | |||||
byte[] descriptorData = global::System.Convert.FromBase64String( | |||||
string.Concat( | |||||
"Ch9KVDgwOEF0b21pY0NvdW50ZXJTZXJ2aWNlLnByb3RvEitKVDgwOC5HcnBj", | |||||
"RGFzaGJvcmQuQXRvbWljQ291bnRlckdycGNTZXJ2aWNlGhJFbXB0eVJlcXVl", | |||||
"c3QucHJvdG8iQwoSQXRvbWljQ291bnRlclJlcGx5EhcKD01zZ1N1Y2Nlc3ND", | |||||
"b3VudBgBIAEoBRIUCgxNc2dGYWlsQ291bnQYAiABKAUysAIKFEF0b21pY0Nv", | |||||
"dW50ZXJTZXJ2aWNlEooBChNHZXRUY3BBdG9taWNDb3VudGVyEjAuSlQ4MDgu", | |||||
"R3JwY0Rhc2hib3JkLlNlcnZpY2VHcnBjQmFzZS5FbXB0eVJlcXVlc3QaPy5K", | |||||
"VDgwOC5HcnBjRGFzaGJvcmQuQXRvbWljQ291bnRlckdycGNTZXJ2aWNlLkF0", | |||||
"b21pY0NvdW50ZXJSZXBseSIAEooBChNHZXRVZHBBdG9taWNDb3VudGVyEjAu", | |||||
"SlQ4MDguR3JwY0Rhc2hib3JkLlNlcnZpY2VHcnBjQmFzZS5FbXB0eVJlcXVl", | |||||
"c3QaPy5KVDgwOC5HcnBjRGFzaGJvcmQuQXRvbWljQ291bnRlckdycGNTZXJ2", | |||||
"aWNlLkF0b21pY0NvdW50ZXJSZXBseSIAYgZwcm90bzM=")); | |||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | |||||
new pbr::FileDescriptor[] { global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequestReflection.Descriptor, }, | |||||
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply), global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.Parser, new[]{ "MsgSuccessCount", "MsgFailCount" }, null, null, null) | |||||
})); | |||||
} | |||||
#endregion | |||||
} | |||||
#region Messages | |||||
public sealed partial class AtomicCounterReply : pb::IMessage<AtomicCounterReply> { | |||||
private static readonly pb::MessageParser<AtomicCounterReply> _parser = new pb::MessageParser<AtomicCounterReply>(() => new AtomicCounterReply()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<AtomicCounterReply> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.AtomicCounterGrpcService.JT808AtomicCounterServiceReflection.Descriptor.MessageTypes[0]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public AtomicCounterReply() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public AtomicCounterReply(AtomicCounterReply other) : this() { | |||||
msgSuccessCount_ = other.msgSuccessCount_; | |||||
msgFailCount_ = other.msgFailCount_; | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public AtomicCounterReply Clone() { | |||||
return new AtomicCounterReply(this); | |||||
} | |||||
/// <summary>Field number for the "MsgSuccessCount" field.</summary> | |||||
public const int MsgSuccessCountFieldNumber = 1; | |||||
private int msgSuccessCount_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int MsgSuccessCount { | |||||
get { return msgSuccessCount_; } | |||||
set { | |||||
msgSuccessCount_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "MsgFailCount" field.</summary> | |||||
public const int MsgFailCountFieldNumber = 2; | |||||
private int msgFailCount_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int MsgFailCount { | |||||
get { return msgFailCount_; } | |||||
set { | |||||
msgFailCount_ = value; | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as AtomicCounterReply); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(AtomicCounterReply other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
if (MsgSuccessCount != other.MsgSuccessCount) return false; | |||||
if (MsgFailCount != other.MsgFailCount) return false; | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
if (MsgSuccessCount != 0) hash ^= MsgSuccessCount.GetHashCode(); | |||||
if (MsgFailCount != 0) hash ^= MsgFailCount.GetHashCode(); | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
if (MsgSuccessCount != 0) { | |||||
output.WriteRawTag(8); | |||||
output.WriteInt32(MsgSuccessCount); | |||||
} | |||||
if (MsgFailCount != 0) { | |||||
output.WriteRawTag(16); | |||||
output.WriteInt32(MsgFailCount); | |||||
} | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
if (MsgSuccessCount != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(MsgSuccessCount); | |||||
} | |||||
if (MsgFailCount != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(MsgFailCount); | |||||
} | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(AtomicCounterReply other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
if (other.MsgSuccessCount != 0) { | |||||
MsgSuccessCount = other.MsgSuccessCount; | |||||
} | |||||
if (other.MsgFailCount != 0) { | |||||
MsgFailCount = other.MsgFailCount; | |||||
} | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
case 8: { | |||||
MsgSuccessCount = input.ReadInt32(); | |||||
break; | |||||
} | |||||
case 16: { | |||||
MsgFailCount = input.ReadInt32(); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion Designer generated code |
@@ -1,136 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: JT808AtomicCounterService.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 0414, 1591 | |||||
#region Designer generated code | |||||
using grpc = global::Grpc.Core; | |||||
namespace JT808.GrpcDashbord.AtomicCounterGrpcService { | |||||
public static partial class AtomicCounterService | |||||
{ | |||||
static readonly string __ServiceName = "JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterService"; | |||||
static readonly grpc::Marshaller<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest> __Marshaller_JT808_GrpcDashbord_ServiceGrpcBase_EmptyRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.Parser.ParseFrom); | |||||
static readonly grpc::Marshaller<global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> __Marshaller_JT808_GrpcDashbord_AtomicCounterGrpcService_AtomicCounterReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.Parser.ParseFrom); | |||||
static readonly grpc::Method<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> __Method_GetTcpAtomicCounter = new grpc::Method<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply>( | |||||
grpc::MethodType.Unary, | |||||
__ServiceName, | |||||
"GetTcpAtomicCounter", | |||||
__Marshaller_JT808_GrpcDashbord_ServiceGrpcBase_EmptyRequest, | |||||
__Marshaller_JT808_GrpcDashbord_AtomicCounterGrpcService_AtomicCounterReply); | |||||
static readonly grpc::Method<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> __Method_GetUdpAtomicCounter = new grpc::Method<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply>( | |||||
grpc::MethodType.Unary, | |||||
__ServiceName, | |||||
"GetUdpAtomicCounter", | |||||
__Marshaller_JT808_GrpcDashbord_ServiceGrpcBase_EmptyRequest, | |||||
__Marshaller_JT808_GrpcDashbord_AtomicCounterGrpcService_AtomicCounterReply); | |||||
/// <summary>Service descriptor</summary> | |||||
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor | |||||
{ | |||||
get { return global::JT808.GrpcDashbord.AtomicCounterGrpcService.JT808AtomicCounterServiceReflection.Descriptor.Services[0]; } | |||||
} | |||||
/// <summary>Base class for server-side implementations of AtomicCounterService</summary> | |||||
public abstract partial class AtomicCounterServiceBase | |||||
{ | |||||
public virtual global::System.Threading.Tasks.Task<global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> GetTcpAtomicCounter(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::ServerCallContext context) | |||||
{ | |||||
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); | |||||
} | |||||
public virtual global::System.Threading.Tasks.Task<global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> GetUdpAtomicCounter(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::ServerCallContext context) | |||||
{ | |||||
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); | |||||
} | |||||
} | |||||
/// <summary>Client for AtomicCounterService</summary> | |||||
public partial class AtomicCounterServiceClient : grpc::ClientBase<AtomicCounterServiceClient> | |||||
{ | |||||
/// <summary>Creates a new client for AtomicCounterService</summary> | |||||
/// <param name="channel">The channel to use to make remote calls.</param> | |||||
public AtomicCounterServiceClient(grpc::Channel channel) : base(channel) | |||||
{ | |||||
} | |||||
/// <summary>Creates a new client for AtomicCounterService that uses a custom <c>CallInvoker</c>.</summary> | |||||
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param> | |||||
public AtomicCounterServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) | |||||
{ | |||||
} | |||||
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> | |||||
protected AtomicCounterServiceClient() : base() | |||||
{ | |||||
} | |||||
/// <summary>Protected constructor to allow creation of configured clients.</summary> | |||||
/// <param name="configuration">The client configuration.</param> | |||||
protected AtomicCounterServiceClient(ClientBaseConfiguration configuration) : base(configuration) | |||||
{ | |||||
} | |||||
public virtual global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply GetTcpAtomicCounter(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return GetTcpAtomicCounter(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
public virtual global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply GetTcpAtomicCounter(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.BlockingUnaryCall(__Method_GetTcpAtomicCounter, null, options, request); | |||||
} | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> GetTcpAtomicCounterAsync(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return GetTcpAtomicCounterAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> GetTcpAtomicCounterAsync(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.AsyncUnaryCall(__Method_GetTcpAtomicCounter, null, options, request); | |||||
} | |||||
public virtual global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply GetUdpAtomicCounter(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return GetUdpAtomicCounter(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
public virtual global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply GetUdpAtomicCounter(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.BlockingUnaryCall(__Method_GetUdpAtomicCounter, null, options, request); | |||||
} | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> GetUdpAtomicCounterAsync(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return GetUdpAtomicCounterAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply> GetUdpAtomicCounterAsync(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.AsyncUnaryCall(__Method_GetUdpAtomicCounter, null, options, request); | |||||
} | |||||
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> | |||||
protected override AtomicCounterServiceClient NewInstance(ClientBaseConfiguration configuration) | |||||
{ | |||||
return new AtomicCounterServiceClient(configuration); | |||||
} | |||||
} | |||||
/// <summary>Creates service definition that can be registered with a server</summary> | |||||
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param> | |||||
public static grpc::ServerServiceDefinition BindService(AtomicCounterServiceBase serviceImpl) | |||||
{ | |||||
return grpc::ServerServiceDefinition.CreateBuilder() | |||||
.AddMethod(__Method_GetTcpAtomicCounter, serviceImpl.GetTcpAtomicCounter) | |||||
.AddMethod(__Method_GetUdpAtomicCounter, serviceImpl.GetUdpAtomicCounter).Build(); | |||||
} | |||||
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic. | |||||
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> | |||||
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> | |||||
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param> | |||||
public static void BindService(grpc::ServiceBinderBase serviceBinder, AtomicCounterServiceBase serviceImpl) | |||||
{ | |||||
serviceBinder.AddMethod(__Method_GetTcpAtomicCounter, serviceImpl.GetTcpAtomicCounter); | |||||
serviceBinder.AddMethod(__Method_GetUdpAtomicCounter, serviceImpl.GetUdpAtomicCounter); | |||||
} | |||||
} | |||||
} | |||||
#endregion |
@@ -1,597 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: JT808SessionService.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 1591, 0612, 3021 | |||||
#region Designer generated code | |||||
using pb = global::Google.Protobuf; | |||||
using pbc = global::Google.Protobuf.Collections; | |||||
using pbr = global::Google.Protobuf.Reflection; | |||||
using scg = global::System.Collections.Generic; | |||||
namespace JT808.GrpcDashbord.SessionGrpcService { | |||||
/// <summary>Holder for reflection information generated from JT808SessionService.proto</summary> | |||||
public static partial class JT808SessionServiceReflection { | |||||
#region Descriptor | |||||
/// <summary>File descriptor for JT808SessionService.proto</summary> | |||||
public static pbr::FileDescriptor Descriptor { | |||||
get { return descriptor; } | |||||
} | |||||
private static pbr::FileDescriptor descriptor; | |||||
static JT808SessionServiceReflection() { | |||||
byte[] descriptorData = global::System.Convert.FromBase64String( | |||||
string.Concat( | |||||
"ChlKVDgwOFNlc3Npb25TZXJ2aWNlLnByb3RvEiVKVDgwOC5HcnBjRGFzaGJv", | |||||
"cmQuU2Vzc2lvbkdycGNTZXJ2aWNlGhFSZXN1bHRSZXBseS5wcm90bxoSRW1w", | |||||
"dHlSZXF1ZXN0LnByb3RvIqEBCg9UY3BTZXNzaW9uUmVwbHkSSAoMU2Vzc2lv", | |||||
"bkluZm9zGAEgAygLMjIuSlQ4MDguR3JwY0Rhc2hib3JkLlNlc3Npb25HcnBj", | |||||
"U2VydmljZS5TZXNzaW9uSW5mbxJECgtSZXN1bHRSZXBseRgCIAEoCzIvLkpU", | |||||
"ODA4LkdycGNEYXNoYm9yZC5TZXJ2aWNlR3JwY0Jhc2UuUmVzdWx0UmVwbHki", | |||||
"oQEKD1VkcFNlc3Npb25SZXBseRJICgxTZXNzaW9uSW5mb3MYASADKAsyMi5K", | |||||
"VDgwOC5HcnBjRGFzaGJvcmQuU2Vzc2lvbkdycGNTZXJ2aWNlLlNlc3Npb25J", | |||||
"bmZvEkQKC1Jlc3VsdFJlcGx5GAIgASgLMi8uSlQ4MDguR3JwY0Rhc2hib3Jk", | |||||
"LlNlcnZpY2VHcnBjQmFzZS5SZXN1bHRSZXBseSJqCgtTZXNzaW9uSW5mbxIW", | |||||
"Cg5MYXN0QWN0aXZlVGltZRgBIAEoAxIRCglTdGFydFRpbWUYAiABKAMSFwoP", | |||||
"VGVybWluYWxQaG9uZU5vGAMgASgJEhcKD1JlbW90ZUFkZHJlc3NJUBgEIAEo", | |||||
"CTKQAgoOU2Vzc2lvblNlcnZpY2USfgoQR2V0VGNwU2Vzc2lvbkFsbBIwLkpU", | |||||
"ODA4LkdycGNEYXNoYm9yZC5TZXJ2aWNlR3JwY0Jhc2UuRW1wdHlSZXF1ZXN0", | |||||
"GjYuSlQ4MDguR3JwY0Rhc2hib3JkLlNlc3Npb25HcnBjU2VydmljZS5UY3BT", | |||||
"ZXNzaW9uUmVwbHkiABJ+ChBHZXRVZHBTZXNzaW9uQWxsEjAuSlQ4MDguR3Jw", | |||||
"Y0Rhc2hib3JkLlNlcnZpY2VHcnBjQmFzZS5FbXB0eVJlcXVlc3QaNi5KVDgw", | |||||
"OC5HcnBjRGFzaGJvcmQuU2Vzc2lvbkdycGNTZXJ2aWNlLlVkcFNlc3Npb25S", | |||||
"ZXBseSIAYgZwcm90bzM=")); | |||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | |||||
new pbr::FileDescriptor[] { global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReplyReflection.Descriptor, global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequestReflection.Descriptor, }, | |||||
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply), global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply.Parser, new[]{ "SessionInfos", "ResultReply" }, null, null, null), | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply), global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply.Parser, new[]{ "SessionInfos", "ResultReply" }, null, null, null), | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo), global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo.Parser, new[]{ "LastActiveTime", "StartTime", "TerminalPhoneNo", "RemoteAddressIP" }, null, null, null) | |||||
})); | |||||
} | |||||
#endregion | |||||
} | |||||
#region Messages | |||||
public sealed partial class TcpSessionReply : pb::IMessage<TcpSessionReply> { | |||||
private static readonly pb::MessageParser<TcpSessionReply> _parser = new pb::MessageParser<TcpSessionReply>(() => new TcpSessionReply()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<TcpSessionReply> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.SessionGrpcService.JT808SessionServiceReflection.Descriptor.MessageTypes[0]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public TcpSessionReply() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public TcpSessionReply(TcpSessionReply other) : this() { | |||||
sessionInfos_ = other.sessionInfos_.Clone(); | |||||
resultReply_ = other.resultReply_ != null ? other.resultReply_.Clone() : null; | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public TcpSessionReply Clone() { | |||||
return new TcpSessionReply(this); | |||||
} | |||||
/// <summary>Field number for the "SessionInfos" field.</summary> | |||||
public const int SessionInfosFieldNumber = 1; | |||||
private static readonly pb::FieldCodec<global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo> _repeated_sessionInfos_codec | |||||
= pb::FieldCodec.ForMessage(10, global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo.Parser); | |||||
private readonly pbc::RepeatedField<global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo> sessionInfos_ = new pbc::RepeatedField<global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo>(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public pbc::RepeatedField<global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo> SessionInfos { | |||||
get { return sessionInfos_; } | |||||
} | |||||
/// <summary>Field number for the "ResultReply" field.</summary> | |||||
public const int ResultReplyFieldNumber = 2; | |||||
private global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply resultReply_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply ResultReply { | |||||
get { return resultReply_; } | |||||
set { | |||||
resultReply_ = value; | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as TcpSessionReply); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(TcpSessionReply other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
if(!sessionInfos_.Equals(other.sessionInfos_)) return false; | |||||
if (!object.Equals(ResultReply, other.ResultReply)) return false; | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
hash ^= sessionInfos_.GetHashCode(); | |||||
if (resultReply_ != null) hash ^= ResultReply.GetHashCode(); | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
sessionInfos_.WriteTo(output, _repeated_sessionInfos_codec); | |||||
if (resultReply_ != null) { | |||||
output.WriteRawTag(18); | |||||
output.WriteMessage(ResultReply); | |||||
} | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
size += sessionInfos_.CalculateSize(_repeated_sessionInfos_codec); | |||||
if (resultReply_ != null) { | |||||
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ResultReply); | |||||
} | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(TcpSessionReply other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
sessionInfos_.Add(other.sessionInfos_); | |||||
if (other.resultReply_ != null) { | |||||
if (resultReply_ == null) { | |||||
resultReply_ = new global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply(); | |||||
} | |||||
ResultReply.MergeFrom(other.ResultReply); | |||||
} | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
case 10: { | |||||
sessionInfos_.AddEntriesFrom(input, _repeated_sessionInfos_codec); | |||||
break; | |||||
} | |||||
case 18: { | |||||
if (resultReply_ == null) { | |||||
resultReply_ = new global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply(); | |||||
} | |||||
input.ReadMessage(resultReply_); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
public sealed partial class UdpSessionReply : pb::IMessage<UdpSessionReply> { | |||||
private static readonly pb::MessageParser<UdpSessionReply> _parser = new pb::MessageParser<UdpSessionReply>(() => new UdpSessionReply()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<UdpSessionReply> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.SessionGrpcService.JT808SessionServiceReflection.Descriptor.MessageTypes[1]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public UdpSessionReply() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public UdpSessionReply(UdpSessionReply other) : this() { | |||||
sessionInfos_ = other.sessionInfos_.Clone(); | |||||
resultReply_ = other.resultReply_ != null ? other.resultReply_.Clone() : null; | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public UdpSessionReply Clone() { | |||||
return new UdpSessionReply(this); | |||||
} | |||||
/// <summary>Field number for the "SessionInfos" field.</summary> | |||||
public const int SessionInfosFieldNumber = 1; | |||||
private static readonly pb::FieldCodec<global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo> _repeated_sessionInfos_codec | |||||
= pb::FieldCodec.ForMessage(10, global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo.Parser); | |||||
private readonly pbc::RepeatedField<global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo> sessionInfos_ = new pbc::RepeatedField<global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo>(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public pbc::RepeatedField<global::JT808.GrpcDashbord.SessionGrpcService.SessionInfo> SessionInfos { | |||||
get { return sessionInfos_; } | |||||
} | |||||
/// <summary>Field number for the "ResultReply" field.</summary> | |||||
public const int ResultReplyFieldNumber = 2; | |||||
private global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply resultReply_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply ResultReply { | |||||
get { return resultReply_; } | |||||
set { | |||||
resultReply_ = value; | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as UdpSessionReply); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(UdpSessionReply other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
if(!sessionInfos_.Equals(other.sessionInfos_)) return false; | |||||
if (!object.Equals(ResultReply, other.ResultReply)) return false; | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
hash ^= sessionInfos_.GetHashCode(); | |||||
if (resultReply_ != null) hash ^= ResultReply.GetHashCode(); | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
sessionInfos_.WriteTo(output, _repeated_sessionInfos_codec); | |||||
if (resultReply_ != null) { | |||||
output.WriteRawTag(18); | |||||
output.WriteMessage(ResultReply); | |||||
} | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
size += sessionInfos_.CalculateSize(_repeated_sessionInfos_codec); | |||||
if (resultReply_ != null) { | |||||
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ResultReply); | |||||
} | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(UdpSessionReply other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
sessionInfos_.Add(other.sessionInfos_); | |||||
if (other.resultReply_ != null) { | |||||
if (resultReply_ == null) { | |||||
resultReply_ = new global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply(); | |||||
} | |||||
ResultReply.MergeFrom(other.ResultReply); | |||||
} | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
case 10: { | |||||
sessionInfos_.AddEntriesFrom(input, _repeated_sessionInfos_codec); | |||||
break; | |||||
} | |||||
case 18: { | |||||
if (resultReply_ == null) { | |||||
resultReply_ = new global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply(); | |||||
} | |||||
input.ReadMessage(resultReply_); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
public sealed partial class SessionInfo : pb::IMessage<SessionInfo> { | |||||
private static readonly pb::MessageParser<SessionInfo> _parser = new pb::MessageParser<SessionInfo>(() => new SessionInfo()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<SessionInfo> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.SessionGrpcService.JT808SessionServiceReflection.Descriptor.MessageTypes[2]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public SessionInfo() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public SessionInfo(SessionInfo other) : this() { | |||||
lastActiveTime_ = other.lastActiveTime_; | |||||
startTime_ = other.startTime_; | |||||
terminalPhoneNo_ = other.terminalPhoneNo_; | |||||
remoteAddressIP_ = other.remoteAddressIP_; | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public SessionInfo Clone() { | |||||
return new SessionInfo(this); | |||||
} | |||||
/// <summary>Field number for the "LastActiveTime" field.</summary> | |||||
public const int LastActiveTimeFieldNumber = 1; | |||||
private long lastActiveTime_; | |||||
/// <summary> | |||||
/// 最后上线时间 | |||||
/// </summary> | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public long LastActiveTime { | |||||
get { return lastActiveTime_; } | |||||
set { | |||||
lastActiveTime_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "StartTime" field.</summary> | |||||
public const int StartTimeFieldNumber = 2; | |||||
private long startTime_; | |||||
/// <summary> | |||||
/// 上线时间 | |||||
/// </summary> | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public long StartTime { | |||||
get { return startTime_; } | |||||
set { | |||||
startTime_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "TerminalPhoneNo" field.</summary> | |||||
public const int TerminalPhoneNoFieldNumber = 3; | |||||
private string terminalPhoneNo_ = ""; | |||||
/// <summary> | |||||
/// 终端手机号 | |||||
/// </summary> | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public string TerminalPhoneNo { | |||||
get { return terminalPhoneNo_; } | |||||
set { | |||||
terminalPhoneNo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); | |||||
} | |||||
} | |||||
/// <summary>Field number for the "RemoteAddressIP" field.</summary> | |||||
public const int RemoteAddressIPFieldNumber = 4; | |||||
private string remoteAddressIP_ = ""; | |||||
/// <summary> | |||||
/// 远程ip地址 | |||||
/// </summary> | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public string RemoteAddressIP { | |||||
get { return remoteAddressIP_; } | |||||
set { | |||||
remoteAddressIP_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as SessionInfo); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(SessionInfo other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
if (LastActiveTime != other.LastActiveTime) return false; | |||||
if (StartTime != other.StartTime) return false; | |||||
if (TerminalPhoneNo != other.TerminalPhoneNo) return false; | |||||
if (RemoteAddressIP != other.RemoteAddressIP) return false; | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
if (LastActiveTime != 0L) hash ^= LastActiveTime.GetHashCode(); | |||||
if (StartTime != 0L) hash ^= StartTime.GetHashCode(); | |||||
if (TerminalPhoneNo.Length != 0) hash ^= TerminalPhoneNo.GetHashCode(); | |||||
if (RemoteAddressIP.Length != 0) hash ^= RemoteAddressIP.GetHashCode(); | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
if (LastActiveTime != 0L) { | |||||
output.WriteRawTag(8); | |||||
output.WriteInt64(LastActiveTime); | |||||
} | |||||
if (StartTime != 0L) { | |||||
output.WriteRawTag(16); | |||||
output.WriteInt64(StartTime); | |||||
} | |||||
if (TerminalPhoneNo.Length != 0) { | |||||
output.WriteRawTag(26); | |||||
output.WriteString(TerminalPhoneNo); | |||||
} | |||||
if (RemoteAddressIP.Length != 0) { | |||||
output.WriteRawTag(34); | |||||
output.WriteString(RemoteAddressIP); | |||||
} | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
if (LastActiveTime != 0L) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt64Size(LastActiveTime); | |||||
} | |||||
if (StartTime != 0L) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt64Size(StartTime); | |||||
} | |||||
if (TerminalPhoneNo.Length != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(TerminalPhoneNo); | |||||
} | |||||
if (RemoteAddressIP.Length != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(RemoteAddressIP); | |||||
} | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(SessionInfo other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
if (other.LastActiveTime != 0L) { | |||||
LastActiveTime = other.LastActiveTime; | |||||
} | |||||
if (other.StartTime != 0L) { | |||||
StartTime = other.StartTime; | |||||
} | |||||
if (other.TerminalPhoneNo.Length != 0) { | |||||
TerminalPhoneNo = other.TerminalPhoneNo; | |||||
} | |||||
if (other.RemoteAddressIP.Length != 0) { | |||||
RemoteAddressIP = other.RemoteAddressIP; | |||||
} | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
case 8: { | |||||
LastActiveTime = input.ReadInt64(); | |||||
break; | |||||
} | |||||
case 16: { | |||||
StartTime = input.ReadInt64(); | |||||
break; | |||||
} | |||||
case 26: { | |||||
TerminalPhoneNo = input.ReadString(); | |||||
break; | |||||
} | |||||
case 34: { | |||||
RemoteAddressIP = input.ReadString(); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion Designer generated code |
@@ -1,137 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: JT808SessionService.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 0414, 1591 | |||||
#region Designer generated code | |||||
using grpc = global::Grpc.Core; | |||||
namespace JT808.GrpcDashbord.SessionGrpcService { | |||||
public static partial class SessionService | |||||
{ | |||||
static readonly string __ServiceName = "JT808.GrpcDashbord.SessionGrpcService.SessionService"; | |||||
static readonly grpc::Marshaller<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest> __Marshaller_JT808_GrpcDashbord_ServiceGrpcBase_EmptyRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.Parser.ParseFrom); | |||||
static readonly grpc::Marshaller<global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply> __Marshaller_JT808_GrpcDashbord_SessionGrpcService_TcpSessionReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply.Parser.ParseFrom); | |||||
static readonly grpc::Marshaller<global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply> __Marshaller_JT808_GrpcDashbord_SessionGrpcService_UdpSessionReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply.Parser.ParseFrom); | |||||
static readonly grpc::Method<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply> __Method_GetTcpSessionAll = new grpc::Method<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply>( | |||||
grpc::MethodType.Unary, | |||||
__ServiceName, | |||||
"GetTcpSessionAll", | |||||
__Marshaller_JT808_GrpcDashbord_ServiceGrpcBase_EmptyRequest, | |||||
__Marshaller_JT808_GrpcDashbord_SessionGrpcService_TcpSessionReply); | |||||
static readonly grpc::Method<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply> __Method_GetUdpSessionAll = new grpc::Method<global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply>( | |||||
grpc::MethodType.Unary, | |||||
__ServiceName, | |||||
"GetUdpSessionAll", | |||||
__Marshaller_JT808_GrpcDashbord_ServiceGrpcBase_EmptyRequest, | |||||
__Marshaller_JT808_GrpcDashbord_SessionGrpcService_UdpSessionReply); | |||||
/// <summary>Service descriptor</summary> | |||||
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor | |||||
{ | |||||
get { return global::JT808.GrpcDashbord.SessionGrpcService.JT808SessionServiceReflection.Descriptor.Services[0]; } | |||||
} | |||||
/// <summary>Base class for server-side implementations of SessionService</summary> | |||||
public abstract partial class SessionServiceBase | |||||
{ | |||||
public virtual global::System.Threading.Tasks.Task<global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply> GetTcpSessionAll(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::ServerCallContext context) | |||||
{ | |||||
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); | |||||
} | |||||
public virtual global::System.Threading.Tasks.Task<global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply> GetUdpSessionAll(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::ServerCallContext context) | |||||
{ | |||||
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); | |||||
} | |||||
} | |||||
/// <summary>Client for SessionService</summary> | |||||
public partial class SessionServiceClient : grpc::ClientBase<SessionServiceClient> | |||||
{ | |||||
/// <summary>Creates a new client for SessionService</summary> | |||||
/// <param name="channel">The channel to use to make remote calls.</param> | |||||
public SessionServiceClient(grpc::Channel channel) : base(channel) | |||||
{ | |||||
} | |||||
/// <summary>Creates a new client for SessionService that uses a custom <c>CallInvoker</c>.</summary> | |||||
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param> | |||||
public SessionServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) | |||||
{ | |||||
} | |||||
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> | |||||
protected SessionServiceClient() : base() | |||||
{ | |||||
} | |||||
/// <summary>Protected constructor to allow creation of configured clients.</summary> | |||||
/// <param name="configuration">The client configuration.</param> | |||||
protected SessionServiceClient(ClientBaseConfiguration configuration) : base(configuration) | |||||
{ | |||||
} | |||||
public virtual global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply GetTcpSessionAll(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return GetTcpSessionAll(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
public virtual global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply GetTcpSessionAll(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.BlockingUnaryCall(__Method_GetTcpSessionAll, null, options, request); | |||||
} | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply> GetTcpSessionAllAsync(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return GetTcpSessionAllAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.SessionGrpcService.TcpSessionReply> GetTcpSessionAllAsync(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.AsyncUnaryCall(__Method_GetTcpSessionAll, null, options, request); | |||||
} | |||||
public virtual global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply GetUdpSessionAll(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return GetUdpSessionAll(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
public virtual global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply GetUdpSessionAll(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.BlockingUnaryCall(__Method_GetUdpSessionAll, null, options, request); | |||||
} | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply> GetUdpSessionAllAsync(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return GetUdpSessionAllAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.SessionGrpcService.UdpSessionReply> GetUdpSessionAllAsync(global::JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.AsyncUnaryCall(__Method_GetUdpSessionAll, null, options, request); | |||||
} | |||||
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> | |||||
protected override SessionServiceClient NewInstance(ClientBaseConfiguration configuration) | |||||
{ | |||||
return new SessionServiceClient(configuration); | |||||
} | |||||
} | |||||
/// <summary>Creates service definition that can be registered with a server</summary> | |||||
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param> | |||||
public static grpc::ServerServiceDefinition BindService(SessionServiceBase serviceImpl) | |||||
{ | |||||
return grpc::ServerServiceDefinition.CreateBuilder() | |||||
.AddMethod(__Method_GetTcpSessionAll, serviceImpl.GetTcpSessionAll) | |||||
.AddMethod(__Method_GetUdpSessionAll, serviceImpl.GetUdpSessionAll).Build(); | |||||
} | |||||
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic. | |||||
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> | |||||
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> | |||||
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param> | |||||
public static void BindService(grpc::ServiceBinderBase serviceBinder, SessionServiceBase serviceImpl) | |||||
{ | |||||
serviceBinder.AddMethod(__Method_GetTcpSessionAll, serviceImpl.GetTcpSessionAll); | |||||
serviceBinder.AddMethod(__Method_GetUdpSessionAll, serviceImpl.GetUdpSessionAll); | |||||
} | |||||
} | |||||
} | |||||
#endregion |
@@ -1,215 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: JT808UnificationSendService.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 1591, 0612, 3021 | |||||
#region Designer generated code | |||||
using pb = global::Google.Protobuf; | |||||
using pbc = global::Google.Protobuf.Collections; | |||||
using pbr = global::Google.Protobuf.Reflection; | |||||
using scg = global::System.Collections.Generic; | |||||
namespace JT808.GrpcDashbord.AtomicCounterGrpcService { | |||||
/// <summary>Holder for reflection information generated from JT808UnificationSendService.proto</summary> | |||||
public static partial class JT808UnificationSendServiceReflection { | |||||
#region Descriptor | |||||
/// <summary>File descriptor for JT808UnificationSendService.proto</summary> | |||||
public static pbr::FileDescriptor Descriptor { | |||||
get { return descriptor; } | |||||
} | |||||
private static pbr::FileDescriptor descriptor; | |||||
static JT808UnificationSendServiceReflection() { | |||||
byte[] descriptorData = global::System.Convert.FromBase64String( | |||||
string.Concat( | |||||
"CiFKVDgwOFVuaWZpY2F0aW9uU2VuZFNlcnZpY2UucHJvdG8SK0pUODA4Lkdy", | |||||
"cGNEYXNoYm9yZC5BdG9taWNDb3VudGVyR3JwY1NlcnZpY2UaEVJlc3VsdFJl", | |||||
"cGx5LnByb3RvIjsKD1NlbmRUZXh0UmVxdWVzdBIXCg9UZXJtaW5hbFBob25l", | |||||
"Tm8YASABKAkSDwoHQ29udGVudBgCIAEoCTKVAQoWVW5pZmljYXRpb25TZW5k", | |||||
"U2VydmljZRJ7CghTZW5kVGV4dBI8LkpUODA4LkdycGNEYXNoYm9yZC5BdG9t", | |||||
"aWNDb3VudGVyR3JwY1NlcnZpY2UuU2VuZFRleHRSZXF1ZXN0Gi8uSlQ4MDgu", | |||||
"R3JwY0Rhc2hib3JkLlNlcnZpY2VHcnBjQmFzZS5SZXN1bHRSZXBseSIAYgZw", | |||||
"cm90bzM=")); | |||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | |||||
new pbr::FileDescriptor[] { global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReplyReflection.Descriptor, }, | |||||
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest), global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest.Parser, new[]{ "TerminalPhoneNo", "Content" }, null, null, null) | |||||
})); | |||||
} | |||||
#endregion | |||||
} | |||||
#region Messages | |||||
/// <summary> | |||||
///下发文本信息参数 | |||||
/// </summary> | |||||
public sealed partial class SendTextRequest : pb::IMessage<SendTextRequest> { | |||||
private static readonly pb::MessageParser<SendTextRequest> _parser = new pb::MessageParser<SendTextRequest>(() => new SendTextRequest()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<SendTextRequest> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.AtomicCounterGrpcService.JT808UnificationSendServiceReflection.Descriptor.MessageTypes[0]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public SendTextRequest() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public SendTextRequest(SendTextRequest other) : this() { | |||||
terminalPhoneNo_ = other.terminalPhoneNo_; | |||||
content_ = other.content_; | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public SendTextRequest Clone() { | |||||
return new SendTextRequest(this); | |||||
} | |||||
/// <summary>Field number for the "TerminalPhoneNo" field.</summary> | |||||
public const int TerminalPhoneNoFieldNumber = 1; | |||||
private string terminalPhoneNo_ = ""; | |||||
/// <summary> | |||||
///终端手机号 | |||||
/// </summary> | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public string TerminalPhoneNo { | |||||
get { return terminalPhoneNo_; } | |||||
set { | |||||
terminalPhoneNo_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); | |||||
} | |||||
} | |||||
/// <summary>Field number for the "Content" field.</summary> | |||||
public const int ContentFieldNumber = 2; | |||||
private string content_ = ""; | |||||
/// <summary> | |||||
///内容 | |||||
/// </summary> | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public string Content { | |||||
get { return content_; } | |||||
set { | |||||
content_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as SendTextRequest); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(SendTextRequest other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
if (TerminalPhoneNo != other.TerminalPhoneNo) return false; | |||||
if (Content != other.Content) return false; | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
if (TerminalPhoneNo.Length != 0) hash ^= TerminalPhoneNo.GetHashCode(); | |||||
if (Content.Length != 0) hash ^= Content.GetHashCode(); | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
if (TerminalPhoneNo.Length != 0) { | |||||
output.WriteRawTag(10); | |||||
output.WriteString(TerminalPhoneNo); | |||||
} | |||||
if (Content.Length != 0) { | |||||
output.WriteRawTag(18); | |||||
output.WriteString(Content); | |||||
} | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
if (TerminalPhoneNo.Length != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(TerminalPhoneNo); | |||||
} | |||||
if (Content.Length != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Content); | |||||
} | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(SendTextRequest other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
if (other.TerminalPhoneNo.Length != 0) { | |||||
TerminalPhoneNo = other.TerminalPhoneNo; | |||||
} | |||||
if (other.Content.Length != 0) { | |||||
Content = other.Content; | |||||
} | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
case 10: { | |||||
TerminalPhoneNo = input.ReadString(); | |||||
break; | |||||
} | |||||
case 18: { | |||||
Content = input.ReadString(); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion Designer generated code |
@@ -1,140 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: JT808UnificationSendService.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 0414, 1591 | |||||
#region Designer generated code | |||||
using grpc = global::Grpc.Core; | |||||
namespace JT808.GrpcDashbord.AtomicCounterGrpcService { | |||||
public static partial class UnificationSendService | |||||
{ | |||||
static readonly string __ServiceName = "JT808.GrpcDashbord.AtomicCounterGrpcService.UnificationSendService"; | |||||
static readonly grpc::Marshaller<global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest> __Marshaller_JT808_GrpcDashbord_AtomicCounterGrpcService_SendTextRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest.Parser.ParseFrom); | |||||
static readonly grpc::Marshaller<global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply> __Marshaller_JT808_GrpcDashbord_ServiceGrpcBase_ResultReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply.Parser.ParseFrom); | |||||
static readonly grpc::Method<global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest, global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply> __Method_SendText = new grpc::Method<global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest, global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply>( | |||||
grpc::MethodType.Unary, | |||||
__ServiceName, | |||||
"SendText", | |||||
__Marshaller_JT808_GrpcDashbord_AtomicCounterGrpcService_SendTextRequest, | |||||
__Marshaller_JT808_GrpcDashbord_ServiceGrpcBase_ResultReply); | |||||
/// <summary>Service descriptor</summary> | |||||
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor | |||||
{ | |||||
get { return global::JT808.GrpcDashbord.AtomicCounterGrpcService.JT808UnificationSendServiceReflection.Descriptor.Services[0]; } | |||||
} | |||||
/// <summary>Base class for server-side implementations of UnificationSendService</summary> | |||||
public abstract partial class UnificationSendServiceBase | |||||
{ | |||||
/// <summary> | |||||
/// 文本信息下发 | |||||
/// </summary> | |||||
/// <param name="request">The request received from the client.</param> | |||||
/// <param name="context">The context of the server-side call handler being invoked.</param> | |||||
/// <returns>The response to send back to the client (wrapped by a task).</returns> | |||||
public virtual global::System.Threading.Tasks.Task<global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply> SendText(global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest request, grpc::ServerCallContext context) | |||||
{ | |||||
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); | |||||
} | |||||
} | |||||
/// <summary>Client for UnificationSendService</summary> | |||||
public partial class UnificationSendServiceClient : grpc::ClientBase<UnificationSendServiceClient> | |||||
{ | |||||
/// <summary>Creates a new client for UnificationSendService</summary> | |||||
/// <param name="channel">The channel to use to make remote calls.</param> | |||||
public UnificationSendServiceClient(grpc::Channel channel) : base(channel) | |||||
{ | |||||
} | |||||
/// <summary>Creates a new client for UnificationSendService that uses a custom <c>CallInvoker</c>.</summary> | |||||
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param> | |||||
public UnificationSendServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) | |||||
{ | |||||
} | |||||
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> | |||||
protected UnificationSendServiceClient() : base() | |||||
{ | |||||
} | |||||
/// <summary>Protected constructor to allow creation of configured clients.</summary> | |||||
/// <param name="configuration">The client configuration.</param> | |||||
protected UnificationSendServiceClient(ClientBaseConfiguration configuration) : base(configuration) | |||||
{ | |||||
} | |||||
/// <summary> | |||||
/// 文本信息下发 | |||||
/// </summary> | |||||
/// <param name="request">The request to send to the server.</param> | |||||
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> | |||||
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> | |||||
/// <param name="cancellationToken">An optional token for canceling the call.</param> | |||||
/// <returns>The response received from the server.</returns> | |||||
public virtual global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply SendText(global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return SendText(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
/// <summary> | |||||
/// 文本信息下发 | |||||
/// </summary> | |||||
/// <param name="request">The request to send to the server.</param> | |||||
/// <param name="options">The options for the call.</param> | |||||
/// <returns>The response received from the server.</returns> | |||||
public virtual global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply SendText(global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.BlockingUnaryCall(__Method_SendText, null, options, request); | |||||
} | |||||
/// <summary> | |||||
/// 文本信息下发 | |||||
/// </summary> | |||||
/// <param name="request">The request to send to the server.</param> | |||||
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> | |||||
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> | |||||
/// <param name="cancellationToken">An optional token for canceling the call.</param> | |||||
/// <returns>The call object.</returns> | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply> SendTextAsync(global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) | |||||
{ | |||||
return SendTextAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); | |||||
} | |||||
/// <summary> | |||||
/// 文本信息下发 | |||||
/// </summary> | |||||
/// <param name="request">The request to send to the server.</param> | |||||
/// <param name="options">The options for the call.</param> | |||||
/// <returns>The call object.</returns> | |||||
public virtual grpc::AsyncUnaryCall<global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply> SendTextAsync(global::JT808.GrpcDashbord.AtomicCounterGrpcService.SendTextRequest request, grpc::CallOptions options) | |||||
{ | |||||
return CallInvoker.AsyncUnaryCall(__Method_SendText, null, options, request); | |||||
} | |||||
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> | |||||
protected override UnificationSendServiceClient NewInstance(ClientBaseConfiguration configuration) | |||||
{ | |||||
return new UnificationSendServiceClient(configuration); | |||||
} | |||||
} | |||||
/// <summary>Creates service definition that can be registered with a server</summary> | |||||
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param> | |||||
public static grpc::ServerServiceDefinition BindService(UnificationSendServiceBase serviceImpl) | |||||
{ | |||||
return grpc::ServerServiceDefinition.CreateBuilder() | |||||
.AddMethod(__Method_SendText, serviceImpl.SendText).Build(); | |||||
} | |||||
/// <summary>Register service method implementations with a service binder. Useful when customizing the service binding logic. | |||||
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary> | |||||
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param> | |||||
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param> | |||||
public static void BindService(grpc::ServiceBinderBase serviceBinder, UnificationSendServiceBase serviceImpl) | |||||
{ | |||||
serviceBinder.AddMethod(__Method_SendText, serviceImpl.SendText); | |||||
} | |||||
} | |||||
} | |||||
#endregion |
@@ -1,204 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: PageReply.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 1591, 0612, 3021 | |||||
#region Designer generated code | |||||
using pb = global::Google.Protobuf; | |||||
using pbc = global::Google.Protobuf.Collections; | |||||
using pbr = global::Google.Protobuf.Reflection; | |||||
using scg = global::System.Collections.Generic; | |||||
namespace JT808.GrpcDashbord.ServiceGrpcBase { | |||||
/// <summary>Holder for reflection information generated from PageReply.proto</summary> | |||||
public static partial class PageReplyReflection { | |||||
#region Descriptor | |||||
/// <summary>File descriptor for PageReply.proto</summary> | |||||
public static pbr::FileDescriptor Descriptor { | |||||
get { return descriptor; } | |||||
} | |||||
private static pbr::FileDescriptor descriptor; | |||||
static PageReplyReflection() { | |||||
byte[] descriptorData = global::System.Convert.FromBase64String( | |||||
string.Concat( | |||||
"Cg9QYWdlUmVwbHkucHJvdG8SIkpUODA4LkdycGNEYXNoYm9yZC5TZXJ2aWNl", | |||||
"R3JwY0Jhc2UiNgoSUGFnZU9wdGlvbnNSZXF1ZXN0EhEKCVBhZ2VJbmRleBgB", | |||||
"IAEoBRINCgVUb3RhbBgCIAEoBWIGcHJvdG8z")); | |||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | |||||
new pbr::FileDescriptor[] { }, | |||||
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.ServiceGrpcBase.PageOptionsRequest), global::JT808.GrpcDashbord.ServiceGrpcBase.PageOptionsRequest.Parser, new[]{ "PageIndex", "Total" }, null, null, null) | |||||
})); | |||||
} | |||||
#endregion | |||||
} | |||||
#region Messages | |||||
/// <summary> | |||||
/// 统一分页返回参数 | |||||
/// </summary> | |||||
public sealed partial class PageOptionsRequest : pb::IMessage<PageOptionsRequest> { | |||||
private static readonly pb::MessageParser<PageOptionsRequest> _parser = new pb::MessageParser<PageOptionsRequest>(() => new PageOptionsRequest()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<PageOptionsRequest> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.ServiceGrpcBase.PageReplyReflection.Descriptor.MessageTypes[0]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public PageOptionsRequest() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public PageOptionsRequest(PageOptionsRequest other) : this() { | |||||
pageIndex_ = other.pageIndex_; | |||||
total_ = other.total_; | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public PageOptionsRequest Clone() { | |||||
return new PageOptionsRequest(this); | |||||
} | |||||
/// <summary>Field number for the "PageIndex" field.</summary> | |||||
public const int PageIndexFieldNumber = 1; | |||||
private int pageIndex_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int PageIndex { | |||||
get { return pageIndex_; } | |||||
set { | |||||
pageIndex_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "Total" field.</summary> | |||||
public const int TotalFieldNumber = 2; | |||||
private int total_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int Total { | |||||
get { return total_; } | |||||
set { | |||||
total_ = value; | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as PageOptionsRequest); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(PageOptionsRequest other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
if (PageIndex != other.PageIndex) return false; | |||||
if (Total != other.Total) return false; | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
if (PageIndex != 0) hash ^= PageIndex.GetHashCode(); | |||||
if (Total != 0) hash ^= Total.GetHashCode(); | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
if (PageIndex != 0) { | |||||
output.WriteRawTag(8); | |||||
output.WriteInt32(PageIndex); | |||||
} | |||||
if (Total != 0) { | |||||
output.WriteRawTag(16); | |||||
output.WriteInt32(Total); | |||||
} | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
if (PageIndex != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(PageIndex); | |||||
} | |||||
if (Total != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Total); | |||||
} | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(PageOptionsRequest other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
if (other.PageIndex != 0) { | |||||
PageIndex = other.PageIndex; | |||||
} | |||||
if (other.Total != 0) { | |||||
Total = other.Total; | |||||
} | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
case 8: { | |||||
PageIndex = input.ReadInt32(); | |||||
break; | |||||
} | |||||
case 16: { | |||||
Total = input.ReadInt32(); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion Designer generated code |
@@ -1,283 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: PageRequest.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 1591, 0612, 3021 | |||||
#region Designer generated code | |||||
using pb = global::Google.Protobuf; | |||||
using pbc = global::Google.Protobuf.Collections; | |||||
using pbr = global::Google.Protobuf.Reflection; | |||||
using scg = global::System.Collections.Generic; | |||||
namespace JT808.GrpcDashbord.ServiceGrpcBase { | |||||
/// <summary>Holder for reflection information generated from PageRequest.proto</summary> | |||||
public static partial class PageRequestReflection { | |||||
#region Descriptor | |||||
/// <summary>File descriptor for PageRequest.proto</summary> | |||||
public static pbr::FileDescriptor Descriptor { | |||||
get { return descriptor; } | |||||
} | |||||
private static pbr::FileDescriptor descriptor; | |||||
static PageRequestReflection() { | |||||
byte[] descriptorData = global::System.Convert.FromBase64String( | |||||
string.Concat( | |||||
"ChFQYWdlUmVxdWVzdC5wcm90bxIiSlQ4MDguR3JwY0Rhc2hib3JkLlNlcnZp", | |||||
"Y2VHcnBjQmFzZSLFAQoLUGFnZVJlcXVlc3QSEQoJUGFnZUluZGV4GAEgASgF", | |||||
"EhAKCFBhZ2VTaXplGAIgASgFEg0KBVRvdGFsGAMgASgFEgwKBFNraXAYBCAB", | |||||
"KAUSRwoEU29ydBgFIAMoCzI5LkpUODA4LkdycGNEYXNoYm9yZC5TZXJ2aWNl", | |||||
"R3JwY0Jhc2UuUGFnZVJlcXVlc3QuU29ydEVudHJ5GisKCVNvcnRFbnRyeRIL", | |||||
"CgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBYgZwcm90bzM=")); | |||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | |||||
new pbr::FileDescriptor[] { }, | |||||
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.ServiceGrpcBase.PageRequest), global::JT808.GrpcDashbord.ServiceGrpcBase.PageRequest.Parser, new[]{ "PageIndex", "PageSize", "Total", "Skip", "Sort" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }) | |||||
})); | |||||
} | |||||
#endregion | |||||
} | |||||
#region Messages | |||||
/// <summary> | |||||
/// 统一分页参数 | |||||
/// </summary> | |||||
public sealed partial class PageRequest : pb::IMessage<PageRequest> { | |||||
private static readonly pb::MessageParser<PageRequest> _parser = new pb::MessageParser<PageRequest>(() => new PageRequest()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<PageRequest> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.ServiceGrpcBase.PageRequestReflection.Descriptor.MessageTypes[0]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public PageRequest() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public PageRequest(PageRequest other) : this() { | |||||
pageIndex_ = other.pageIndex_; | |||||
pageSize_ = other.pageSize_; | |||||
total_ = other.total_; | |||||
skip_ = other.skip_; | |||||
sort_ = other.sort_.Clone(); | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public PageRequest Clone() { | |||||
return new PageRequest(this); | |||||
} | |||||
/// <summary>Field number for the "PageIndex" field.</summary> | |||||
public const int PageIndexFieldNumber = 1; | |||||
private int pageIndex_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int PageIndex { | |||||
get { return pageIndex_; } | |||||
set { | |||||
pageIndex_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "PageSize" field.</summary> | |||||
public const int PageSizeFieldNumber = 2; | |||||
private int pageSize_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int PageSize { | |||||
get { return pageSize_; } | |||||
set { | |||||
pageSize_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "Total" field.</summary> | |||||
public const int TotalFieldNumber = 3; | |||||
private int total_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int Total { | |||||
get { return total_; } | |||||
set { | |||||
total_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "Skip" field.</summary> | |||||
public const int SkipFieldNumber = 4; | |||||
private int skip_; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int Skip { | |||||
get { return skip_; } | |||||
set { | |||||
skip_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "Sort" field.</summary> | |||||
public const int SortFieldNumber = 5; | |||||
private static readonly pbc::MapField<string, string>.Codec _map_sort_codec | |||||
= new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 42); | |||||
private readonly pbc::MapField<string, string> sort_ = new pbc::MapField<string, string>(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public pbc::MapField<string, string> Sort { | |||||
get { return sort_; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as PageRequest); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(PageRequest other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
if (PageIndex != other.PageIndex) return false; | |||||
if (PageSize != other.PageSize) return false; | |||||
if (Total != other.Total) return false; | |||||
if (Skip != other.Skip) return false; | |||||
if (!Sort.Equals(other.Sort)) return false; | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
if (PageIndex != 0) hash ^= PageIndex.GetHashCode(); | |||||
if (PageSize != 0) hash ^= PageSize.GetHashCode(); | |||||
if (Total != 0) hash ^= Total.GetHashCode(); | |||||
if (Skip != 0) hash ^= Skip.GetHashCode(); | |||||
hash ^= Sort.GetHashCode(); | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
if (PageIndex != 0) { | |||||
output.WriteRawTag(8); | |||||
output.WriteInt32(PageIndex); | |||||
} | |||||
if (PageSize != 0) { | |||||
output.WriteRawTag(16); | |||||
output.WriteInt32(PageSize); | |||||
} | |||||
if (Total != 0) { | |||||
output.WriteRawTag(24); | |||||
output.WriteInt32(Total); | |||||
} | |||||
if (Skip != 0) { | |||||
output.WriteRawTag(32); | |||||
output.WriteInt32(Skip); | |||||
} | |||||
sort_.WriteTo(output, _map_sort_codec); | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
if (PageIndex != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(PageIndex); | |||||
} | |||||
if (PageSize != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(PageSize); | |||||
} | |||||
if (Total != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Total); | |||||
} | |||||
if (Skip != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Skip); | |||||
} | |||||
size += sort_.CalculateSize(_map_sort_codec); | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(PageRequest other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
if (other.PageIndex != 0) { | |||||
PageIndex = other.PageIndex; | |||||
} | |||||
if (other.PageSize != 0) { | |||||
PageSize = other.PageSize; | |||||
} | |||||
if (other.Total != 0) { | |||||
Total = other.Total; | |||||
} | |||||
if (other.Skip != 0) { | |||||
Skip = other.Skip; | |||||
} | |||||
sort_.Add(other.sort_); | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
case 8: { | |||||
PageIndex = input.ReadInt32(); | |||||
break; | |||||
} | |||||
case 16: { | |||||
PageSize = input.ReadInt32(); | |||||
break; | |||||
} | |||||
case 24: { | |||||
Total = input.ReadInt32(); | |||||
break; | |||||
} | |||||
case 32: { | |||||
Skip = input.ReadInt32(); | |||||
break; | |||||
} | |||||
case 42: { | |||||
sort_.AddEntriesFrom(input, _map_sort_codec); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion Designer generated code |
@@ -1,225 +0,0 @@ | |||||
// <auto-generated> | |||||
// Generated by the protocol buffer compiler. DO NOT EDIT! | |||||
// source: ResultReply.proto | |||||
// </auto-generated> | |||||
#pragma warning disable 1591, 0612, 3021 | |||||
#region Designer generated code | |||||
using pb = global::Google.Protobuf; | |||||
using pbc = global::Google.Protobuf.Collections; | |||||
using pbr = global::Google.Protobuf.Reflection; | |||||
using scg = global::System.Collections.Generic; | |||||
namespace JT808.GrpcDashbord.ServiceGrpcBase { | |||||
/// <summary>Holder for reflection information generated from ResultReply.proto</summary> | |||||
public static partial class ResultReplyReflection { | |||||
#region Descriptor | |||||
/// <summary>File descriptor for ResultReply.proto</summary> | |||||
public static pbr::FileDescriptor Descriptor { | |||||
get { return descriptor; } | |||||
} | |||||
private static pbr::FileDescriptor descriptor; | |||||
static ResultReplyReflection() { | |||||
byte[] descriptorData = global::System.Convert.FromBase64String( | |||||
string.Concat( | |||||
"ChFSZXN1bHRSZXBseS5wcm90bxIiSlQ4MDguR3JwY0Rhc2hib3JkLlNlcnZp", | |||||
"Y2VHcnBjQmFzZSK9AQoLUmVzdWx0UmVwbHkSSAoEQ29kZRgBIAEoDjI6LkpU", | |||||
"ODA4LkdycGNEYXNoYm9yZC5TZXJ2aWNlR3JwY0Jhc2UuUmVzdWx0UmVwbHku", | |||||
"U3RhdHVzQ29kZRILCgNNc2cYAiABKAkiVwoKU3RhdHVzQ29kZRILCgdTdWNj", | |||||
"ZXNzEAASDQoJTm9Db250ZW50EAESCwoHRmFpbHVyZRACEhAKDFVuYXV0aG9y", | |||||
"aXplZBADEg4KCklubmVyRXJyb3IQBGIGcHJvdG8z")); | |||||
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, | |||||
new pbr::FileDescriptor[] { }, | |||||
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { | |||||
new pbr::GeneratedClrTypeInfo(typeof(global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply), global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply.Parser, new[]{ "Code", "Msg" }, null, new[]{ typeof(global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply.Types.StatusCode) }, null) | |||||
})); | |||||
} | |||||
#endregion | |||||
} | |||||
#region Messages | |||||
/// <summary> | |||||
/// 统一回复 | |||||
/// </summary> | |||||
public sealed partial class ResultReply : pb::IMessage<ResultReply> { | |||||
private static readonly pb::MessageParser<ResultReply> _parser = new pb::MessageParser<ResultReply>(() => new ResultReply()); | |||||
private pb::UnknownFieldSet _unknownFields; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pb::MessageParser<ResultReply> Parser { get { return _parser; } } | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static pbr::MessageDescriptor Descriptor { | |||||
get { return global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReplyReflection.Descriptor.MessageTypes[0]; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
pbr::MessageDescriptor pb::IMessage.Descriptor { | |||||
get { return Descriptor; } | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public ResultReply() { | |||||
OnConstruction(); | |||||
} | |||||
partial void OnConstruction(); | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public ResultReply(ResultReply other) : this() { | |||||
code_ = other.code_; | |||||
msg_ = other.msg_; | |||||
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public ResultReply Clone() { | |||||
return new ResultReply(this); | |||||
} | |||||
/// <summary>Field number for the "Code" field.</summary> | |||||
public const int CodeFieldNumber = 1; | |||||
private global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply.Types.StatusCode code_ = 0; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply.Types.StatusCode Code { | |||||
get { return code_; } | |||||
set { | |||||
code_ = value; | |||||
} | |||||
} | |||||
/// <summary>Field number for the "Msg" field.</summary> | |||||
public const int MsgFieldNumber = 2; | |||||
private string msg_ = ""; | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public string Msg { | |||||
get { return msg_; } | |||||
set { | |||||
msg_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override bool Equals(object other) { | |||||
return Equals(other as ResultReply); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public bool Equals(ResultReply other) { | |||||
if (ReferenceEquals(other, null)) { | |||||
return false; | |||||
} | |||||
if (ReferenceEquals(other, this)) { | |||||
return true; | |||||
} | |||||
if (Code != other.Code) return false; | |||||
if (Msg != other.Msg) return false; | |||||
return Equals(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override int GetHashCode() { | |||||
int hash = 1; | |||||
if (Code != 0) hash ^= Code.GetHashCode(); | |||||
if (Msg.Length != 0) hash ^= Msg.GetHashCode(); | |||||
if (_unknownFields != null) { | |||||
hash ^= _unknownFields.GetHashCode(); | |||||
} | |||||
return hash; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public override string ToString() { | |||||
return pb::JsonFormatter.ToDiagnosticString(this); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void WriteTo(pb::CodedOutputStream output) { | |||||
if (Code != 0) { | |||||
output.WriteRawTag(8); | |||||
output.WriteEnum((int) Code); | |||||
} | |||||
if (Msg.Length != 0) { | |||||
output.WriteRawTag(18); | |||||
output.WriteString(Msg); | |||||
} | |||||
if (_unknownFields != null) { | |||||
_unknownFields.WriteTo(output); | |||||
} | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public int CalculateSize() { | |||||
int size = 0; | |||||
if (Code != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Code); | |||||
} | |||||
if (Msg.Length != 0) { | |||||
size += 1 + pb::CodedOutputStream.ComputeStringSize(Msg); | |||||
} | |||||
if (_unknownFields != null) { | |||||
size += _unknownFields.CalculateSize(); | |||||
} | |||||
return size; | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(ResultReply other) { | |||||
if (other == null) { | |||||
return; | |||||
} | |||||
if (other.Code != 0) { | |||||
Code = other.Code; | |||||
} | |||||
if (other.Msg.Length != 0) { | |||||
Msg = other.Msg; | |||||
} | |||||
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); | |||||
} | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public void MergeFrom(pb::CodedInputStream input) { | |||||
uint tag; | |||||
while ((tag = input.ReadTag()) != 0) { | |||||
switch(tag) { | |||||
default: | |||||
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); | |||||
break; | |||||
case 8: { | |||||
code_ = (global::JT808.GrpcDashbord.ServiceGrpcBase.ResultReply.Types.StatusCode) input.ReadEnum(); | |||||
break; | |||||
} | |||||
case 18: { | |||||
Msg = input.ReadString(); | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
#region Nested types | |||||
/// <summary>Container for nested types declared in the ResultReply message type.</summary> | |||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] | |||||
public static partial class Types { | |||||
/// <summary> | |||||
/// 状态码 | |||||
/// </summary> | |||||
public enum StatusCode { | |||||
[pbr::OriginalName("Success")] Success = 0, | |||||
[pbr::OriginalName("NoContent")] NoContent = 1, | |||||
[pbr::OriginalName("Failure")] Failure = 2, | |||||
[pbr::OriginalName("Unauthorized")] Unauthorized = 3, | |||||
[pbr::OriginalName("InnerError")] InnerError = 4, | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion | |||||
} | |||||
#endregion Designer generated code |
@@ -1,16 +0,0 @@ | |||||
csharp | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --csharp_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\ResultReply.proto" --grpc_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" --plugin=protoc-gen-grpc=C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\grpc_csharp_plugin.exe; | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --csharp_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\PageReply.proto" --grpc_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" --plugin=protoc-gen-grpc=C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\grpc_csharp_plugin.exe; | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --csharp_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\PageRequest.proto" --grpc_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" --plugin=protoc-gen-grpc=C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\grpc_csharp_plugin.exe; | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --csharp_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\JT808UnificationSendService.proto" --grpc_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" --plugin=protoc-gen-grpc=C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\grpc_csharp_plugin.exe; | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --csharp_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\JT808SessionService.proto" --grpc_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" --plugin=protoc-gen-grpc=C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\grpc_csharp_plugin.exe; | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --csharp_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\JT808AtomicCounterService.proto" --grpc_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" --plugin=protoc-gen-grpc=C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\grpc_csharp_plugin.exe; | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --csharp_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\EmptyRequest.proto" --grpc_out "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\csharp" --plugin=protoc-gen-grpc=C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\grpc_csharp_plugin.exe; | |||||
js | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --js_out=import_style=commonjs:"D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\js" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\EmptyRequest.proto" --grpc_out=import_style=commonjs,mode=grpcwebtext:"D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\js" --plugin=protoc-gen-grpc="D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\tools\protoc-gen-grpc-web-1.0.3-windows-x86_64.exe"; | |||||
C:\Users\Administrator\.nuget\packages\grpc.tools\1.17.1\tools\windows_x64\protoc.exe -I "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol" --js_out=import_style=commonjs:"D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\js" "D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\JT808AtomicCounterService.proto" --grpc_out=import_style=commonjs,mode=grpcwebtext:"D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\JT808.DotNetty.Dashbord.GrpcProtocol\js" --plugin=protoc-gen-grpc="D:\My Project\JT808DotNetty\src\JT808.DotNetty.Admin\tools\protoc-gen-grpc-web-1.0.3-windows-x86_64.exe"; | |||||
@@ -1,131 +0,0 @@ | |||||
/** | |||||
* @fileoverview | |||||
* @enhanceable | |||||
* @suppress {messageConventions} JS Compiler reports an error if a variable or | |||||
* field starts with 'MSG_' and isn't a translatable message. | |||||
* @public | |||||
*/ | |||||
// GENERATED CODE -- DO NOT EDIT! | |||||
var jspb = require('google-protobuf'); | |||||
var goog = jspb; | |||||
var global = Function('return this')(); | |||||
goog.exportSymbol('proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest', null, global); | |||||
/** | |||||
* Generated by JsPbCodeGenerator. | |||||
* @param {Array=} opt_data Optional initial data array, typically from a | |||||
* server response, or constructed directly in Javascript. The array is used | |||||
* in place and becomes part of the constructed object. It is not cloned. | |||||
* If no data is provided, the constructed object will be empty, but still | |||||
* valid. | |||||
* @extends {jspb.Message} | |||||
* @constructor | |||||
*/ | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest = function(opt_data) { | |||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null); | |||||
}; | |||||
goog.inherits(proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, jspb.Message); | |||||
if (goog.DEBUG && !COMPILED) { | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.displayName = 'proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest'; | |||||
} | |||||
if (jspb.Message.GENERATE_TO_OBJECT) { | |||||
/** | |||||
* Creates an object representation of this proto suitable for use in Soy templates. | |||||
* Field names that are reserved in JavaScript and will be renamed to pb_name. | |||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. | |||||
* For the list of reserved names please see: | |||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. | |||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance | |||||
* for transitional soy proto support: http://goto/soy-param-migration | |||||
* @return {!Object} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.prototype.toObject = function(opt_includeInstance) { | |||||
return proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.toObject(opt_includeInstance, this); | |||||
}; | |||||
/** | |||||
* Static version of the {@see toObject} method. | |||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB | |||||
* instance for transitional soy proto support: | |||||
* http://goto/soy-param-migration | |||||
* @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} msg The msg instance to transform. | |||||
* @return {!Object} | |||||
* @suppress {unusedLocalVariables} f is only used for nested messages | |||||
*/ | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.toObject = function(includeInstance, msg) { | |||||
var f, obj = { | |||||
}; | |||||
if (includeInstance) { | |||||
obj.$jspbMessageInstance = msg; | |||||
} | |||||
return obj; | |||||
}; | |||||
} | |||||
/** | |||||
* Deserializes binary data (in protobuf wire format). | |||||
* @param {jspb.ByteSource} bytes The bytes to deserialize. | |||||
* @return {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.deserializeBinary = function(bytes) { | |||||
var reader = new jspb.BinaryReader(bytes); | |||||
var msg = new proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest; | |||||
return proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.deserializeBinaryFromReader(msg, reader); | |||||
}; | |||||
/** | |||||
* Deserializes binary data (in protobuf wire format) from the | |||||
* given reader into the given message object. | |||||
* @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} msg The message object to deserialize into. | |||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use. | |||||
* @return {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.deserializeBinaryFromReader = function(msg, reader) { | |||||
while (reader.nextField()) { | |||||
if (reader.isEndGroup()) { | |||||
break; | |||||
} | |||||
var field = reader.getFieldNumber(); | |||||
switch (field) { | |||||
default: | |||||
reader.skipField(); | |||||
break; | |||||
} | |||||
} | |||||
return msg; | |||||
}; | |||||
/** | |||||
* Serializes the message to binary data (in protobuf wire format). | |||||
* @return {!Uint8Array} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.prototype.serializeBinary = function() { | |||||
var writer = new jspb.BinaryWriter(); | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.serializeBinaryToWriter(this, writer); | |||||
return writer.getResultBuffer(); | |||||
}; | |||||
/** | |||||
* Serializes the given message to binary data (in protobuf wire | |||||
* format), writing to the given BinaryWriter. | |||||
* @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} message | |||||
* @param {!jspb.BinaryWriter} writer | |||||
* @suppress {unusedLocalVariables} f is only used for nested messages | |||||
*/ | |||||
proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest.serializeBinaryToWriter = function(message, writer) { | |||||
var f = undefined; | |||||
}; | |||||
goog.object.extend(exports, proto.JT808.GrpcDashbord.ServiceGrpcBase); |
@@ -1,194 +0,0 @@ | |||||
/** | |||||
* @fileoverview gRPC-Web generated client stub for JT808.GrpcDashbord.AtomicCounterGrpcService | |||||
* @enhanceable | |||||
* @public | |||||
*/ | |||||
// GENERATED CODE -- DO NOT EDIT! | |||||
const grpc = {}; | |||||
grpc.web = require('grpc-web'); | |||||
var ResultReply_pb = require('./ResultReply_pb.js') | |||||
var EmptyRequest_pb = require('./EmptyRequest_pb.js') | |||||
const proto = {}; | |||||
proto.JT808 = {}; | |||||
proto.JT808.GrpcDashbord = {}; | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService = require('./JT808AtomicCounterService_pb.js'); | |||||
/** | |||||
* @param {string} hostname | |||||
* @param {?Object} credentials | |||||
* @param {?Object} options | |||||
* @constructor | |||||
* @struct | |||||
* @final | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterServiceClient = | |||||
function(hostname, credentials, options) { | |||||
if (!options) options = {}; | |||||
options['format'] = 'text'; | |||||
/** | |||||
* @private @const {!grpc.web.GrpcWebClientBase} The client | |||||
*/ | |||||
this.client_ = new grpc.web.GrpcWebClientBase(options); | |||||
/** | |||||
* @private @const {string} The hostname | |||||
*/ | |||||
this.hostname_ = hostname; | |||||
/** | |||||
* @private @const {?Object} The credentials to be used to connect | |||||
* to the server | |||||
*/ | |||||
this.credentials_ = credentials; | |||||
/** | |||||
* @private @const {?Object} Options for the client | |||||
*/ | |||||
this.options_ = options; | |||||
}; | |||||
/** | |||||
* @param {string} hostname | |||||
* @param {?Object} credentials | |||||
* @param {?Object} options | |||||
* @constructor | |||||
* @struct | |||||
* @final | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterServicePromiseClient = | |||||
function(hostname, credentials, options) { | |||||
if (!options) options = {}; | |||||
options['format'] = 'text'; | |||||
/** | |||||
* @private @const {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterServiceClient} The delegate callback based client | |||||
*/ | |||||
this.delegateClient_ = new proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterServiceClient( | |||||
hostname, credentials, options); | |||||
}; | |||||
/** | |||||
* @const | |||||
* @type {!grpc.web.AbstractClientBase.MethodInfo< | |||||
* !proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, | |||||
* !proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply>} | |||||
*/ | |||||
const methodInfo_AtomicCounterService_GetTcpAtomicCounter = new grpc.web.AbstractClientBase.MethodInfo( | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply, | |||||
/** @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} request */ | |||||
function(request) { | |||||
return request.serializeBinary(); | |||||
}, | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.deserializeBinary | |||||
); | |||||
/** | |||||
* @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} request The | |||||
* request proto | |||||
* @param {!Object<string, string>} metadata User defined | |||||
* call metadata | |||||
* @param {function(?grpc.web.Error, ?proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply)} | |||||
* callback The callback function(error, response) | |||||
* @return {!grpc.web.ClientReadableStream<!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply>|undefined} | |||||
* The XHR Node Readable Stream | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterServiceClient.prototype.getTcpAtomicCounter = | |||||
function(request, metadata, callback) { | |||||
return this.client_.rpcCall(this.hostname_ + | |||||
'/JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterService/GetTcpAtomicCounter', | |||||
request, | |||||
metadata, | |||||
methodInfo_AtomicCounterService_GetTcpAtomicCounter, | |||||
callback); | |||||
}; | |||||
/** | |||||
* @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} request The | |||||
* request proto | |||||
* @param {!Object<string, string>} metadata User defined | |||||
* call metadata | |||||
* @return {!Promise<!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply>} | |||||
* The XHR Node Readable Stream | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterServicePromiseClient.prototype.getTcpAtomicCounter = | |||||
function(request, metadata) { | |||||
return new Promise((resolve, reject) => { | |||||
this.delegateClient_.getTcpAtomicCounter( | |||||
request, metadata, (error, response) => { | |||||
error ? reject(error) : resolve(response); | |||||
}); | |||||
}); | |||||
}; | |||||
/** | |||||
* @const | |||||
* @type {!grpc.web.AbstractClientBase.MethodInfo< | |||||
* !proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest, | |||||
* !proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply>} | |||||
*/ | |||||
const methodInfo_AtomicCounterService_GetUdpAtomicCounter = new grpc.web.AbstractClientBase.MethodInfo( | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply, | |||||
/** @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} request */ | |||||
function(request) { | |||||
return request.serializeBinary(); | |||||
}, | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.deserializeBinary | |||||
); | |||||
/** | |||||
* @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} request The | |||||
* request proto | |||||
* @param {!Object<string, string>} metadata User defined | |||||
* call metadata | |||||
* @param {function(?grpc.web.Error, ?proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply)} | |||||
* callback The callback function(error, response) | |||||
* @return {!grpc.web.ClientReadableStream<!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply>|undefined} | |||||
* The XHR Node Readable Stream | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterServiceClient.prototype.getUdpAtomicCounter = | |||||
function(request, metadata, callback) { | |||||
return this.client_.rpcCall(this.hostname_ + | |||||
'/JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterService/GetUdpAtomicCounter', | |||||
request, | |||||
metadata, | |||||
methodInfo_AtomicCounterService_GetUdpAtomicCounter, | |||||
callback); | |||||
}; | |||||
/** | |||||
* @param {!proto.JT808.GrpcDashbord.ServiceGrpcBase.EmptyRequest} request The | |||||
* request proto | |||||
* @param {!Object<string, string>} metadata User defined | |||||
* call metadata | |||||
* @return {!Promise<!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply>} | |||||
* The XHR Node Readable Stream | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterServicePromiseClient.prototype.getUdpAtomicCounter = | |||||
function(request, metadata) { | |||||
return new Promise((resolve, reject) => { | |||||
this.delegateClient_.getUdpAtomicCounter( | |||||
request, metadata, (error, response) => { | |||||
error ? reject(error) : resolve(response); | |||||
}); | |||||
}); | |||||
}; | |||||
module.exports = proto.JT808.GrpcDashbord.AtomicCounterGrpcService; | |||||
@@ -1,390 +0,0 @@ | |||||
/** | |||||
* @fileoverview | |||||
* @enhanceable | |||||
* @suppress {messageConventions} JS Compiler reports an error if a variable or | |||||
* field starts with 'MSG_' and isn't a translatable message. | |||||
* @public | |||||
*/ | |||||
// GENERATED CODE -- DO NOT EDIT! | |||||
var jspb = require('google-protobuf'); | |||||
var goog = jspb; | |||||
var global = Function('return this')(); | |||||
var ResultReply_pb = require('./ResultReply_pb.js'); | |||||
var EmptyRequest_pb = require('./EmptyRequest_pb.js'); | |||||
goog.exportSymbol('proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo', null, global); | |||||
goog.exportSymbol('proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply', null, global); | |||||
/** | |||||
* Generated by JsPbCodeGenerator. | |||||
* @param {Array=} opt_data Optional initial data array, typically from a | |||||
* server response, or constructed directly in Javascript. The array is used | |||||
* in place and becomes part of the constructed object. It is not cloned. | |||||
* If no data is provided, the constructed object will be empty, but still | |||||
* valid. | |||||
* @extends {jspb.Message} | |||||
* @constructor | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply = function(opt_data) { | |||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null); | |||||
}; | |||||
goog.inherits(proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply, jspb.Message); | |||||
if (goog.DEBUG && !COMPILED) { | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.displayName = 'proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply'; | |||||
} | |||||
if (jspb.Message.GENERATE_TO_OBJECT) { | |||||
/** | |||||
* Creates an object representation of this proto suitable for use in Soy templates. | |||||
* Field names that are reserved in JavaScript and will be renamed to pb_name. | |||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. | |||||
* For the list of reserved names please see: | |||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. | |||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance | |||||
* for transitional soy proto support: http://goto/soy-param-migration | |||||
* @return {!Object} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.toObject = function(opt_includeInstance) { | |||||
return proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.toObject(opt_includeInstance, this); | |||||
}; | |||||
/** | |||||
* Static version of the {@see toObject} method. | |||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB | |||||
* instance for transitional soy proto support: | |||||
* http://goto/soy-param-migration | |||||
* @param {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply} msg The msg instance to transform. | |||||
* @return {!Object} | |||||
* @suppress {unusedLocalVariables} f is only used for nested messages | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.toObject = function(includeInstance, msg) { | |||||
var f, obj = { | |||||
atomiccounterinfo: (f = msg.getAtomiccounterinfo()) && proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.toObject(includeInstance, f), | |||||
resultreply: (f = msg.getResultreply()) && ResultReply_pb.ResultReply.toObject(includeInstance, f) | |||||
}; | |||||
if (includeInstance) { | |||||
obj.$jspbMessageInstance = msg; | |||||
} | |||||
return obj; | |||||
}; | |||||
} | |||||
/** | |||||
* Deserializes binary data (in protobuf wire format). | |||||
* @param {jspb.ByteSource} bytes The bytes to deserialize. | |||||
* @return {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.deserializeBinary = function(bytes) { | |||||
var reader = new jspb.BinaryReader(bytes); | |||||
var msg = new proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply; | |||||
return proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.deserializeBinaryFromReader(msg, reader); | |||||
}; | |||||
/** | |||||
* Deserializes binary data (in protobuf wire format) from the | |||||
* given reader into the given message object. | |||||
* @param {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply} msg The message object to deserialize into. | |||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use. | |||||
* @return {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.deserializeBinaryFromReader = function(msg, reader) { | |||||
while (reader.nextField()) { | |||||
if (reader.isEndGroup()) { | |||||
break; | |||||
} | |||||
var field = reader.getFieldNumber(); | |||||
switch (field) { | |||||
case 1: | |||||
var value = new proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo; | |||||
reader.readMessage(value,proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.deserializeBinaryFromReader); | |||||
msg.setAtomiccounterinfo(value); | |||||
break; | |||||
case 2: | |||||
var value = new ResultReply_pb.ResultReply; | |||||
reader.readMessage(value,ResultReply_pb.ResultReply.deserializeBinaryFromReader); | |||||
msg.setResultreply(value); | |||||
break; | |||||
default: | |||||
reader.skipField(); | |||||
break; | |||||
} | |||||
} | |||||
return msg; | |||||
}; | |||||
/** | |||||
* Serializes the message to binary data (in protobuf wire format). | |||||
* @return {!Uint8Array} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.serializeBinary = function() { | |||||
var writer = new jspb.BinaryWriter(); | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.serializeBinaryToWriter(this, writer); | |||||
return writer.getResultBuffer(); | |||||
}; | |||||
/** | |||||
* Serializes the given message to binary data (in protobuf wire | |||||
* format), writing to the given BinaryWriter. | |||||
* @param {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply} message | |||||
* @param {!jspb.BinaryWriter} writer | |||||
* @suppress {unusedLocalVariables} f is only used for nested messages | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.serializeBinaryToWriter = function(message, writer) { | |||||
var f = undefined; | |||||
f = message.getAtomiccounterinfo(); | |||||
if (f != null) { | |||||
writer.writeMessage( | |||||
1, | |||||
f, | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.serializeBinaryToWriter | |||||
); | |||||
} | |||||
f = message.getResultreply(); | |||||
if (f != null) { | |||||
writer.writeMessage( | |||||
2, | |||||
f, | |||||
ResultReply_pb.ResultReply.serializeBinaryToWriter | |||||
); | |||||
} | |||||
}; | |||||
/** | |||||
* optional AtomicCounterInfo AtomicCounterInfo = 1; | |||||
* @return {?proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.getAtomiccounterinfo = function() { | |||||
return /** @type{?proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo} */ ( | |||||
jspb.Message.getWrapperField(this, proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo, 1)); | |||||
}; | |||||
/** @param {?proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo|undefined} value */ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.setAtomiccounterinfo = function(value) { | |||||
jspb.Message.setWrapperField(this, 1, value); | |||||
}; | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.clearAtomiccounterinfo = function() { | |||||
this.setAtomiccounterinfo(undefined); | |||||
}; | |||||
/** | |||||
* Returns whether this field is set. | |||||
* @return {!boolean} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.hasAtomiccounterinfo = function() { | |||||
return jspb.Message.getField(this, 1) != null; | |||||
}; | |||||
/** | |||||
* optional JT808.GrpcDashbord.ServiceGrpcBase.ResultReply ResultReply = 2; | |||||
* @return {?proto.JT808.GrpcDashbord.ServiceGrpcBase.ResultReply} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.getResultreply = function() { | |||||
return /** @type{?proto.JT808.GrpcDashbord.ServiceGrpcBase.ResultReply} */ ( | |||||
jspb.Message.getWrapperField(this, ResultReply_pb.ResultReply, 2)); | |||||
}; | |||||
/** @param {?proto.JT808.GrpcDashbord.ServiceGrpcBase.ResultReply|undefined} value */ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.setResultreply = function(value) { | |||||
jspb.Message.setWrapperField(this, 2, value); | |||||
}; | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.clearResultreply = function() { | |||||
this.setResultreply(undefined); | |||||
}; | |||||
/** | |||||
* Returns whether this field is set. | |||||
* @return {!boolean} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterReply.prototype.hasResultreply = function() { | |||||
return jspb.Message.getField(this, 2) != null; | |||||
}; | |||||
/** | |||||
* Generated by JsPbCodeGenerator. | |||||
* @param {Array=} opt_data Optional initial data array, typically from a | |||||
* server response, or constructed directly in Javascript. The array is used | |||||
* in place and becomes part of the constructed object. It is not cloned. | |||||
* If no data is provided, the constructed object will be empty, but still | |||||
* valid. | |||||
* @extends {jspb.Message} | |||||
* @constructor | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo = function(opt_data) { | |||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null); | |||||
}; | |||||
goog.inherits(proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo, jspb.Message); | |||||
if (goog.DEBUG && !COMPILED) { | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.displayName = 'proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo'; | |||||
} | |||||
if (jspb.Message.GENERATE_TO_OBJECT) { | |||||
/** | |||||
* Creates an object representation of this proto suitable for use in Soy templates. | |||||
* Field names that are reserved in JavaScript and will be renamed to pb_name. | |||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. | |||||
* For the list of reserved names please see: | |||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. | |||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance | |||||
* for transitional soy proto support: http://goto/soy-param-migration | |||||
* @return {!Object} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.prototype.toObject = function(opt_includeInstance) { | |||||
return proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.toObject(opt_includeInstance, this); | |||||
}; | |||||
/** | |||||
* Static version of the {@see toObject} method. | |||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB | |||||
* instance for transitional soy proto support: | |||||
* http://goto/soy-param-migration | |||||
* @param {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo} msg The msg instance to transform. | |||||
* @return {!Object} | |||||
* @suppress {unusedLocalVariables} f is only used for nested messages | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.toObject = function(includeInstance, msg) { | |||||
var f, obj = { | |||||
msgsuccesscount: jspb.Message.getFieldWithDefault(msg, 1, 0), | |||||
msgfailcount: jspb.Message.getFieldWithDefault(msg, 2, 0) | |||||
}; | |||||
if (includeInstance) { | |||||
obj.$jspbMessageInstance = msg; | |||||
} | |||||
return obj; | |||||
}; | |||||
} | |||||
/** | |||||
* Deserializes binary data (in protobuf wire format). | |||||
* @param {jspb.ByteSource} bytes The bytes to deserialize. | |||||
* @return {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.deserializeBinary = function(bytes) { | |||||
var reader = new jspb.BinaryReader(bytes); | |||||
var msg = new proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo; | |||||
return proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.deserializeBinaryFromReader(msg, reader); | |||||
}; | |||||
/** | |||||
* Deserializes binary data (in protobuf wire format) from the | |||||
* given reader into the given message object. | |||||
* @param {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo} msg The message object to deserialize into. | |||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use. | |||||
* @return {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.deserializeBinaryFromReader = function(msg, reader) { | |||||
while (reader.nextField()) { | |||||
if (reader.isEndGroup()) { | |||||
break; | |||||
} | |||||
var field = reader.getFieldNumber(); | |||||
switch (field) { | |||||
case 1: | |||||
var value = /** @type {number} */ (reader.readInt32()); | |||||
msg.setMsgsuccesscount(value); | |||||
break; | |||||
case 2: | |||||
var value = /** @type {number} */ (reader.readInt32()); | |||||
msg.setMsgfailcount(value); | |||||
break; | |||||
default: | |||||
reader.skipField(); | |||||
break; | |||||
} | |||||
} | |||||
return msg; | |||||
}; | |||||
/** | |||||
* Serializes the message to binary data (in protobuf wire format). | |||||
* @return {!Uint8Array} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.prototype.serializeBinary = function() { | |||||
var writer = new jspb.BinaryWriter(); | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.serializeBinaryToWriter(this, writer); | |||||
return writer.getResultBuffer(); | |||||
}; | |||||
/** | |||||
* Serializes the given message to binary data (in protobuf wire | |||||
* format), writing to the given BinaryWriter. | |||||
* @param {!proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo} message | |||||
* @param {!jspb.BinaryWriter} writer | |||||
* @suppress {unusedLocalVariables} f is only used for nested messages | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.serializeBinaryToWriter = function(message, writer) { | |||||
var f = undefined; | |||||
f = message.getMsgsuccesscount(); | |||||
if (f !== 0) { | |||||
writer.writeInt32( | |||||
1, | |||||
f | |||||
); | |||||
} | |||||
f = message.getMsgfailcount(); | |||||
if (f !== 0) { | |||||
writer.writeInt32( | |||||
2, | |||||
f | |||||
); | |||||
} | |||||
}; | |||||
/** | |||||
* optional int32 MsgSuccessCount = 1; | |||||
* @return {number} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.prototype.getMsgsuccesscount = function() { | |||||
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); | |||||
}; | |||||
/** @param {number} value */ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.prototype.setMsgsuccesscount = function(value) { | |||||
jspb.Message.setProto3IntField(this, 1, value); | |||||
}; | |||||
/** | |||||
* optional int32 MsgFailCount = 2; | |||||
* @return {number} | |||||
*/ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.prototype.getMsgfailcount = function() { | |||||
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); | |||||
}; | |||||
/** @param {number} value */ | |||||
proto.JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterInfo.prototype.setMsgfailcount = function(value) { | |||||
jspb.Message.setProto3IntField(this, 2, value); | |||||
}; | |||||
goog.object.extend(exports, proto.JT808.GrpcDashbord.AtomicCounterGrpcService); |
@@ -1,30 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Grpc.Core; | |||||
using JT808.GrpcDashbord.AtomicCounterGrpcService; | |||||
using JT808.GrpcDashbord.ServiceGrpcBase; | |||||
using static JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterService; | |||||
namespace JT808.DotNetty.Dashbord.GrpcServer.GrpcImpls | |||||
{ | |||||
public class JT808AtomicCounterServiceGrpcImpl: AtomicCounterServiceBase | |||||
{ | |||||
public override Task<AtomicCounterReply> GetTcpAtomicCounter(EmptyRequest request, ServerCallContext context) | |||||
{ | |||||
AtomicCounterReply atomicCounterReply = new AtomicCounterReply(); | |||||
atomicCounterReply.MsgFailCount = 10; | |||||
atomicCounterReply.MsgSuccessCount = 1111; | |||||
return Task.FromResult(atomicCounterReply); | |||||
} | |||||
public override Task<AtomicCounterReply> GetUdpAtomicCounter(EmptyRequest request, ServerCallContext context) | |||||
{ | |||||
AtomicCounterReply atomicCounterReply = new AtomicCounterReply(); | |||||
atomicCounterReply.MsgFailCount = 50; | |||||
atomicCounterReply.MsgSuccessCount = 1111; | |||||
return Task.FromResult(atomicCounterReply); | |||||
} | |||||
} | |||||
} |
@@ -1,41 +0,0 @@ | |||||
using System; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using Grpc.Core; | |||||
namespace JT808.DotNetty.Dashbord.GrpcServer | |||||
{ | |||||
public class DemoServerHandler<TRequest, TResponse> | |||||
where TRequest : class | |||||
where TResponse : class | |||||
{ | |||||
private readonly ServerCallContext _context; | |||||
public DemoServerHandler(ServerCallContext context) | |||||
{ | |||||
_context = context; | |||||
} | |||||
public async Task<TResponse> UnaryServerHandler(TRequest request, UnaryServerMethod<TRequest, TResponse> continuation) | |||||
{ | |||||
var response = await continuation(request, _context).ConfigureAwait(false); | |||||
return response; | |||||
} | |||||
public async Task<TResponse> ClientStreamingServerHandler(IAsyncStreamReader<TRequest> requestStream, ClientStreamingServerMethod<TRequest, TResponse> continuation) | |||||
{ | |||||
var response = await continuation(requestStream, _context).ConfigureAwait(false); | |||||
return response; | |||||
} | |||||
public async Task ServerStreamingServerHandler(TRequest request, IServerStreamWriter<TResponse> responseStream, ServerStreamingServerMethod<TRequest, TResponse> continuation) | |||||
{ | |||||
await continuation(request, responseStream, _context).ConfigureAwait(false); | |||||
} | |||||
public async Task DuplexStreamingServerHandler(IAsyncStreamReader<TRequest> requestStream, IServerStreamWriter<TResponse> responseStream, DuplexStreamingServerMethod<TRequest, TResponse> continuation) | |||||
{ | |||||
await continuation(requestStream, responseStream, _context).ConfigureAwait(false); | |||||
} | |||||
} | |||||
} |
@@ -1,47 +0,0 @@ | |||||
using Grpc.Core; | |||||
using Grpc.Core.Interceptors; | |||||
using JT808.DotNetty.Dashbord.GrpcProtocol.Extensions; | |||||
using JT808.GrpcDashbord.ServiceGrpcBase; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace JT808.DotNetty.Dashbord.GrpcServer.Interceptors | |||||
{ | |||||
/// <summary> | |||||
/// | |||||
/// https://github.com/grpc/grpc/blob/master/doc/server_side_auth.md | |||||
/// https://github.com/Falco20019/grpc-opentracing | |||||
/// https://github.com/grpc/proposal/blob/master/L12-csharp-interceptors.md | |||||
/// https://stackoverflow.com/questions/52950210/populate-authcontext-in-grpc-c-sharp-from-jwt-authentication | |||||
/// https://github.com/grpc/grpc/tree/master/doc | |||||
/// </summary> | |||||
class DemoInterceptor : Interceptor | |||||
{ | |||||
public override Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TRequest request, ServerCallContext context, UnaryServerMethod<TRequest, TResponse> continuation) | |||||
{ | |||||
if(TryGetValue(context.RequestHeaders,"token",out var str)) | |||||
{ | |||||
//ErrorExtensions.Unauthenticated(); | |||||
} | |||||
return continuation(request, context); | |||||
//return Task.FromResult(default(TResponse)); | |||||
//return await continuation(request, context); | |||||
} | |||||
private bool TryGetValue(Metadata metadata,string key,out string value) | |||||
{ | |||||
foreach(var item in metadata) | |||||
{ | |||||
if(item.Key== key) | |||||
{ | |||||
value = item.Value; | |||||
return true; | |||||
} | |||||
} | |||||
value = ""; | |||||
return false; | |||||
} | |||||
} | |||||
} |
@@ -1,12 +0,0 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<OutputType>Exe</OutputType> | |||||
<TargetFramework>netcoreapp2.2</TargetFramework> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<ProjectReference Include="..\JT808.DotNetty.Dashbord.GrpcProtocol\JT808.DotNetty.Dashbord.GrpcProtocol.csproj" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -1,49 +0,0 @@ | |||||
using Grpc.Core; | |||||
using Grpc.Core.Interceptors; | |||||
using JT808.DotNetty.Dashbord.GrpcServer.GrpcImpls; | |||||
using JT808.DotNetty.Dashbord.GrpcServer.Interceptors; | |||||
using JT808.GrpcDashbord.AtomicCounterGrpcService; | |||||
using System; | |||||
using System.Threading; | |||||
using static JT808.GrpcDashbord.AtomicCounterGrpcService.AtomicCounterService; | |||||
namespace JT808.DotNetty.Dashbord.GrpcServer | |||||
{ | |||||
class Program | |||||
{ | |||||
static void Main(string[] args) | |||||
{ | |||||
var server = new Server | |||||
{ | |||||
Services = { | |||||
BindService(new JT808AtomicCounterServiceGrpcImpl()) | |||||
.Intercept(new DemoInterceptor()), | |||||
}, | |||||
Ports = { | |||||
new ServerPort("0.0.0.0", 14000,ServerCredentials.Insecure) | |||||
} | |||||
}; | |||||
Console.WriteLine("Google Grpc Starting"); | |||||
foreach (var item in server.Ports) | |||||
{ | |||||
Console.WriteLine(string.Format("RPC server {0} listening on port {1}", item.Host, item.Port)); | |||||
} | |||||
server.Start(); | |||||
AtomicCounterServiceClient client = new AtomicCounterServiceClient(new Channel("127.0.0.1:14000", ChannelCredentials.Insecure)); | |||||
Metadata metadata = new Metadata(); | |||||
metadata.Add("token", "test"); | |||||
metadata.Add("request", "web"); | |||||
try | |||||
{ | |||||
var result = client.GetTcpAtomicCounter(new GrpcDashbord.ServiceGrpcBase.EmptyRequest(), metadata); | |||||
} | |||||
catch (RpcException ex) | |||||
{ | |||||
} | |||||
Console.ReadKey(); | |||||
server.ShutdownAsync().Wait(); | |||||
} | |||||
} | |||||
} |
@@ -1,5 +0,0 @@ | |||||
{ | |||||
"presets": [ | |||||
"@vue/app" | |||||
] | |||||
} |
@@ -1,9 +0,0 @@ | |||||
root = true | |||||
[*] | |||||
charset = utf-8 | |||||
indent_style = space | |||||
indent_size = 2 | |||||
end_of_line = lf | |||||
insert_final_newline = true | |||||
trim_trailing_whitespace = true |
@@ -1,19 +0,0 @@ | |||||
module.exports = { | |||||
root: true, | |||||
'extends': [ | |||||
'plugin:vue/essential', | |||||
'@vue/standard' | |||||
], | |||||
rules: { | |||||
// allow async-await | |||||
'generator-star-spacing': 'off', | |||||
// allow debugger during development | |||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |||||
'vue/no-parsing-error': [2, { 'x-invalid-end-tag': false }], | |||||
'no-undef': 'off', | |||||
'camelcase': 'off' | |||||
}, | |||||
parserOptions: { | |||||
parser: 'babel-eslint' | |||||
} | |||||
} |
@@ -1,26 +0,0 @@ | |||||
.DS_Store | |||||
node_modules | |||||
/dist | |||||
/tests/e2e/videos/ | |||||
/tests/e2e/screenshots/ | |||||
# local env files | |||||
.env.local | |||||
.env.*.local | |||||
# Log files | |||||
npm-debug.log* | |||||
yarn-debug.log* | |||||
yarn-error.log* | |||||
# Editor directories and files | |||||
.idea | |||||
.vscode | |||||
*.suo | |||||
*.ntvs* | |||||
*.njsproj | |||||
*.sln | |||||
*.sw* | |||||
build/env.js |
@@ -1,5 +0,0 @@ | |||||
module.exports = { | |||||
plugins: { | |||||
autoprefixer: {} | |||||
} | |||||
} |
@@ -1,21 +0,0 @@ | |||||
MIT License | |||||
Copyright (c) 2017 iView | |||||
Permission is hereby granted, free of charge, to any person obtaining a copy | |||||
of this software and associated documentation files (the "Software"), to deal | |||||
in the Software without restriction, including without limitation the rights | |||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||||
copies of the Software, and to permit persons to whom the Software is | |||||
furnished to do so, subject to the following conditions: | |||||
The above copyright notice and this permission notice shall be included in all | |||||
copies or substantial portions of the Software. | |||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||||
SOFTWARE. |
@@ -1,20 +0,0 @@ | |||||
# Install | |||||
```bush | |||||
// install dependencies | |||||
npm install | |||||
``` | |||||
## Run | |||||
### Development | |||||
```bush | |||||
npm run dev | |||||
``` | |||||
### Production(Build) | |||||
```bush | |||||
npm run build | |||||
``` |
@@ -1,17 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | |||||
<title></title> | |||||
</head> | |||||
<body> | |||||
<noscript> | |||||
<strong>We're sorry but iview-admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | |||||
</noscript> | |||||
<div id="app"></div> | |||||
<!-- built files will be auto injected --> | |||||
</body> | |||||
</html> |
@@ -1,27 +0,0 @@ | |||||
<template> | |||||
<div id="app"> | |||||
<router-view/> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
name: 'App' | |||||
} | |||||
</script> | |||||
<style lang="less"> | |||||
.size{ | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
html,body{ | |||||
.size; | |||||
overflow: hidden; | |||||
margin: 0; | |||||
padding: 0; | |||||
} | |||||
#app { | |||||
.size; | |||||
} | |||||
</style> |
@@ -1,8 +0,0 @@ | |||||
import axios from '@/libs/api.request' | |||||
export const GetAtomicCounter = () => { | |||||
return axios.request({ | |||||
url: 'AtomicCounter/GetAtomicCounter', | |||||
method: 'get' | |||||
}) | |||||
} |
@@ -1,37 +0,0 @@ | |||||
import axios from '@/libs/api.request' | |||||
export const getTableData = () => { | |||||
return axios.request({ | |||||
url: 'get_table_data', | |||||
method: 'get' | |||||
}) | |||||
} | |||||
export const getDragList = () => { | |||||
return axios.request({ | |||||
url: 'get_drag_list', | |||||
method: 'get' | |||||
}) | |||||
} | |||||
export const errorReq = () => { | |||||
return axios.request({ | |||||
url: 'error_url', | |||||
method: 'post' | |||||
}) | |||||
} | |||||
export const saveErrorLogger = info => { | |||||
return axios.request({ | |||||
url: 'save_error_logger', | |||||
data: info, | |||||
method: 'post' | |||||
}) | |||||
} | |||||
export const uploadImg = formData => { | |||||
return axios.request({ | |||||
url: 'image/upload', | |||||
data: formData | |||||
}) | |||||
} |
@@ -1,11 +0,0 @@ | |||||
import axios from '@/libs/api.request' | |||||
export const getRouterReq = (access) => { | |||||
return axios.request({ | |||||
url: 'get_router', | |||||
params: { | |||||
access | |||||
}, | |||||
method: 'get' | |||||
}) | |||||
} |
@@ -1,22 +0,0 @@ | |||||
import axios from '@/libs/api.request' | |||||
export const RemoveByTerminalPhoneNo = (terminalPhoneN) => { | |||||
return axios.request({ | |||||
url: 'Session/RemoveByTerminalPhoneNo/' + terminalPhoneN, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
export const RemoveByChannelId = (channelId) => { | |||||
return axios.request({ | |||||
url: 'Session/RemoveByChannelId/' + channelId, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
export const GetAll = () => { | |||||
return axios.request({ | |||||
url: 'Session/GetAll', | |||||
method: 'get' | |||||
}) | |||||
} |
@@ -1,32 +0,0 @@ | |||||
import axios from '@/libs/api.request' | |||||
export const Add = ({ Host, Port }) => { | |||||
const data = { | |||||
Host, | |||||
Port | |||||
} | |||||
return axios.request({ | |||||
url: 'SourcePackage/Add', | |||||
data, | |||||
method: 'post' | |||||
}) | |||||
} | |||||
export const Remove = ({ Host, Port }) => { | |||||
const data = { | |||||
Host, | |||||
Port | |||||
} | |||||
return axios.request({ | |||||
url: 'SourcePackage/Remove', | |||||
data, | |||||
method: 'post' | |||||
}) | |||||
} | |||||
export const GetAll = () => { | |||||
return axios.request({ | |||||
url: 'SourcePackage/GetAll', | |||||
method: 'get' | |||||
}) | |||||
} |
@@ -1,32 +0,0 @@ | |||||
import axios from '@/libs/api.request' | |||||
export const Add = ({ Host, Port }) => { | |||||
const data = { | |||||
Host, | |||||
Port | |||||
} | |||||
return axios.request({ | |||||
url: 'Transmit/Add', | |||||
data, | |||||
method: 'post' | |||||
}) | |||||
} | |||||
export const Remove = ({ Host, Port }) => { | |||||
const data = { | |||||
Host, | |||||
Port | |||||
} | |||||
return axios.request({ | |||||
url: 'Transmit/Remove', | |||||
data, | |||||
method: 'post' | |||||
}) | |||||
} | |||||
export const GetAll = () => { | |||||
return axios.request({ | |||||
url: 'Transmit/GetAll', | |||||
method: 'get' | |||||
}) | |||||
} |
@@ -1,8 +0,0 @@ | |||||
import axios from '@/libs/api.request' | |||||
export const SendText = ({ terminalPhoneNo, text }) => { | |||||
return axios.request({ | |||||
url: 'UnificationSend/SendText/' + terminalPhoneNo + '/' + text, | |||||
method: 'get' | |||||
}) | |||||
} |
@@ -1,84 +0,0 @@ | |||||
import axios from '@/libs/api.request' | |||||
export const login = ({ userName, password }) => { | |||||
const data = { | |||||
userName, | |||||
password | |||||
} | |||||
return axios.request({ | |||||
url: 'login', | |||||
data, | |||||
method: 'post' | |||||
}) | |||||
} | |||||
export const getUserInfo = (token) => { | |||||
return axios.request({ | |||||
url: 'get_info', | |||||
params: { | |||||
token | |||||
}, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
export const logout = (token) => { | |||||
return axios.request({ | |||||
url: 'logout', | |||||
method: 'post' | |||||
}) | |||||
} | |||||
export const getUnreadCount = () => { | |||||
return axios.request({ | |||||
url: 'message/count', | |||||
method: 'get' | |||||
}) | |||||
} | |||||
export const getMessage = () => { | |||||
return axios.request({ | |||||
url: 'message/init', | |||||
method: 'get' | |||||
}) | |||||
} | |||||
export const getContentByMsgId = msg_id => { | |||||
return axios.request({ | |||||
url: 'message/content', | |||||
method: 'get', | |||||
params: { | |||||
msg_id | |||||
} | |||||
}) | |||||
} | |||||
export const hasRead = msg_id => { | |||||
return axios.request({ | |||||
url: 'message/has_read', | |||||
method: 'post', | |||||
data: { | |||||
msg_id | |||||
} | |||||
}) | |||||
} | |||||
export const removeReaded = msg_id => { | |||||
return axios.request({ | |||||
url: 'message/remove_readed', | |||||
method: 'post', | |||||
data: { | |||||
msg_id | |||||
} | |||||
}) | |||||
} | |||||
export const restoreTrash = msg_id => { | |||||
return axios.request({ | |||||
url: 'message/restore', | |||||
method: 'post', | |||||
data: { | |||||
msg_id | |||||
} | |||||
}) | |||||
} |
@@ -1,37 +0,0 @@ | |||||
@font-face {font-family: "iconfont"; | |||||
src: url('iconfont.eot?t=1541579316141'); /* IE9*/ | |||||
src: url('iconfont.eot?t=1541579316141#iefix') format('embedded-opentype'), /* IE6-IE8 */ | |||||
url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAiEAAsAAAAADmgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8eUnXY21hcAAAAYAAAACjAAACLi+YJuBnbHlmAAACJAAABAgAAAcg4dRWHmhlYWQAAAYsAAAAMQAAADYTL8piaGhlYQAABmAAAAAgAAAAJAfdA4xobXR4AAAGgAAAABQAAAAsLAD//2xvY2EAAAaUAAAAGAAAABgImgpGbWF4cAAABqwAAAAfAAAAIAEcAG5uYW1lAAAGzAAAAUUAAAJtPlT+fXBvc3QAAAgUAAAAbgAAAI54roygeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMTx/ytzwv4EhhrmBoRkozAiSAwDuUwzMeJzlkUEKwkAMRd/YabXFhQvxFF6qPYPrUujGY7jyIr1JoZNjtMnEhag3MOEN5MMk8D9QAoVyVSKEJwGrh6oh6wVN1iM3nc+cVImJVKdOehlklElmWdYVstp+ql8VdIv15a1NLW0zFXsO7Kjz3erH/3+rY37vr6kxnx1LKNWOJZlaxxJNnWOpSu+ot8jgqMvI6KjfyOSo88jsaAbI4tBsig89rQB4nLVUTWwbRRSeNzO767i2g7N/FP9s7MRrE5ON4/V6rSZyU0PiINSSNImES4IUoapWz6hEiqiMBDQqEojkAkiFStyKRC+9VSoFCeUEyqESVUAqEkcu3OAQb3hrJxAXwSGI3X0/szPz5vvm2x0i7O/vf8IJe5VkSJnUyUtklRBQJE1VIjRtUafkmk6pSu2ipleh4+xikkKxSksWTUeo8m8NoagpYtoslTmxrLl37z64e33esuJjU8P5Wd262LxoPVnPZ06Pxfe+C0YjkhSJygPhQCA8ABPOykwuN7NyuRvgUnAgLEnhATkaCQQiUe/7XKUyV6nQz+t2o7l66+rs7NVbq82GXTdrdjxjRGU5amTids2bUDMFtzCsqsMYMqr3IDY6OT05GjsI8Exv/6CSkOWEQigh+y3clxY5QVTcEZFIGtHLxDUJs6WsHR1y9SFKdr1HggCp3V1ICYL36OOpVmvKN9bC1u6R3vZ0qwWtVovgJfqOfUvfIYxIWL+fyETHNVJqSkIT1JTjW8ZWh3yDJDz0ctvsyt51etvrg9/QHhqGlzMM+vbmizPnDWPLMNbW19e7tffvsBzL99aWEfBRY46t+tbe3PypXv/IMDYN43WsQBe9HL2NC33RuxABrPsG+xH3o4bVRE2KgCRqulbWNf8W/UYVHM129aKra24VshZkq+CWD/Oy6Xt8cGYEthgHVlVliCfynAlqjo6oysTKlYUAD4docMI5/1ZioN+GwZNBcTwWUmTdBUqhTwX29QebXzF4An4JJMzwfMl+WQ01+IlQZVR4yhie53ycA16pOI/ODiYNGK4MChdCgXNnX5gIJXPCSYnf2OF850aQ+zJIyOs+u8+mMO8jQdwtg1TIWVRjKAnFcslMi8KfGUPoSUCergUyUk77dMyS69Ms6tijKZKYwUGKbpfdzu+iYeZYAHMFiOVi+MD7h9mb99qC0L7X8c+XatMfTj97KZ5IxJt/pd43tYYQKEjAnXMOB6kQEBrwg+LPjindAPOHNdC3q3ait0I3/ZIunZEARLNYNEUA6czSP3N/7j9wz6ZESdX0VNl1zGNS/szbQaQSIGk4DtVPcZf8AgXpf9A2OyTit5s2syZmand46bhEe2WtodLHkvaoqtTXuXN2/c42WADP9HGfbUcUW7JgqHss4xHtlMys679FqUomdP9VJBQBdnlPABBubpuNwqnmQj6/0HwNQzKxDUJFgKiXurBG6dqFjmeBzsvtRPJgGIZThYa5fdOvsReOticPh6JHHXxsv7ItJpOniYPYsmZ/x0QD/o5P105DeQwF6MH33ogoLi+KQp7zpY3HQV5bFMURzheXeds7gpP+jKNXljjHuYvXHke7cdCxLLZf6YX7B63UcCV4nGNgZGBgAOKAN2ZR8fw2Xxm4WRhA4AbHYRMY/f///1oWBuYGIJeDgQkkCgAvWgs2AAAAeJxjYGRgYG7438AQw8Lw/z8DAwsDA1AEBXADAHXiBHJ4nGNhYGBgYfj/nwVM48cATwECKwAAAAAAjAC6AOgBFAGAAf4CbgLqAzgDkHicY2BkYGDgZkhiYGcAASYg5gJCBob/YD4DABOmAYsAeJxlj01OwzAQhV/6B6QSqqhgh+QFYgEo/RGrblhUavdddN+mTpsqiSPHrdQDcB6OwAk4AtyAO/BIJ5s2lsffvHljTwDc4Acejt8t95E9XDI7cg0XuBeuU38QbpBfhJto41W4Rf1N2MczpsJtdGF5g9e4YvaEd2EPHXwI13CNT+E69S/hBvlbuIk7/Aq30PHqwj7mXle4jUcv9sdWL5xeqeVBxaHJIpM5v4KZXu+Sha3S6pxrW8QmU4OgX0lTnWlb3VPs10PnIhVZk6oJqzpJjMqt2erQBRvn8lGvF4kehCblWGP+tsYCjnEFhSUOjDFCGGSIyujoO1Vm9K+xQ8Jee1Y9zed0WxTU/3OFAQL0z1xTurLSeTpPgT1fG1J1dCtuy56UNJFezUkSskJe1rZUQuoBNmVXjhF6XNGJPyhnSP8ACVpuyAAAAHicbYhdDoIwEAb3a6k/YIIX8VArWewmdJFWJOnpJTG+OQ+TzJCjLy39p4ODR4OAA4444YwWHS7U3IVzn6Voldtb8ksHnvohrlqjjmw1rmzXsvdT7fEbblnCmOfNfJIYStJJfGIL27yb6AOCGR89AAA=') format('woff'), | |||||
url('iconfont.ttf?t=1541579316141') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ | |||||
url('iconfont.svg?t=1541579316141#iconfont') format('svg'); /* iOS 4.1- */ | |||||
} | |||||
.iconfont { | |||||
font-family:"iconfont" !important; | |||||
font-size:16px; | |||||
font-style:normal; | |||||
-webkit-font-smoothing: antialiased; | |||||
-moz-osx-font-smoothing: grayscale; | |||||
} | |||||
.icon-bear:before { content: "\e600"; } | |||||
.icon-resize-vertical:before { content: "\e7c3"; } | |||||
.icon-chuizhifanzhuan:before { content: "\e661"; } | |||||
.icon-shuipingfanzhuan:before { content: "\e662"; } | |||||
.icon-qq:before { content: "\e609"; } | |||||
.icon-frown:before { content: "\e77e"; } | |||||
.icon-meh:before { content: "\e780"; } | |||||
.icon-smile:before { content: "\e783"; } | |||||
.icon-man:before { content: "\e7e2"; } | |||||
.icon-woman:before { content: "\e7e5"; } | |||||
@@ -1,56 +0,0 @@ | |||||
<?xml version="1.0" standalone="no"?> | |||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > | |||||
<!-- | |||||
2013-9-30: Created. | |||||
--> | |||||
<svg> | |||||
<metadata> | |||||
Created by iconfont | |||||
</metadata> | |||||
<defs> | |||||
<font id="iconfont" horiz-adv-x="1024" > | |||||
<font-face | |||||
font-family="iconfont" | |||||
font-weight="500" | |||||
font-stretch="normal" | |||||
units-per-em="1024" | |||||
ascent="896" | |||||
descent="-128" | |||||
/> | |||||
<missing-glyph /> | |||||
<glyph glyph-name="bear" unicode="" d="M1024 683.008q0-70.656-46.08-121.856 46.08-89.088 46.08-193.536 0-96.256-39.936-181.248t-109.568-147.968-162.816-99.328-199.68-36.352-199.68 36.352-162.304 99.328-109.568 147.968-40.448 181.248q0 104.448 46.08 193.536-46.08 51.2-46.08 121.856 0 37.888 13.824 71.168t37.376 58.368 55.808 39.424 68.096 14.336q43.008 0 78.848-18.432t59.392-50.176q46.08 17.408 96.256 26.624t102.4 9.216 102.4-9.216 96.256-26.624q24.576 31.744 59.904 50.176t78.336 18.432q36.864 0 68.608-14.336t55.296-39.424 37.376-58.368 13.824-71.168zM205.824 268.288q10.24 0 18.944 10.24t15.36 28.672 10.24 42.496 3.584 51.712-3.584 51.712-10.24 41.984-15.36 28.16-18.944 10.24q-9.216 0-17.92-10.24t-15.36-28.16-10.752-41.984-4.096-51.712 4.096-51.712 10.752-42.496 15.36-28.672 17.92-10.24zM512-31.744000000000028q53.248 0 99.84 13.312t81.408 35.84 54.784 52.736 19.968 65.024q0 33.792-19.968 64t-54.784 52.736-81.408 35.84-99.84 13.312-99.84-13.312-81.408-35.84-54.784-52.736-19.968-64q0-34.816 19.968-65.024t54.784-52.736 81.408-35.84 99.84-13.312zM818.176 268.288q10.24 0 18.944 10.24t15.36 28.672 10.24 42.496 3.584 51.712-3.584 51.712-10.24 41.984-15.36 28.16-18.944 10.24q-9.216 0-17.92-10.24t-15.36-28.16-10.752-41.984-4.096-51.712 4.096-51.712 10.752-42.496 15.36-28.672 17.92-10.24zM512 235.51999999999998q39.936 0 68.096-9.728t28.16-24.064-28.16-24.064-68.096-9.728-68.096 9.728-28.16 24.064 28.16 24.064 68.096 9.728z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="resize-vertical" unicode="" d="M512 896C229.248 896 0 666.752 0 384s229.248-512 512-512 512 229.248 512 512S794.752 896 512 896zM576 192l64 0-128-128-128 128 64 0L448 576l-64 0 128 128 128-128-64 0L576 192z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="chuizhifanzhuan" unicode="" d="M286.01856 645.08416l472.4224 0 0-146.2784-472.4224 0 0 146.2784ZM87.19872 420.37248l885.80096 0 0-70.87104-885.80096 0 0 70.87104ZM773.55008 268.05248l0-31.0016L270.6688 237.05088l0 31.0016L773.55008 268.05248zM773.55008 121.4208l0-31.0016L270.6688 90.4192l0 31.0016L773.55008 121.4208zM742.54848 240.75776l31.0016 0 0-123.04896-31.0016 0L742.54848 240.75776zM270.70464 240.57856l31.0016 0 0-123.04896-31.0016 0L270.70464 240.57856z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="shuipingfanzhuan" unicode="" d="M252.76928 596.096l146.2784 0 0-472.42752-146.2784 0 0 472.42752ZM477.48096 810.65472l70.87104 0 0-885.80608-70.87104 0 0 885.80608ZM629.80096 611.2l31.0016 0 0-502.88128-31.0016 0L629.80096 611.2zM776.42752 611.2l31.0016 0 0-502.88128-31.0016 0L776.42752 611.2zM657.09056 580.1984l0 31.0016 123.04896 0 0-31.0016L657.09056 580.1984zM657.27488 108.35456l0 31.0016 123.04896 0 0-31.0016L657.27488 108.35456z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="qq" unicode="" d="M147.372058 491.394284c-5.28997-13.909921 2.431986-22.698872 0-75.732573-0.682996-14.25092-62.165649-78.762555-86.569511-145.791177-24.192863-66.517625-27.519845-135.978232 9.811944-163.285078 37.419789-27.305846 72.191593 90.879487 76.757567 73.685584 1.961989-7.509958 4.436975-15.317914 7.423958-23.338868a331.945126 331.945126 0 0 1 61.140655-101.162429c5.929967-6.783962-36.009797-19.199892-61.140655-61.99365-25.173858-42.751759 7.209959-120.49032 132.223254-120.49032 161.27909 0 197.288886 56.70368 200.574868 56.447681 12.031932-0.895995 12.841928 0 25.599855 0 15.572912 0 9.129948-1.279993 23.593867 0 7.807956 0.682996 86.186514-67.839617 194.686901-56.447681 184.873956 19.45589 156.586116 81.40754 142.079198 120.48932-15.103915 40.83277-68.692612 59.946662-66.303626 62.549647 44.28775 48.938724 51.285711 79.018554 66.346626 123.9463 6.143965 18.473896 49.066723-101.674426 82.089537-73.685584 13.781922 11.690934 41.301767 60.24566 13.781922 163.285078-27.519845 102.996419-80.767544 126.505286-79.615551 145.791177 2.389987 40.191773 1.023994 68.436614-1.023994 75.732573-9.812945 35.4128-30.378829 27.604844-30.378829 35.4128C858.450044 730.752933 705.10691 896 515.966978 896s-342.398067-165.289067-342.398068-369.192916c0-16.169909-14.378919-4.223976-26.154852-35.4128z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="frown" unicode="" d="M336 475m-48 0a48 48 0 1 1 96 0 48 48 0 1 1-96 0ZM688 475m-48 0a48 48 0 1 1 96 0 48 48 0 1 1-96 0ZM512 832C264.6 832 64 631.4 64 384s200.6-448 448-448 448 200.6 448 448S759.4 832 512 832z m263-711c-34.2-34.2-74-61-118.3-79.8C611 21.8 562.3 12 512 12c-50.3 0-99 9.8-144.8 29.2-44.3 18.7-84.1 45.6-118.3 79.8-34.2 34.2-61 74-79.8 118.3C149.8 285 140 333.7 140 384s9.8 99 29.2 144.8c18.7 44.3 45.6 84.1 79.8 118.3 34.2 34.2 74 61 118.3 79.8C413 746.2 461.7 756 512 756c50.3 0 99-9.8 144.8-29.2 44.3-18.7 84.1-45.6 118.3-79.8 34.2-34.2 61-74 79.8-118.3C874.2 483 884 434.3 884 384s-9.8-99-29.2-144.8c-18.7-44.3-45.6-84.1-79.8-118.2zM512 363c-85.5 0-155.6-67.3-160-151.6-0.2-4.6 3.4-8.4 8-8.4h48.1c4.2 0 7.8 3.2 8.1 7.4C420 259.9 461.5 299 512 299s92.1-39.1 95.8-88.6c0.3-4.2 3.9-7.4 8.1-7.4H664c4.6 0 8.2 3.8 8 8.4-4.4 84.3-74.5 151.6-160 151.6z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="meh" unicode="" d="M336 475m-48 0a48 48 0 1 1 96 0 48 48 0 1 1-96 0ZM688 475m-48 0a48 48 0 1 1 96 0 48 48 0 1 1-96 0ZM512 832C264.6 832 64 631.4 64 384s200.6-448 448-448 448 200.6 448 448S759.4 832 512 832z m263-711c-34.2-34.2-74-61-118.3-79.8C611 21.8 562.3 12 512 12c-50.3 0-99 9.8-144.8 29.2-44.3 18.7-84.1 45.6-118.3 79.8-34.2 34.2-61 74-79.8 118.3C149.8 285 140 333.7 140 384s9.8 99 29.2 144.8c18.7 44.3 45.6 84.1 79.8 118.3 34.2 34.2 74 61 118.3 79.8C413 746.2 461.7 756 512 756c50.3 0 99-9.8 144.8-29.2 44.3-18.7 84.1-45.6 118.3-79.8 34.2-34.2 61-74 79.8-118.3C874.2 483 884 434.3 884 384s-9.8-99-29.2-144.8c-18.7-44.3-45.6-84.1-79.8-118.2zM664 331H360c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h304c4.4 0 8 3.6 8 8v48c0 4.4-3.6 8-8 8z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="smile" unicode="" d="M336 475m-48 0a48 48 0 1 1 96 0 48 48 0 1 1-96 0ZM688 475m-48 0a48 48 0 1 1 96 0 48 48 0 1 1-96 0ZM512 832C264.6 832 64 631.4 64 384s200.6-448 448-448 448 200.6 448 448S759.4 832 512 832z m263-711c-34.2-34.2-74-61-118.3-79.8C611 21.8 562.3 12 512 12c-50.3 0-99 9.8-144.8 29.2-44.3 18.7-84.1 45.6-118.3 79.8-34.2 34.2-61 74-79.8 118.3C149.8 285 140 333.7 140 384s9.8 99 29.2 144.8c18.7 44.3 45.6 84.1 79.8 118.3 34.2 34.2 74 61 118.3 79.8C413 746.2 461.7 756 512 756c50.3 0 99-9.8 144.8-29.2 44.3-18.7 84.1-45.6 118.3-79.8 34.2-34.2 61-74 79.8-118.3C874.2 483 884 434.3 884 384s-9.8-99-29.2-144.8c-18.7-44.3-45.6-84.1-79.8-118.2zM664 363h-48.1c-4.2 0-7.8-3.2-8.1-7.4C604 306.1 562.5 267 512 267s-92.1 39.1-95.8 88.6c-0.3 4.2-3.9 7.4-8.1 7.4H360c-4.6 0-8.2-3.8-8-8.4 4.4-84.3 74.5-151.6 160-151.6s155.6 67.3 160 151.6c0.2 4.6-3.4 8.4-8 8.4z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="man" unicode="" d="M874 776H622c-3.3 0-6-2.7-6-6v-56c0-3.3 2.7-6 6-6h160.4L583.1 508.7c-50 38.5-111 59.3-175.1 59.3-76.9 0-149.3-30-203.6-84.4S120 356.9 120 280s30-149.3 84.4-203.6C258.7 22 331.1-8 408-8s149.3 30 203.6 84.4C666 130.7 696 203.1 696 280c0 64.1-20.8 124.9-59.2 174.9L836 654.1V494c0-3.3 2.7-6 6-6h56c3.3 0 6 2.7 6 6V746c0 16.5-13.5 30-30 30zM408 68c-116.9 0-212 95.1-212 212s95.1 212 212 212 212-95.1 212-212-95.1-212-212-212z" horiz-adv-x="1024" /> | |||||
<glyph glyph-name="woman" unicode="" d="M909.7 739.4l-42.2 42.2c-3.1 3.1-8.2 3.1-11.3 0L764 689.4l-84.2 84.2c-3.1 3.1-8.2 3.1-11.3 0l-42.1-42.1c-3.1-3.1-3.1-8.1 0-11.3l84.2-84.2-135.5-135.3c-50 38.5-111 59.3-175.1 59.3-76.9 0-149.3-30-203.6-84.4S112 348.9 112 272s30-149.3 84.4-203.6C250.7 14 323.1-16 400-16s149.3 30 203.6 84.4C658 122.7 688 195.1 688 272c0 64.2-20.9 125.1-59.3 175.1l135.4 135.4 84.2-84.2c3.1-3.1 8.2-3.1 11.3 0l42.1 42.1c3.1 3.1 3.1 8.1 0 11.3l-84.2 84.2 92.2 92.2c3.1 3.1 3.1 8.2 0 11.3zM400 60c-116.9 0-212 95.1-212 212s95.1 212 212 212 212-95.1 212-212-95.1-212-212-212z" horiz-adv-x="1024" /> | |||||
</font> | |||||
</defs></svg> |
@@ -1,58 +0,0 @@ | |||||
<template> | |||||
<div ref="dom" class="charts chart-bar"></div> | |||||
</template> | |||||
<script> | |||||
import echarts from 'echarts' | |||||
import tdTheme from './theme.json' | |||||
import { on, off } from '@/libs/tools' | |||||
echarts.registerTheme('tdTheme', tdTheme) | |||||
export default { | |||||
name: 'ChartBar', | |||||
props: { | |||||
value: Object, | |||||
text: String, | |||||
subtext: String | |||||
}, | |||||
data () { | |||||
return { | |||||
dom: null | |||||
} | |||||
}, | |||||
methods: { | |||||
resize () { | |||||
this.dom.resize() | |||||
} | |||||
}, | |||||
mounted () { | |||||
this.$nextTick(() => { | |||||
let xAxisData = Object.keys(this.value) | |||||
let seriesData = Object.values(this.value) | |||||
let option = { | |||||
title: { | |||||
text: this.text, | |||||
subtext: this.subtext, | |||||
x: 'center' | |||||
}, | |||||
xAxis: { | |||||
type: 'category', | |||||
data: xAxisData | |||||
}, | |||||
yAxis: { | |||||
type: 'value' | |||||
}, | |||||
series: [{ | |||||
data: seriesData, | |||||
type: 'bar' | |||||
}] | |||||
} | |||||
this.dom = echarts.init(this.$refs.dom, 'tdTheme') | |||||
this.dom.setOption(option) | |||||
on(window, 'resize', this.resize) | |||||
}) | |||||
}, | |||||
beforeDestroy () { | |||||
off(window, 'resize', this.resize) | |||||
} | |||||
} | |||||
</script> |
@@ -1,3 +0,0 @@ | |||||
import ChartPie from './pie.vue' | |||||
import ChartBar from './bar.vue' | |||||
export { ChartPie, ChartBar } |
@@ -1,70 +0,0 @@ | |||||
<template> | |||||
<div ref="dom" class="charts chart-pie"></div> | |||||
</template> | |||||
<script> | |||||
import echarts from 'echarts' | |||||
import tdTheme from './theme.json' | |||||
import { on, off } from '@/libs/tools' | |||||
echarts.registerTheme('tdTheme', tdTheme) | |||||
export default { | |||||
name: 'ChartPie', | |||||
props: { | |||||
value: Array, | |||||
text: String, | |||||
subtext: String | |||||
}, | |||||
data () { | |||||
return { | |||||
dom: null | |||||
} | |||||
}, | |||||
methods: { | |||||
resize () { | |||||
this.dom.resize() | |||||
} | |||||
}, | |||||
mounted () { | |||||
this.$nextTick(() => { | |||||
let legend = this.value.map(_ => _.name) | |||||
let option = { | |||||
title: { | |||||
text: this.text, | |||||
subtext: this.subtext, | |||||
x: 'center' | |||||
}, | |||||
tooltip: { | |||||
trigger: 'item', | |||||
formatter: '{a} <br/>{b} : {c} ({d}%)' | |||||
}, | |||||
legend: { | |||||
orient: 'vertical', | |||||
left: 'left', | |||||
data: legend | |||||
}, | |||||
series: [ | |||||
{ | |||||
type: 'pie', | |||||
radius: '55%', | |||||
center: ['50%', '60%'], | |||||
data: this.value, | |||||
itemStyle: { | |||||
emphasis: { | |||||
shadowBlur: 10, | |||||
shadowOffsetX: 0, | |||||
shadowColor: 'rgba(0, 0, 0, 0.5)' | |||||
} | |||||
} | |||||
} | |||||
] | |||||
} | |||||
this.dom = echarts.init(this.$refs.dom, 'tdTheme') | |||||
this.dom.setOption(option) | |||||
on(window, 'resize', this.resize) | |||||
}) | |||||
}, | |||||
beforeDestroy () { | |||||
off(window, 'resize', this.resize) | |||||
} | |||||
} | |||||
</script> |
@@ -1,42 +0,0 @@ | |||||
<template> | |||||
<component :is="iconType" :type="iconName" :color="iconColor" :size="iconSize"/> | |||||
</template> | |||||
<script> | |||||
import Icons from '_c/icons' | |||||
export default { | |||||
name: 'CommonIcon', | |||||
components: {Icons}, | |||||
props: { | |||||
type: { | |||||
type: String, | |||||
required: true | |||||
}, | |||||
color: String, | |||||
size: Number | |||||
}, | |||||
computed: { | |||||
iconType () { | |||||
return this.type.indexOf('_') === 0 ? 'Icons' : 'Icon' | |||||
}, | |||||
iconName () { | |||||
return this.iconType === 'Icons' ? this.getCustomIconName(this.type) : this.type | |||||
}, | |||||
iconSize () { | |||||
return this.size || (this.iconType === 'Icons' ? 12 : undefined) | |||||
}, | |||||
iconColor () { | |||||
return this.color || '' | |||||
} | |||||
}, | |||||
methods: { | |||||
getCustomIconName (iconName) { | |||||
return iconName.slice(1) | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style> | |||||
</style> |
@@ -1,2 +0,0 @@ | |||||
import CommonIcon from './common-icon.vue' | |||||
export default CommonIcon |
@@ -1,8 +0,0 @@ | |||||
.no-select{ | |||||
-webkit-touch-callout: none; | |||||
-webkit-user-select: none; | |||||
-khtml-user-select: none; | |||||
-moz-user-select: none; | |||||
-ms-user-select: none; | |||||
user-select: none; | |||||
} |
@@ -1,3 +0,0 @@ | |||||
export const showTitle = (item, vm) => { | |||||
return vm.$config.useI18n ? vm.$t(item.name) : ((item.meta && item.meta.title) || item.name) | |||||
} |
@@ -1,174 +0,0 @@ | |||||
<template> | |||||
<div class="count-to-wrapper"> | |||||
<slot name="left"/> | |||||
<p class="content-outer"><span :class="['count-to-count-text', countClass]" :id="counterId">{{ init }}</span><i :class="['count-to-unit-text', unitClass]">{{ unitText }}</i></p> | |||||
<slot name="right"/> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import CountUp from 'countup' | |||||
import './index.less' | |||||
export default { | |||||
name: 'CountTo', | |||||
props: { | |||||
init: { | |||||
type: Number, | |||||
default: 0 | |||||
}, | |||||
/** | |||||
* @description 起始值,即动画开始前显示的数值 | |||||
*/ | |||||
startVal: { | |||||
type: Number, | |||||
default: 0 | |||||
}, | |||||
/** | |||||
* @description 结束值,即动画结束后显示的数值 | |||||
*/ | |||||
end: { | |||||
type: Number, | |||||
required: true | |||||
}, | |||||
/** | |||||
* @description 保留几位小数 | |||||
*/ | |||||
decimals: { | |||||
type: Number, | |||||
default: 0 | |||||
}, | |||||
/** | |||||
* @description 分隔整数和小数的符号,默认是小数点 | |||||
*/ | |||||
decimal: { | |||||
type: String, | |||||
default: '.' | |||||
}, | |||||
/** | |||||
* @description 动画持续的时间,单位是秒 | |||||
*/ | |||||
duration: { | |||||
type: Number, | |||||
default: 2 | |||||
}, | |||||
/** | |||||
* @description 动画延迟开始的时间,单位是秒 | |||||
*/ | |||||
delay: { | |||||
type: Number, | |||||
default: 0 | |||||
}, | |||||
/** | |||||
* @description 是否禁用easing动画效果 | |||||
*/ | |||||
uneasing: { | |||||
type: Boolean, | |||||
default: false | |||||
}, | |||||
/** | |||||
* @description 是否使用分组,分组后每三位会用一个符号分隔 | |||||
*/ | |||||
usegroup: { | |||||
type: Boolean, | |||||
default: false | |||||
}, | |||||
/** | |||||
* @description 用于分组(usegroup)的符号 | |||||
*/ | |||||
separator: { | |||||
type: String, | |||||
default: ',' | |||||
}, | |||||
/** | |||||
* @description 是否简化显示,设为true后会使用unit单位来做相关省略 | |||||
*/ | |||||
simplify: { | |||||
type: Boolean, | |||||
default: false | |||||
}, | |||||
/** | |||||
* @description 自定义单位,如[3, 'K+'], [6, 'M+']即大于3位数小于6位数的用k+来做省略 | |||||
* 1000即显示为1K+ | |||||
*/ | |||||
unit: { | |||||
type: Array, | |||||
default () { | |||||
return [[3, 'K+'], [6, 'M+'], [9, 'B+']] | |||||
} | |||||
}, | |||||
countClass: { | |||||
type: String, | |||||
default: '' | |||||
}, | |||||
unitClass: { | |||||
type: String, | |||||
default: '' | |||||
} | |||||
}, | |||||
data () { | |||||
return { | |||||
counter: null, | |||||
unitText: '' | |||||
} | |||||
}, | |||||
computed: { | |||||
counterId () { | |||||
return `count_to_${this._uid}` | |||||
} | |||||
}, | |||||
methods: { | |||||
getHandleVal (val, len) { | |||||
return { | |||||
endVal: parseInt(val / Math.pow(10, this.unit[len - 1][0])), | |||||
unitText: this.unit[len - 1][1] | |||||
} | |||||
}, | |||||
transformValue (val) { | |||||
let len = this.unit.length | |||||
let res = { | |||||
endVal: 0, | |||||
unitText: '' | |||||
} | |||||
if (val < Math.pow(10, this.unit[0][0])) res.endVal = val | |||||
else { | |||||
for (let i = 1; i < len; i++) { | |||||
if (val >= Math.pow(10, this.unit[i - 1][0]) && val < Math.pow(10, this.unit[i][0])) res = this.getHandleVal(val, i) | |||||
} | |||||
} | |||||
if (val > Math.pow(10, this.unit[len - 1][0])) res = this.getHandleVal(val, len) | |||||
return res | |||||
}, | |||||
getValue (val) { | |||||
let res = 0 | |||||
if (this.simplify) { | |||||
let { endVal, unitText } = this.transformValue(val) | |||||
this.unitText = unitText | |||||
res = endVal | |||||
} else { | |||||
res = val | |||||
} | |||||
return res | |||||
} | |||||
}, | |||||
mounted () { | |||||
this.$nextTick(() => { | |||||
let endVal = this.getValue(this.end) | |||||
this.counter = new CountUp(this.counterId, this.startVal, endVal, this.decimals, this.duration, { | |||||
useEasing: !this.uneasing, | |||||
useGrouping: this.useGroup, | |||||
separator: this.separator, | |||||
decimal: this.decimal | |||||
}) | |||||
setTimeout(() => { | |||||
if (!this.counter.error) this.counter.start() | |||||
}, this.delay) | |||||
}) | |||||
}, | |||||
watch: { | |||||
end (newVal) { | |||||
let endVal = this.getValue(newVal) | |||||
this.counter.update(endVal) | |||||
} | |||||
} | |||||
} | |||||
</script> |
@@ -1,2 +0,0 @@ | |||||
import countTo from './count-to.vue' | |||||
export default countTo |
@@ -1,10 +0,0 @@ | |||||
@prefix: ~"count-to"; | |||||
.@{prefix}-wrapper{ | |||||
.content-outer{ | |||||
display: inline-block; | |||||
.@{prefix}-unit-text{ | |||||
font-style: normal; | |||||
} | |||||
} | |||||
} |
@@ -1,2 +0,0 @@ | |||||
import Cropper from './index.vue' | |||||
export default Cropper |
@@ -1,35 +0,0 @@ | |||||
.bg{ | |||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC") | |||||
} | |||||
.cropper-wrapper{ | |||||
width: 600px; | |||||
height: 340px; | |||||
.img-box{ | |||||
height: 340px; | |||||
width: 430px; | |||||
border: 1px solid #ebebeb; | |||||
display: inline-block; | |||||
.bg; | |||||
img{ | |||||
max-width: 100%; | |||||
display: block; | |||||
} | |||||
} | |||||
.right-con{ | |||||
display: inline-block; | |||||
width: 170px; | |||||
vertical-align: top; | |||||
box-sizing: border-box; | |||||
padding: 0 10px; | |||||
.preview-box{ | |||||
height: 150px !important; | |||||
width: 100% !important; | |||||
overflow: hidden; | |||||
border: 1px solid #ebebeb; | |||||
.bg; | |||||
} | |||||
.button-box{ | |||||
padding: 10px 0 0; | |||||
} | |||||
} | |||||
} |
@@ -1,139 +0,0 @@ | |||||
<template> | |||||
<div class="cropper-wrapper"> | |||||
<div class="img-box"> | |||||
<img class="cropper-image" :id="imgId" alt=""> | |||||
</div> | |||||
<div class="right-con"> | |||||
<div v-if="preview" class="preview-box" :id="previewId"></div> | |||||
<div class="button-box"> | |||||
<slot> | |||||
<Upload action="image/upload" :before-upload="beforeUpload"> | |||||
<Button style="width: 150px;" type="primary">上传图片</Button> | |||||
</Upload> | |||||
</slot> | |||||
<div v-show="insideSrc"> | |||||
<Button type="primary" @click="rotate"> | |||||
<Icon type="md-refresh" :size="18"/> | |||||
</Button> | |||||
<Button type="primary" @click="shrink"> | |||||
<Icon type="md-remove" :size="18"/> | |||||
</Button> | |||||
<Button type="primary" @click="magnify"> | |||||
<Icon type="md-add" :size="18"/> | |||||
</Button> | |||||
<Button type="primary" @click="scale('X')"> | |||||
<Icon custom="iconfont icon-shuipingfanzhuan" :size="18"/> | |||||
</Button> | |||||
<Button type="primary" @click="scale('Y')"> | |||||
<Icon custom="iconfont icon-chuizhifanzhuan" :size="18"/> | |||||
</Button> | |||||
<Button type="primary" @click="move(0, -moveStep)"> | |||||
<Icon type="md-arrow-round-up" :size="18"/> | |||||
</Button> | |||||
<Button type="primary" @click="move(-moveStep, 0)"> | |||||
<Icon type="md-arrow-round-back" :size="18"/> | |||||
</Button> | |||||
<Button type="primary" @click="move(0, moveStep)"> | |||||
<Icon type="md-arrow-round-down" :size="18"/> | |||||
</Button> | |||||
<Button type="primary" @click="move(moveStep, 0)"> | |||||
<Icon type="md-arrow-round-forward" :size="18"/> | |||||
</Button> | |||||
<Button style="width: 150px;margin-top: 10px;" type="primary" @click="crop">{{ cropButtonText }}</Button> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import Cropper from 'cropperjs' | |||||
import './index.less' | |||||
import 'cropperjs/dist/cropper.min.css' | |||||
export default { | |||||
name: 'Cropper', | |||||
props: { | |||||
src: { | |||||
type: String, | |||||
default: '' | |||||
}, | |||||
preview: { | |||||
type: Boolean, | |||||
default: true | |||||
}, | |||||
moveStep: { | |||||
type: Number, | |||||
default: 4 | |||||
}, | |||||
cropButtonText: { | |||||
type: String, | |||||
default: '裁剪' | |||||
} | |||||
}, | |||||
data () { | |||||
return { | |||||
cropper: null, | |||||
insideSrc: '' | |||||
} | |||||
}, | |||||
computed: { | |||||
imgId () { | |||||
return `cropper${this._uid}` | |||||
}, | |||||
previewId () { | |||||
return `cropper_preview${this._uid}` | |||||
} | |||||
}, | |||||
watch: { | |||||
src (src) { | |||||
this.replace(src) | |||||
}, | |||||
insideSrc (src) { | |||||
this.replace(src) | |||||
} | |||||
}, | |||||
methods: { | |||||
beforeUpload (file) { | |||||
const reader = new FileReader() | |||||
reader.readAsDataURL(file) | |||||
reader.onload = (event) => { | |||||
this.insideSrc = event.srcElement.result | |||||
} | |||||
return false | |||||
}, | |||||
replace (src) { | |||||
this.cropper.replace(src) | |||||
this.insideSrc = src | |||||
}, | |||||
rotate () { | |||||
this.cropper.rotate(90) | |||||
}, | |||||
shrink () { | |||||
this.cropper.zoom(-0.1) | |||||
}, | |||||
magnify () { | |||||
this.cropper.zoom(0.1) | |||||
}, | |||||
scale (d) { | |||||
this.cropper[`scale${d}`](-this.cropper.getData()[`scale${d}`]) | |||||
}, | |||||
move (...argu) { | |||||
this.cropper.move(...argu) | |||||
}, | |||||
crop () { | |||||
this.cropper.getCroppedCanvas().toBlob(blob => { | |||||
this.$emit('on-crop', blob) | |||||
}) | |||||
} | |||||
}, | |||||
mounted () { | |||||
this.$nextTick(() => { | |||||
let dom = document.getElementById(this.imgId) | |||||
this.cropper = new Cropper(dom, { | |||||
preview: `#${this.previewId}`, | |||||
checkCrossOrigin: true | |||||
}) | |||||
}) | |||||
} | |||||
} | |||||
</script> |
@@ -1,35 +0,0 @@ | |||||
<template> | |||||
<i :class="`iconfont icon-${type}`" :style="styles"></i> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
name: 'Icons', | |||||
props: { | |||||
type: { | |||||
type: String, | |||||
required: true | |||||
}, | |||||
color: { | |||||
type: String, | |||||
default: '#5c6b77' | |||||
}, | |||||
size: { | |||||
type: Number, | |||||
default: 16 | |||||
} | |||||
}, | |||||
computed: { | |||||
styles () { | |||||
return { | |||||
fontSize: `${this.size}px`, | |||||
color: this.color | |||||
} | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style> | |||||
</style> |
@@ -1,2 +0,0 @@ | |||||
import Icons from './icons.vue' | |||||
export default Icons |
@@ -1,2 +0,0 @@ | |||||
import InforCard from './infor-card.vue' | |||||
export default InforCard |
@@ -1,94 +0,0 @@ | |||||
<template> | |||||
<Card :shadow="shadow" class="info-card-wrapper" :padding="0"> | |||||
<div class="content-con"> | |||||
<div class="left-area" :style="{background: color, width: leftWidth}"> | |||||
<common-icon class="icon" :type="icon" :size="iconSize" color="#fff"/> | |||||
</div> | |||||
<div class="right-area" :style="{width: rightWidth}"> | |||||
<div> | |||||
<slot></slot> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</Card> | |||||
</template> | |||||
<script> | |||||
import CommonIcon from '_c/common-icon' | |||||
export default { | |||||
name: 'InforCard', | |||||
components: { | |||||
CommonIcon | |||||
}, | |||||
props: { | |||||
left: { | |||||
type: Number, | |||||
default: 36 | |||||
}, | |||||
color: { | |||||
type: String, | |||||
default: '#2d8cf0' | |||||
}, | |||||
icon: { | |||||
type: String, | |||||
default: '' | |||||
}, | |||||
iconSize: { | |||||
type: Number, | |||||
default: 20 | |||||
}, | |||||
shadow: { | |||||
type: Boolean, | |||||
default: false | |||||
} | |||||
}, | |||||
computed: { | |||||
leftWidth () { | |||||
return `${this.left}%` | |||||
}, | |||||
rightWidth () { | |||||
return `${100 - this.left}%` | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less"> | |||||
.common{ | |||||
float: left; | |||||
height: 100%; | |||||
display: table; | |||||
text-align: center; | |||||
} | |||||
.size{ | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
.middle-center{ | |||||
display: table-cell; | |||||
vertical-align: middle; | |||||
} | |||||
.info-card-wrapper{ | |||||
.size; | |||||
overflow: hidden; | |||||
.ivu-card-body{ | |||||
.size; | |||||
} | |||||
.content-con{ | |||||
.size; | |||||
position: relative; | |||||
.left-area{ | |||||
.common; | |||||
& > .icon{ | |||||
.middle-center; | |||||
} | |||||
} | |||||
.right-area{ | |||||
.common; | |||||
& > div{ | |||||
.middle-center; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
</style> |
@@ -1,2 +0,0 @@ | |||||
import LoginForm from './login-form.vue' | |||||
export default LoginForm |
@@ -1,72 +0,0 @@ | |||||
<template> | |||||
<Form ref="loginForm" :model="form" :rules="rules" @keydown.enter.native="handleSubmit"> | |||||
<FormItem prop="userName"> | |||||
<Input v-model="form.userName" placeholder="请输入用户名"> | |||||
<span slot="prepend"> | |||||
<Icon :size="16" type="ios-person"></Icon> | |||||
</span> | |||||
</Input> | |||||
</FormItem> | |||||
<FormItem prop="password"> | |||||
<Input type="password" v-model="form.password" placeholder="请输入密码"> | |||||
<span slot="prepend"> | |||||
<Icon :size="14" type="md-lock"></Icon> | |||||
</span> | |||||
</Input> | |||||
</FormItem> | |||||
<FormItem> | |||||
<Button @click="handleSubmit" type="primary" long>登录</Button> | |||||
</FormItem> | |||||
</Form> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
name: 'LoginForm', | |||||
props: { | |||||
userNameRules: { | |||||
type: Array, | |||||
default: () => { | |||||
return [ | |||||
{ required: true, message: '账号不能为空', trigger: 'blur' } | |||||
] | |||||
} | |||||
}, | |||||
passwordRules: { | |||||
type: Array, | |||||
default: () => { | |||||
return [ | |||||
{ required: true, message: '密码不能为空', trigger: 'blur' } | |||||
] | |||||
} | |||||
} | |||||
}, | |||||
data () { | |||||
return { | |||||
form: { | |||||
userName: 'super_admin', | |||||
password: '' | |||||
} | |||||
} | |||||
}, | |||||
computed: { | |||||
rules () { | |||||
return { | |||||
userName: this.userNameRules, | |||||
password: this.passwordRules | |||||
} | |||||
} | |||||
}, | |||||
methods: { | |||||
handleSubmit () { | |||||
this.$refs.loginForm.validate((valid) => { | |||||
if (valid) { | |||||
this.$emit('on-success-valid', { | |||||
userName: this.form.userName, | |||||
password: this.form.password | |||||
}) | |||||
} | |||||
}) | |||||
} | |||||
} | |||||
} | |||||
</script> |
@@ -1,2 +0,0 @@ | |||||
import ABackTop from './index.vue' | |||||
export default ABackTop |
@@ -1,90 +0,0 @@ | |||||
<template> | |||||
<div :class="classes" :style="styles" @click="back"> | |||||
<slot> | |||||
<div :class="innerClasses"> | |||||
<i class="ivu-icon ivu-icon-ios-arrow-up"></i> | |||||
</div> | |||||
</slot> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { scrollTop } from '@/libs/util' | |||||
import { on, off } from '@/libs/tools' | |||||
const prefixCls = 'ivu-back-top' | |||||
export default { | |||||
name: 'ABackTop', | |||||
props: { | |||||
height: { | |||||
type: Number, | |||||
default: 400 | |||||
}, | |||||
bottom: { | |||||
type: Number, | |||||
default: 30 | |||||
}, | |||||
right: { | |||||
type: Number, | |||||
default: 30 | |||||
}, | |||||
duration: { | |||||
type: Number, | |||||
default: 1000 | |||||
}, | |||||
container: { | |||||
type: null, | |||||
default: window | |||||
} | |||||
}, | |||||
data () { | |||||
return { | |||||
backTop: false | |||||
} | |||||
}, | |||||
mounted () { | |||||
// window.addEventListener('scroll', this.handleScroll, false) | |||||
// window.addEventListener('resize', this.handleScroll, false) | |||||
on(this.containerEle, 'scroll', this.handleScroll) | |||||
on(this.containerEle, 'resize', this.handleScroll) | |||||
}, | |||||
beforeDestroy () { | |||||
// window.removeEventListener('scroll', this.handleScroll, false) | |||||
// window.removeEventListener('resize', this.handleScroll, false) | |||||
off(this.containerEle, 'scroll', this.handleScroll) | |||||
off(this.containerEle, 'resize', this.handleScroll) | |||||
}, | |||||
computed: { | |||||
classes () { | |||||
return [ | |||||
`${prefixCls}`, | |||||
{ | |||||
[`${prefixCls}-show`]: this.backTop | |||||
} | |||||
] | |||||
}, | |||||
styles () { | |||||
return { | |||||
bottom: `${this.bottom}px`, | |||||
right: `${this.right}px` | |||||
} | |||||
}, | |||||
innerClasses () { | |||||
return `${prefixCls}-inner` | |||||
}, | |||||
containerEle () { | |||||
return this.container === window ? window : document.querySelector(this.container) | |||||
} | |||||
}, | |||||
methods: { | |||||
handleScroll () { | |||||
this.backTop = this.containerEle.scrollTop >= this.height | |||||
}, | |||||
back () { | |||||
let target = typeof this.container === 'string' ? this.containerEle : (document.documentElement || document.body) | |||||
const sTop = target.scrollTop | |||||
scrollTop(this.containerEle, sTop, 0, this.duration) | |||||
this.$emit('on-click') | |||||
} | |||||
} | |||||
} | |||||
</script> |
@@ -1,49 +0,0 @@ | |||||
<template> | |||||
<div class="error-store"> | |||||
<Badge dot :count="countComputed"> | |||||
<Button type="text" @click="openErrorLoggerPage"> | |||||
<Icon :size="20" type="ios-bug"/> | |||||
</Button> | |||||
</Badge> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
name: 'ErrorStore', | |||||
props: { | |||||
count: { | |||||
type: Number, | |||||
default: 0 | |||||
}, | |||||
hasRead: { | |||||
type: Boolean, | |||||
default: false | |||||
} | |||||
}, | |||||
computed: { | |||||
countComputed () { | |||||
return this.hasRead ? 0 : this.count | |||||
} | |||||
}, | |||||
methods: { | |||||
openErrorLoggerPage () { | |||||
this.$router.push({ | |||||
name: 'error_logger_page' | |||||
}) | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less"> | |||||
.error-store{ | |||||
margin-right: 12px; | |||||
.ivu-badge-dot{ | |||||
top: 20px; | |||||
} | |||||
.ivu-btn.ivu-btn-text{ | |||||
padding: 5px 1px 6px; | |||||
} | |||||
} | |||||
</style> |
@@ -1,2 +0,0 @@ | |||||
import ErrorStore from './error-store.vue' | |||||
export default ErrorStore |
@@ -1,84 +0,0 @@ | |||||
<template> | |||||
<div v-if="showFullScreenBtn" class="full-screen-btn-con"> | |||||
<Tooltip :content="value ? '退出全屏' : '全屏'" placement="bottom"> | |||||
<Icon @click.native="handleChange" :type="value ? 'md-contract' : 'md-expand'" :size="23"></Icon> | |||||
</Tooltip> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
name: 'Fullscreen', | |||||
computed: { | |||||
showFullScreenBtn () { | |||||
return window.navigator.userAgent.indexOf('MSIE') < 0 | |||||
} | |||||
}, | |||||
props: { | |||||
value: { | |||||
type: Boolean, | |||||
default: false | |||||
} | |||||
}, | |||||
methods: { | |||||
handleFullscreen () { | |||||
let main = document.body | |||||
if (this.value) { | |||||
if (document.exitFullscreen) { | |||||
document.exitFullscreen() | |||||
} else if (document.mozCancelFullScreen) { | |||||
document.mozCancelFullScreen() | |||||
} else if (document.webkitCancelFullScreen) { | |||||
document.webkitCancelFullScreen() | |||||
} else if (document.msExitFullscreen) { | |||||
document.msExitFullscreen() | |||||
} | |||||
} else { | |||||
if (main.requestFullscreen) { | |||||
main.requestFullscreen() | |||||
} else if (main.mozRequestFullScreen) { | |||||
main.mozRequestFullScreen() | |||||
} else if (main.webkitRequestFullScreen) { | |||||
main.webkitRequestFullScreen() | |||||
} else if (main.msRequestFullscreen) { | |||||
main.msRequestFullscreen() | |||||
} | |||||
} | |||||
}, | |||||
handleChange () { | |||||
this.handleFullscreen() | |||||
} | |||||
}, | |||||
mounted () { | |||||
let isFullscreen = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen | |||||
isFullscreen = !!isFullscreen | |||||
document.addEventListener('fullscreenchange', () => { | |||||
this.$emit('input', !this.value) | |||||
this.$emit('on-change', !this.value) | |||||
}) | |||||
document.addEventListener('mozfullscreenchange', () => { | |||||
this.$emit('input', !this.value) | |||||
this.$emit('on-change', !this.value) | |||||
}) | |||||
document.addEventListener('webkitfullscreenchange', () => { | |||||
this.$emit('input', !this.value) | |||||
this.$emit('on-change', !this.value) | |||||
}) | |||||
document.addEventListener('msfullscreenchange', () => { | |||||
this.$emit('input', !this.value) | |||||
this.$emit('on-change', !this.value) | |||||
}) | |||||
this.$emit('input', isFullscreen) | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less"> | |||||
.full-screen-btn-con .ivu-tooltip-rel{ | |||||
height: 64px; | |||||
line-height: 56px; | |||||
i{ | |||||
cursor: pointer; | |||||
} | |||||
} | |||||
</style> |
@@ -1,2 +0,0 @@ | |||||
import Fullscreen from './fullscreen.vue' | |||||
export default Fullscreen |
@@ -1,4 +0,0 @@ | |||||
.custom-bread-crumb{ | |||||
display: inline-block; | |||||
vertical-align: top; | |||||
} |
@@ -1,46 +0,0 @@ | |||||
<template> | |||||
<div class="custom-bread-crumb"> | |||||
<Breadcrumb :style="{fontSize: `${fontSize}px`}"> | |||||
<BreadcrumbItem v-for="item in list" :to="item.to" :key="`bread-crumb-${item.name}`"> | |||||
<common-icon style="margin-right: 4px;" :type="item.icon || ''"/> | |||||
{{ showTitle(item) }} | |||||
</BreadcrumbItem> | |||||
</Breadcrumb> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { showTitle } from '@/libs/util' | |||||
import CommonIcon from '_c/common-icon' | |||||
import './custom-bread-crumb.less' | |||||
export default { | |||||
name: 'customBreadCrumb', | |||||
components: { | |||||
CommonIcon | |||||
}, | |||||
props: { | |||||
list: { | |||||
type: Array, | |||||
default: () => [] | |||||
}, | |||||
fontSize: { | |||||
type: Number, | |||||
default: 14 | |||||
}, | |||||
showIcon: { | |||||
type: Boolean, | |||||
default: false | |||||
} | |||||
}, | |||||
methods: { | |||||
showTitle (item) { | |||||
return showTitle(item, this) | |||||
}, | |||||
isCustomIcon (iconName) { | |||||
return iconName.indexOf('_') === 0 | |||||
}, | |||||
getCustomIconName (iconName) { | |||||
return iconName.slice(1) | |||||
} | |||||
} | |||||
} | |||||
</script> |
@@ -1,2 +0,0 @@ | |||||
import customBreadCrumb from './custom-bread-crumb.vue' | |||||
export default customBreadCrumb |
@@ -1,14 +0,0 @@ | |||||
.header-bar{ | |||||
width: 100%; | |||||
height: 100%; | |||||
position: relative; | |||||
.custom-content-con{ | |||||
float: right; | |||||
height: auto; | |||||
padding-right: 20px; | |||||
line-height: 64px; | |||||
& > *{ | |||||
float: right; | |||||
} | |||||
} | |||||
} |
@@ -1,34 +0,0 @@ | |||||
<template> | |||||
<div class="header-bar"> | |||||
<sider-trigger :collapsed="collapsed" icon="md-menu" @on-change="handleCollpasedChange"></sider-trigger> | |||||
<custom-bread-crumb show-icon style="margin-left: 30px;" :list="breadCrumbList"></custom-bread-crumb> | |||||
<div class="custom-content-con"> | |||||
<slot></slot> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import siderTrigger from './sider-trigger' | |||||
import customBreadCrumb from './custom-bread-crumb' | |||||
import './header-bar.less' | |||||
export default { | |||||
name: 'HeaderBar', | |||||
components: { | |||||
siderTrigger, | |||||
customBreadCrumb | |||||
}, | |||||
props: { | |||||
collapsed: Boolean | |||||
}, | |||||
computed: { | |||||
breadCrumbList () { | |||||
return this.$store.state.app.breadCrumbList | |||||
} | |||||
}, | |||||
methods: { | |||||
handleCollpasedChange (state) { | |||||
this.$emit('on-coll-change', state) | |||||
} | |||||
} | |||||
} | |||||
</script> |
@@ -1,2 +0,0 @@ | |||||
import HeaderBar from './header-bar' | |||||
export default HeaderBar |
@@ -1,2 +0,0 @@ | |||||
import siderTrigger from './sider-trigger.vue' | |||||
export default siderTrigger |
@@ -1,21 +0,0 @@ | |||||
.trans{ | |||||
transition: transform .2s ease; | |||||
} | |||||
@size: 40px; | |||||
.sider-trigger-a{ | |||||
padding: 6px; | |||||
width: @size; | |||||
height: @size; | |||||
display: inline-block; | |||||
text-align: center; | |||||
color: #5c6b77; | |||||
margin-top: 12px; | |||||
i{ | |||||
.trans; | |||||
vertical-align: top; | |||||
} | |||||
&.collapsed i{ | |||||
transform: rotateZ(90deg); | |||||
.trans; | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
<template> | |||||
<a @click="handleChange" type="text" :class="['sider-trigger-a', collapsed ? 'collapsed' : '']"><Icon :type="icon" :size="size" /></a> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
name: 'siderTrigger', | |||||
props: { | |||||
collapsed: Boolean, | |||||
icon: { | |||||
type: String, | |||||
default: 'navicon-round' | |||||
}, | |||||
size: { | |||||
type: Number, | |||||
default: 26 | |||||
} | |||||
}, | |||||
methods: { | |||||
handleChange () { | |||||
this.$emit('on-change', !this.collapsed) | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less"> | |||||
@import './sider-trigger.less'; | |||||
</style> |
@@ -1,2 +0,0 @@ | |||||
import Language from './language.vue' | |||||
export default Language |
@@ -1,51 +0,0 @@ | |||||
<template> | |||||
<div> | |||||
<Dropdown trigger="click" @on-click="selectLang"> | |||||
<a href="javascript:void(0)"> | |||||
{{ title }} | |||||
<Icon :size="18" type="md-arrow-dropdown" /> | |||||
</a> | |||||
<DropdownMenu slot="list"> | |||||
<DropdownItem v-for="(value, key) in localList" :name="key" :key="`lang-${key}`">{{ value }}</DropdownItem> | |||||
</DropdownMenu> | |||||
</Dropdown> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
name: 'Language', | |||||
props: { | |||||
lang: String | |||||
}, | |||||
data () { | |||||
return { | |||||
langList: { | |||||
'zh-CN': '语言', | |||||
'zh-TW': '語言', | |||||
'en-US': 'Lang' | |||||
}, | |||||
localList: { | |||||
'zh-CN': '中文简体', | |||||
'zh-TW': '中文繁体', | |||||
'en-US': 'English' | |||||
} | |||||
} | |||||
}, | |||||
watch: { | |||||
lang (lang) { | |||||
this.$i18n.locale = lang | |||||
} | |||||
}, | |||||
computed: { | |||||
title () { | |||||
return this.langList[this.lang] | |||||
} | |||||
}, | |||||
methods: { | |||||
selectLang (name) { | |||||
this.$emit('on-lang-change', name) | |||||
} | |||||
} | |||||
} | |||||
</script> |
@@ -1,51 +0,0 @@ | |||||
<template> | |||||
<Dropdown ref="dropdown" @on-click="handleClick" :class="hideTitle ? '' : 'collased-menu-dropdown'" :transfer="hideTitle" :placement="placement"> | |||||
<a class="drop-menu-a" type="text" @mouseover="handleMousemove($event, children)" :style="{textAlign: !hideTitle ? 'left' : ''}"><common-icon :size="rootIconSize" :color="textColor" :type="parentItem.icon"/><span class="menu-title" v-if="!hideTitle">{{ showTitle(parentItem) }}</span><Icon style="float: right;" v-if="!hideTitle" type="ios-arrow-forward" :size="16"/></a> | |||||
<DropdownMenu ref="dropdown" slot="list"> | |||||
<template v-for="child in children"> | |||||
<collapsed-menu v-if="showChildren(child)" :icon-size="iconSize" :parent-item="child" :key="`drop-${child.name}`"></collapsed-menu> | |||||
<DropdownItem v-else :key="`drop-${child.name}`" :name="child.name"><common-icon :size="iconSize" :type="child.icon"/><span class="menu-title">{{ showTitle(child) }}</span></DropdownItem> | |||||
</template> | |||||
</DropdownMenu> | |||||
</Dropdown> | |||||
</template> | |||||
<script> | |||||
import mixin from './mixin' | |||||
import itemMixin from './item-mixin' | |||||
import { findNodeUpperByClasses } from '@/libs/util' | |||||
export default { | |||||
name: 'CollapsedMenu', | |||||
mixins: [ mixin, itemMixin ], | |||||
props: { | |||||
hideTitle: { | |||||
type: Boolean, | |||||
default: false | |||||
}, | |||||
rootIconSize: { | |||||
type: Number, | |||||
default: 16 | |||||
} | |||||
}, | |||||
data () { | |||||
return { | |||||
placement: 'right-end' | |||||
} | |||||
}, | |||||
methods: { | |||||
handleClick (name) { | |||||
this.$emit('on-click', name) | |||||
}, | |||||
handleMousemove (event, children) { | |||||
const { pageY } = event | |||||
const height = children.length * 38 | |||||
const isOverflow = pageY + height < window.innerHeight | |||||
this.placement = isOverflow ? 'right-start' : 'right-end' | |||||
} | |||||
}, | |||||
mounted () { | |||||
let dropdown = findNodeUpperByClasses(this.$refs.dropdown.$el, ['ivu-select-dropdown', 'ivu-dropdown-transfer']) | |||||
if (dropdown) dropdown.style.overflow = 'visible' | |||||
} | |||||
} | |||||
</script> |