Example #1
0
 /// <summary>
 /// 获取组名称。
 /// </summary>
 /// <param name="descriptor">服务描述符。</param>
 /// <returns>组名称。</returns>
 public static string GroupName(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata <string>("GroupName"));
 }
Example #2
0
 /// <summary>
 /// 获取是否启用授权
 /// </summary>
 /// <param name="descriptor">服务描述符。</param>
 /// <returns>服务描述符。</returns>
 public static bool EnableAuthorization(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata("EnableAuthorization", false));
 }
Example #3
0
 /// <summary>
 /// 获取日期
 /// </summary>
 /// <param name="descriptor">服务描述符。</param>
 /// <returns>服务描述符。</returns>
 public static string Date(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata <string>("Date"));
 }
Example #4
0
 /// <summary>
 /// 获取释放等待执行的设置。
 /// </summary>
 /// <param name="descriptor">服务描述符。</param>
 /// <returns>如果需要等待执行则为true,否则为false,默认为true。</returns>
 public static bool WaitExecution(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata("WaitExecution", true));
 }
Example #5
0
 /// <summary>
 /// 获取授权类型
 /// </summary>
 /// <param name="descriptor">服务描述符。</param>
 /// <returns>服务描述符。</returns>
 public static string AuthType(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata("AuthType", AuthorizationType.AppSecret.ToString()));
 }
Example #6
0
 /// <summary>
 /// 获取负责人
 /// </summary>
 /// <param name="descriptor">服务描述符。</param>
 /// <returns></returns>
 public static string Director(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata <string>("Director"));
 }
Example #7
0
 /// <summary>
 /// 获取授权类型
 /// </summary>
 /// <param name="descriptor">服务描述符。</param>
 /// <returns>服务描述符。</returns>
 public static string AuthType(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata("AuthType", ""));
 }
Example #8
0
 /// <summary>
 /// 获取是否禁用外网访问
 /// </summary>
 /// <param name="descriptor">服务描述符。</param>
 /// <returns>服务描述符。</returns>
 public static bool DisableNetwork(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata("DisableNetwork", false));
 }
Example #9
0
 /// <summary>
 /// 获取HTTP方法
 /// </summary>
 /// <param name="descriptor"></param>
 /// <returns></returns>
 public static string HttpMethod(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata("httpMethod", ""));
 }
 public static bool AllowPermission(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata("AllowPermission", false));
 }
Example #11
0
 public static int WsPort(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata <int>("WsPort", 96));
 }
Example #12
0
 public static int HttpPort(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata <int>("HttpPort", 280));
 }
Example #13
0
 public static int MqttPort(this ServiceDescriptor descriptor)
 {
     return(descriptor.GetMetadata <int>("MqttPort", 97));
 }