ProtoInfo.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using Grpc.Core;
  2. using System;
  3. using System.Collections.Concurrent;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. namespace TEAMModelOS.SDK.Module.GrpcServer.Model
  7. {
  8. public class ProtoInfo
  9. {
  10. /// <summary>
  11. /// grpc服务方法信息 用于生成proto文件
  12. /// </summary>
  13. public static List<ProtoMethodInfo> Methods { get; internal set; } = new List<ProtoMethodInfo>();
  14. }
  15. /// <summary>
  16. /// 注册到grpc的服务方法信息
  17. /// </summary>
  18. public class ProtoMethodInfo
  19. {
  20. public string ServiceName { get; set; }
  21. public string MethodName { get; set; }
  22. public string RequestName { get; set; }
  23. public string ResponseName { get; set; }
  24. public string FullName
  25. {
  26. get { return "/" + ServiceName + "/" + MethodName; }
  27. }
  28. public MethodType MethodType { get; set; }
  29. public static ConcurrentDictionary<string, string> Protos = new ConcurrentDictionary<string, string>();
  30. }
  31. }